From 14b5aabfa6c3a8a2697adbda9bbad91fd8662943 Mon Sep 17 00:00:00 2001 From: Martijn Voncken Date: Sat, 5 Jul 2008 15:38:07 +0000 Subject: [PATCH] purging organize pt1 --- deluge/ui/webui/TODO | 5 ++ deluge/ui/webui/components.py | 7 ++- deluge/ui/webui/pages.py | 17 ++++-- .../templates/advanced/part_torrent_list.html | 14 +++-- .../webui/templates/deluge/part_organize.html | 44 +------------- deluge/ui/webui/templates/white/index.html | 9 +-- .../webui/templates/white/part_organize.html | 58 +------------------ deluge/ui/webui/webserver_common.py | 3 +- 8 files changed, 39 insertions(+), 118 deletions(-) diff --git a/deluge/ui/webui/TODO b/deluge/ui/webui/TODO index 4407c8dfd..312b555e0 100644 --- a/deluge/ui/webui/TODO +++ b/deluge/ui/webui/TODO @@ -1,3 +1,8 @@ +After labels: +*templates : remove advanced , rename deluge to classic , result ->classic template:no-javascript ; white -> static enhanced with js ; ajax-template -> damoxc. +*white temnplate: add deluge icon. +*fix all comments from IRC-nonicknamename2. + 0.6 : *plugin-config + (re)enable webui plugins. *Fix IE7 for advanced/white template. diff --git a/deluge/ui/webui/components.py b/deluge/ui/webui/components.py index 7457c0c68..aad20c0b1 100644 --- a/deluge/ui/webui/components.py +++ b/deluge/ui/webui/components.py @@ -183,12 +183,17 @@ class PluginApi(component.Component): import web from render import render import page_decorators as deco + import utils + import lib.newforms_plus as forms self.render = render self.web = web self.deco = deco + self.forms = forms self.page_manager = component.get("PageManager") - + self.config_page_manager = component.get("ConfigPageManager") + self.menu_manager = component.get("MenuManager") + self.utils = utils def register(): __plugin_manager = PluginManager() diff --git a/deluge/ui/webui/pages.py b/deluge/ui/webui/pages.py index 31cde4e98..fade1c257 100644 --- a/deluge/ui/webui/pages.py +++ b/deluge/ui/webui/pages.py @@ -88,7 +88,7 @@ class index: @deco.deluge_page @deco.auto_refreshed def GET(self, name): - vars = web.input(sort=None, order=None, state=None , tracker=None, keyword=None) + 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. @@ -98,16 +98,21 @@ class index: setcookie(key,getattr(vars,key)) #organize-filters - organize_filters = {} - if 'Organize' in proxy.get_enabled_plugins(): + label_filters = {} + if 'label' in proxy.get_enabled_plugins(): filter_dict = {} + if vars.filter_cat and vars.filter_value and vars.filter_value <> "All": + filter_dict = {vars.filter_cat:vars.filter_value} + """ + TODO... for filter_name in ["state","tracker","keyword"]: value = getattr(vars, filter_name) if value and value <> "All" and value <> "None": filter_dict[filter_name] = value log.debug(filter_dict) - torrent_ids = proxy.organize_get_session_state(filter_dict) - organize_filters = Storage(proxy.organize_all_filter_items()) + """ + torrent_ids = proxy.label_get_filtered_ids(filter_dict) + label_filters = proxy.label_filter_items() else: torrent_ids = proxy.get_session_state() @@ -124,7 +129,7 @@ class index: if vars.order == 'up': torrent_list = list(reversed(torrent_list)) - return render.index(torrent_list, organize_filters) + return render.index(torrent_list, label_filters) route('/index',index) #simple proxy's to deluge.ui.client diff --git a/deluge/ui/webui/templates/advanced/part_torrent_list.html b/deluge/ui/webui/templates/advanced/part_torrent_list.html index 577e607dc..4df6e3583 100644 --- a/deluge/ui/webui/templates/advanced/part_torrent_list.html +++ b/deluge/ui/webui/templates/advanced/part_torrent_list.html @@ -1,4 +1,4 @@ -$def with (torrent_list, organize_filters) +$def with (torrent_list, label_filters)