From 4dad638a41c041bd661a69af17ff0753ceeb3595 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Mon, 26 Nov 2007 16:06:55 +0000 Subject: [PATCH] webui tweaks rev 160 --- plugins/WebUi/deluge_webserver.py | 23 +++++++++++---- plugins/WebUi/revno | 2 +- plugins/WebUi/templates/advanced/index.html | 16 +++++----- .../templates/advanced/part_categories.html | 7 ++++- .../templates/advanced/static/advanced.css | 29 ++++++++++++++++++- .../WebUi/templates/advanced/static/deluge.js | 25 +++++++++------- plugins/WebUi/templates/deluge/tab_meta.html | 4 +-- plugins/WebUi/version | 6 ++-- 8 files changed, 82 insertions(+), 30 deletions(-) diff --git a/plugins/WebUi/deluge_webserver.py b/plugins/WebUi/deluge_webserver.py index 618802143..5b48359e1 100644 --- a/plugins/WebUi/deluge_webserver.py +++ b/plugins/WebUi/deluge_webserver.py @@ -177,16 +177,29 @@ class torrent_add: @check_session def POST(self, name): - vars = web.input(url = None, torrent = {}) + """ + allows: + *posting of url + *posting file-upload + *posting of data as string(for greasemonkey-private) + """ - if vars.url and vars.torrent.filename: + vars = web.input(url = None, torrent = {}, + torrent_name=None, torrent_data = None) + + torrent_name = vars.torrent_name + torrent_data = vars.torrent_data + if vars.torrent.filename: + torrent_name = vars.torrent.filename + torrent_data = vars.torrent.file.read() + + if vars.url and torrent_name: error_page(_("Choose an url or a torrent, not both.")) if vars.url: ws.proxy.add_torrent_url(vars.url) do_redirect() - elif vars.torrent.filename: - data = vars.torrent.file.read() - data_b64 = base64.b64encode(data) + elif torrent_name: + data_b64 = base64.b64encode(torrent_data) #b64 because of strange bug-reports related to binary data ws.proxy.add_torrent_filecontent(vars.torrent.filename, data_b64) do_redirect() diff --git a/plugins/WebUi/revno b/plugins/WebUi/revno index bb7936535..a76256037 100644 --- a/plugins/WebUi/revno +++ b/plugins/WebUi/revno @@ -1 +1 @@ -155 +160 diff --git a/plugins/WebUi/templates/advanced/index.html b/plugins/WebUi/templates/advanced/index.html index 0bdd937ea..612141a1e 100644 --- a/plugins/WebUi/templates/advanced/index.html +++ b/plugins/WebUi/templates/advanced/index.html @@ -4,40 +4,40 @@ $:render.header(_('Torrent list'))
@@ -67,6 +67,7 @@ $#end $:(sort_head('name', _('Name'))) $:(sort_head('total_size', _('Size'))) $:(sort_head('progress', _('Progress'))) + $:(sort_head('category', _('Tracker'))) $:(sort_head('num_seeds', _('Seeders'))) $:(sort_head('num_peers', _('Peers'))) $:(sort_head('download_rate', _('Download'))) @@ -99,6 +100,7 @@ $for torrent in torrent_list:
+ $torrent.category $torrent.num_seeds ($torrent.total_seeds) $torrent.num_peers ($torrent.total_peers) diff --git a/plugins/WebUi/templates/advanced/part_categories.html b/plugins/WebUi/templates/advanced/part_categories.html index 64ca21f8c..14d573c12 100644 --- a/plugins/WebUi/templates/advanced/part_categories.html +++ b/plugins/WebUi/templates/advanced/part_categories.html @@ -1,5 +1,5 @@ $def with (filter_tabs, category_tabs) -
+ +
diff --git a/plugins/WebUi/templates/advanced/static/advanced.css b/plugins/WebUi/templates/advanced/static/advanced.css index 3e7753080..ccaec5eb7 100644 --- a/plugins/WebUi/templates/advanced/static/advanced.css +++ b/plugins/WebUi/templates/advanced/static/advanced.css @@ -163,7 +163,7 @@ body.inner { padding-bottom:5px; margin-bottom: 15px; padding-left:32px; - height:16px; + height:20px; } #toolbar select{ @@ -183,6 +183,7 @@ a.toolbar_btn { padding-top:7px; padding-right:3px; text-decoration: none; + margin-bottom:3px; } a.toolbar_btn:hover { background-color:#68a; @@ -190,6 +191,32 @@ a.toolbar_btn:hover { text-decoration: none; } + +#toolbar_refresh { + margin:0; + border:0; + background-color:none; + padding-left:2px; + padding-top:2px; + padding-right:2px; + text-decoration: none; + background-color: #37506f; + position:relative; + top:5px; +} +#toolbar_refresh:hover { + background-color:#68a; + -moz-border-radius:5px; + text-decoration: none; +} +#category_form{ + display:inline; + position:relative; + top:-3px; + padding-left:20px; +} + + form { /*all forms!*/ margin:0; padding:0; diff --git a/plugins/WebUi/templates/advanced/static/deluge.js b/plugins/WebUi/templates/advanced/static/deluge.js index 88d4aa0ac..4cb557ffd 100644 --- a/plugins/WebUi/templates/advanced/static/deluge.js +++ b/plugins/WebUi/templates/advanced/static/deluge.js @@ -97,19 +97,24 @@ function on_click_do_nothing(e, id){ on_click_action = on_click_do_nothing; /*toobar buttons, */ -function toolbar_post(url) { - /*this feels hacky, but it's the only way i know of*/ - var ids = state.selected_rows.join(','); - var form = $('toolbar_form'); - form.action = url +ids; - form.submit(); +function toolbar_post(url, selected) { + if ((!selected) || (state.selected_rows.length > 0)) { + var ids = state.selected_rows.join(','); + var form = $('toolbar_form'); + form.action = url +ids; + form.submit(); + } return false; } -function toolbar_get(url) { - /*this feels hacky, but it's the only way i know of*/ - var ids = state.selected_rows.join(','); - window.location.href = url +ids; +function toolbar_get(url , selected) { + if (!selected) { + window.location.href = url + } + else if (state.selected_rows.length > 0) { + var ids = state.selected_rows.join(','); + window.location.href = url +ids; + } return false; } diff --git a/plugins/WebUi/templates/deluge/tab_meta.html b/plugins/WebUi/templates/deluge/tab_meta.html index 6a1de18de..e7f7f4bf2 100644 --- a/plugins/WebUi/templates/deluge/tab_meta.html +++ b/plugins/WebUi/templates/deluge/tab_meta.html @@ -68,10 +68,10 @@ $fspeed(torrent.download_rate) $torrent.num_files $_('Tracker'): -$(crop(torrent.tracker, 30)) +$(crop(torrent.tracker, 30)) $_('Tracker Status'): -$torrent.tracker_status +$(crop(torrent.tracker_status, 30)) $_('Next Announce'): $torrent.next_announce diff --git a/plugins/WebUi/version b/plugins/WebUi/version index afa9f2464..c3d9b6aa5 100644 --- a/plugins/WebUi/version +++ b/plugins/WebUi/version @@ -1,5 +1,5 @@ revision-id: mvoncken@gmail.com-20070930083408-sv8mo0mi1rbjnfvk -date: 2007-11-06 15:10:08 +0200 -build-date: 2007-11-06 15:34:50 +0200 -revno: 155 +date: 2007-11-26 15:10:08 +0200 +build-date: 2007-11-26 15:34:50 +0200 +revno: 160 branch-nick: WebUi