diff --git a/deluge/ui/webui/render.py b/deluge/ui/webui/render.py
index aec76c9de..936868d5b 100644
--- a/deluge/ui/webui/render.py
+++ b/deluge/ui/webui/render.py
@@ -174,6 +174,11 @@ def ftime(val):
return _("∞")
return common.ftime(val)
+def template_get(key):
+ val = getattr(web.input(**{key:None}), key)
+ if not val:
+ return getcookie(key)
+
template.Template.globals.update({
'sort_head': template_sort_head,
'part_stats':template_part_stats,
@@ -195,7 +200,7 @@ template.Template.globals.update({
'version':common.get_version() ,
'rev': common.get_revision(),
'getcookie':getcookie,
- 'get': lambda (var): getattr(web.input(**{var:None}), var), # unreadable :-(
+ 'get': template_get,
#'env':'0.6',
'forms':web.Storage(),
'enumerate':enumerate,
diff --git a/deluge/ui/webui/templates/white/part_label_filters.html b/deluge/ui/webui/templates/white/part_label_filters.html
index 62272ea3b..33c48d912 100644
--- a/deluge/ui/webui/templates/white/part_label_filters.html
+++ b/deluge/ui/webui/templates/white/part_label_filters.html
@@ -39,7 +39,7 @@ $for cat in ["state", "tracker", "label"]:
$if not get('filter_cat'):
class="selected"
>
-
+
$if cat == "state":
$value ($count)