diff --git a/deluge/ui/webui/pages.py b/deluge/ui/webui/pages.py index 3106f0c51..51d0af74e 100644 --- a/deluge/ui/webui/pages.py +++ b/deluge/ui/webui/pages.py @@ -90,10 +90,9 @@ class index: def GET(self, name): vars = web.input(sort=None, order=None, filter_cat=None ,filter_value=None , tracker=None) - #cookies are a delicious delecacy. if not vars.sort: #no arguments, default to coockies. newvars = cookies() - if vars.filter_cat: #i'm doing it wrong :( , but it works.. + if vars.filter_cat: newvars['filter_cat'] = vars.filter_cat newvars['filter_value'] = vars.filter_value vars.update(newvars) @@ -105,7 +104,7 @@ class index: #Filters filter_dict = {} - if vars.filter_cat and vars.filter_value and vars.filter_value <> "All": + if vars.filter_cat and vars.filter_value <> "All": filter_dict = {vars.filter_cat:vars.filter_value} torrents = proxy.get_torrents_status(filter_dict, TORRENT_KEYS) diff --git a/deluge/ui/webui/render.py b/deluge/ui/webui/render.py index f0ef48a98..7f4fb0a53 100644 --- a/deluge/ui/webui/render.py +++ b/deluge/ui/webui/render.py @@ -178,7 +178,7 @@ def template_get(key): val = getattr(web.input(**{key:None}), key) if not val: val = getcookie(key) - return val + return val or "" def id_to_label(text): "translated capitalize" diff --git a/deluge/ui/webui/templates/white/part_label_filters.html b/deluge/ui/webui/templates/white/part_label_filters.html index 1a3a93624..9abd169eb 100644 --- a/deluge/ui/webui/templates/white/part_label_filters.html +++ b/deluge/ui/webui/templates/white/part_label_filters.html @@ -44,7 +44,13 @@ $for cat in filter_items.keys(): $if cat == "tracker_host": - $value ($count) + $if not value: + $if cat == "label": + $_("No Label") ($count) + $else: + $_("None") ($count) + $else: + $value ($count)