From 991a4133270c788ed2b77263abb2a11c0c3a9c26 Mon Sep 17 00:00:00 2001 From: Martijn Voncken Date: Tue, 12 Feb 2008 21:03:33 +0000 Subject: [PATCH] torrent_info:display torrent files --- deluge/ui/webui/webui_plugin/render.py | 10 ++++++++++ .../templates/advanced/static/advanced.css | 8 ++++++++ .../webui_plugin/templates/deluge/torrent_info.html | 5 ++++- .../ui/webui/webui_plugin/tests/multicall_notepad.py | 6 +++--- deluge/ui/webui/webui_plugin/utils.py | 2 +- deluge/ui/webui/webui_plugin/webserver_common.py | 2 +- 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/deluge/ui/webui/webui_plugin/render.py b/deluge/ui/webui/webui_plugin/render.py index b304ae4c3..d3456bce4 100644 --- a/deluge/ui/webui/webui_plugin/render.py +++ b/deluge/ui/webui/webui_plugin/render.py @@ -89,6 +89,15 @@ def template_crop(text, end): return "[ERROR NOT A STRING:(%s)]" % text return text +def template_crop_right(text, maxlen): + try: + if len(text) > maxlen: + return "..." + text[-(maxlen + 3):] + except: + return "[ERROR NOT A STRING:(%s)]" % text + return text + + def template_sort_head(id,name): #got tired of doing these complex things inside templetor.. vars = web.input(sort = None, order = None) @@ -136,6 +145,7 @@ template.Template.globals.update({ 'part_stats':template_part_stats, 'category_tabs':category_tabs, 'crop': template_crop, + 'crop_right': template_crop_right, '_': _ , #gettext/translations 'str': str, #because % in templetor is broken. 'int':int, diff --git a/deluge/ui/webui/webui_plugin/templates/advanced/static/advanced.css b/deluge/ui/webui/webui_plugin/templates/advanced/static/advanced.css index 7dc2777dc..bcba9c4ad 100644 --- a/deluge/ui/webui/webui_plugin/templates/advanced/static/advanced.css +++ b/deluge/ui/webui/webui_plugin/templates/advanced/static/advanced.css @@ -86,6 +86,14 @@ tr.altrow1{ background-color: #37506f; } +tr.tab_altrow0{ + background-color: #304663; +} + +tr.tab_altrow1{ + background-color: #37506f; +} + tr.torrent_table_selected { diff --git a/deluge/ui/webui/webui_plugin/templates/deluge/torrent_info.html b/deluge/ui/webui/webui_plugin/templates/deluge/torrent_info.html index 660273e1a..e0cd572c2 100644 --- a/deluge/ui/webui/webui_plugin/templates/deluge/torrent_info.html +++ b/deluge/ui/webui/webui_plugin/templates/deluge/torrent_info.html @@ -2,8 +2,8 @@ $def with (torrent) $:(render.header(torrent.message + '/' + torrent.name))
-

$_('Details')

+

$_('Details')

$:render.tab_meta(torrent) $if (torrent.action == 'start'): @@ -18,6 +18,9 @@ $:render.part_button('POST', '/torrent/reannounce/' + str(torrent.id), _('Reanno $:render.part_button('POST', '/torrent/queue/up/' + str(torrent.id), _('Queue Up'), 'tango/queue-up.png') $:render.part_button('POST', '/torrent/queue/down/' + str(torrent.id), _('Queue Down'), 'tango/queue-down.png') +
+$:render.tab_files(torrent) +