summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcos Pinto <markybob@dipconsultants.com>2007-11-26 16:06:55 +0000
committerMarcos Pinto <markybob@dipconsultants.com>2007-11-26 16:06:55 +0000
commiteba7d245509fe8e9a7ffabcba6001044f8c6f692 (patch)
treeccf6efa57d1fe5bc6783e9891dba1d5e2a9f6bd4
parent59116daf712b1fcb6e584c500a88244581c89900 (diff)
downloaddeluge-eba7d245509fe8e9a7ffabcba6001044f8c6f692.tar.gz
deluge-eba7d245509fe8e9a7ffabcba6001044f8c6f692.tar.bz2
deluge-eba7d245509fe8e9a7ffabcba6001044f8c6f692.zip
webui tweaks rev 160
-rw-r--r--plugins/WebUi/deluge_webserver.py25
-rw-r--r--plugins/WebUi/templates/advanced/index.html16
-rw-r--r--plugins/WebUi/templates/advanced/part_categories.html7
-rw-r--r--plugins/WebUi/templates/advanced/static/advanced.css29
-rw-r--r--plugins/WebUi/templates/advanced/static/deluge.js25
-rw-r--r--plugins/WebUi/templates/deluge/tab_meta.html4
6 files changed, 79 insertions, 27 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 = {})
-
- if vars.url and vars.torrent.filename:
+ """
+ allows:
+ *posting of url
+ *posting file-upload
+ *posting of data as string(for greasemonkey-private)
+ """
+
+ 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/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'))
<div class="panel" id="toolbar">
<a class='toolbar_btn' href="#"
- onclick='toolbar_get("/torrent/add/")'
+ onclick='toolbar_get("/torrent/add/",0)'
title='$_("Add")'><img class='toolbar_btn'
src='/static/images/tango/list-add.png'></a>
<a class='toolbar_btn' href="#"
- onclick='toolbar_get("/torrent/delete/")'><img class='toolbar_btn'
+ onclick='toolbar_get("/torrent/delete/",2)'><img class='toolbar_btn'
src='/static/images/tango/list-remove.png'
title='$_("Remove")'></a>
<a class='toolbar_btn' href="#"
- onclick='toolbar_post("/torrent/stop/")'
+ onclick='toolbar_post("/torrent/stop/",2)'
title='$_("Pause")'><img class='toolbar_btn'
src='/static/images/tango/pause.png'
></a>
<a class='toolbar_btn' href="#"
- onclick='toolbar_post("/torrent/start/")'
+ onclick='toolbar_post("/torrent/start/",2)'
title='$_("Start")'><img class='toolbar_btn'
src='/static/images/tango/start.png'></a>
<a class='toolbar_btn' href="#"
- onclick='toolbar_post("/torrent/queue/up/")'
+ onclick='toolbar_post("/torrent/queue/up/",2)'
title='$_("Up")'><img class='toolbar_btn'
src='/static/images/tango/queue-up.png'></a>
<a class='toolbar_btn' href="#"
- onclick='toolbar_post("/torrent/queue/down/")'
+ onclick='toolbar_post("/torrent/queue/down/",2)'
title='$_("Down")'><img class='toolbar_btn'
src='/static/images/tango/queue-down.png'></a>
<a class='toolbar_btn' href="#"
- onclick='toolbar_get("/torrent/info/")'
+ onclick='toolbar_get("/torrent/info/",1)'
title='$_("Details")'><img class='toolbar_btn'
src='/static/images/tango/details.png'></a>
@@ -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:
</div>
</div>
</td>
+ <td>$torrent.category</td>
<td>$torrent.num_seeds ($torrent.total_seeds)</td>
<td>$torrent.num_peers ($torrent.total_peers)</td>
<td>
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)
-<form method="GET" id="category_form" style="display:inline;position:relative;top:-5px;padding-left:50px;>
+<form method="GET" id="category_form">
<input type="hidden" name="sort" value="$get('sort')">
<input type="hidden" name="order" value="$get('order')">
<select name='filter' id='filter'
@@ -23,6 +23,11 @@ $for tab in category_tabs:
</option>
</select>
+ <input type="image" id='toolbar_refresh'
+ src='/static/images/tango/view-refresh.png'
+ title='$_('Refresh')'
+ >
+
</form>
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)</td></td></tr>
<td class="info_value">$torrent.num_files</td></tr>
<tr><td class="info_label">$_('Tracker'):</td>
-<td class="info_value">$(crop(torrent.tracker, 30))</td></tr>
+<td class="info_value" title="$torrent.tracker">$(crop(torrent.tracker, 30))</td></tr>
<tr><td class="info_label">$_('Tracker Status'):</td>
-<td class="info_value">$torrent.tracker_status </td></tr>
+<td class="info_value" title="$torrent.tracker_status">$(crop(torrent.tracker_status, 30)) </td></tr>
<tr><td class="info_label">$_('Next Announce'):</td>
<td class="info_value">$torrent.next_announce </td></tr>