label: remember filters

This commit is contained in:
Martijn Voncken 2008-07-12 11:18:27 +00:00
parent c1c2ce4244
commit 32e2e37277
2 changed files with 7 additions and 2 deletions

View File

@ -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,

View File

@ -39,7 +39,7 @@ $for cat in ["state", "tracker", "label"]:
$if not get('filter_cat'):
class="selected"
>
<a href="$self_url(filter_cat=cat, filter_value=value)">
<a href="$self_url(filter_cat=cat, filter_value=value, sort=get('sort'), order=get('order')) ">
$if cat == "state":
<img src="/pixmaps/$(value.lower())"></img>
$value ($count)</a>