persist filter_[cat/value] in redirects

This commit is contained in:
Martijn Voncken 2008-07-05 16:04:56 +00:00
parent 14b5aabfa6
commit 88d12ef63b
3 changed files with 7 additions and 10 deletions

View File

@ -94,8 +94,12 @@ class index:
if not vars.sort: #no arguments, default to coockies. if not vars.sort: #no arguments, default to coockies.
vars.update(cookies()) vars.update(cookies())
else: #has arguments:set cookies from arguments. else: #has arguments:set cookies from arguments.
for key in ["sort", "order", "state", "tracker", "keyword"]: for key in ["sort", "order", "filter_cat","filter_value"]:
setcookie(key,getattr(vars,key)) value = getattr(vars, key)
if value:
setcookie(key, value)
else:
setcookie(key, "")
#organize-filters #organize-filters
label_filters = {} label_filters = {}

View File

@ -113,13 +113,6 @@ def error_page(error):
web.header("Cache-Control", "no-cache, must-revalidate") web.header("Cache-Control", "no-cache, must-revalidate")
print render.error(error) print render.error(error)
#template-defs:
"""
obsolete:
def category_tabs(torrent_list):
filter_tabs, category_tabs = get_category_choosers(torrent_list)
return render.part_categories(filter_tabs, category_tabs)
"""
def template_crop_middle(text, maxlen): def template_crop_middle(text, maxlen):
try: try:

View File

@ -1,6 +1,6 @@
$def with (column_id, column_name, order, active_up, active_down) $def with (column_id, column_name, order, active_up, active_down)
<th class="torrent_table"> <th class="torrent_table">
<a href="$base/index?sort=$column_id&order=$order&state=$get('state')&tracker=$get('tracker')&keyword=$get('keyword')""> <a href="$base/index?sort=$column_id&order=$order&filter_cat=$get('filter_cat')&filter_value=$get('filter_value')"">
$column_name\ $column_name\
$if active_up: $if active_up:
<img src="$base/static/images/tango/up.png" /> <img src="$base/static/images/tango/up.png" />