From 88d12ef63bb13d3d66afe3d3f5f0ff8c9623e1fe Mon Sep 17 00:00:00 2001 From: Martijn Voncken Date: Sat, 5 Jul 2008 16:04:56 +0000 Subject: [PATCH] persist filter_[cat/value] in redirects --- deluge/ui/webui/pages.py | 8 ++++++-- deluge/ui/webui/render.py | 7 ------- deluge/ui/webui/templates/deluge/sort_column_head.html | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/deluge/ui/webui/pages.py b/deluge/ui/webui/pages.py index fade1c257..85bf467fb 100644 --- a/deluge/ui/webui/pages.py +++ b/deluge/ui/webui/pages.py @@ -94,8 +94,12 @@ class index: if not vars.sort: #no arguments, default to coockies. vars.update(cookies()) else: #has arguments:set cookies from arguments. - for key in ["sort", "order", "state", "tracker", "keyword"]: - setcookie(key,getattr(vars,key)) + for key in ["sort", "order", "filter_cat","filter_value"]: + value = getattr(vars, key) + if value: + setcookie(key, value) + else: + setcookie(key, "") #organize-filters label_filters = {} diff --git a/deluge/ui/webui/render.py b/deluge/ui/webui/render.py index 8800364e3..708f512b7 100644 --- a/deluge/ui/webui/render.py +++ b/deluge/ui/webui/render.py @@ -113,13 +113,6 @@ def error_page(error): web.header("Cache-Control", "no-cache, must-revalidate") 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): try: diff --git a/deluge/ui/webui/templates/deluge/sort_column_head.html b/deluge/ui/webui/templates/deluge/sort_column_head.html index 4d7ea981b..e12b447ad 100644 --- a/deluge/ui/webui/templates/deluge/sort_column_head.html +++ b/deluge/ui/webui/templates/deluge/sort_column_head.html @@ -1,6 +1,6 @@ $def with (column_id, column_name, order, active_up, active_down) - + $column_name\ $if active_up: