diff --git a/deluge/ui/webui/pages.py b/deluge/ui/webui/pages.py index cd10eb1d1..c1e9a893c 100644 --- a/deluge/ui/webui/pages.py +++ b/deluge/ui/webui/pages.py @@ -183,7 +183,8 @@ route("/torrent/delete/(.*)",torrent_delete) class torrent_files: @deco.check_session - def POST(self, torrent_id): + @deco.torrent + def POST(self, torrent): torrent = get_torrent_status(torrent_id) file_priorities = web.input(file_priorities=[]).file_priorities #file_priorities contains something like ['0','2','3','4'] @@ -191,10 +192,24 @@ class torrent_files: proxy_prio = [0 for x in xrange(len(torrent.file_priorities))] for pos in file_priorities: proxy_prio[int(pos)] = 1 - proxy.set_torrent_file_priorities(torrent_id, proxy_prio) + proxy.set_torrent_file_priorities(torrent.id, proxy_prio) do_redirect() route("/torrent/files/(.*)", torrent_files) +class torrent_trackers: + @deco.check_session + @deco.torrent + def POST(self, torrent): + vars = web.input(tier=[], url=[]) + + tiers_int = [int(t) for t in vars.tier] + sorted_urls = [url for num,url in sorted(zip(tiers_int, vars.url)) if url] + trackers = [{'tier':i , 'url':url} for i,url in enumerate(sorted_urls)] + + proxy.set_torrent_trackers(torrent.id, trackers) + do_redirect() +route("/torrent/trackers/(.*)", torrent_trackers) + class pause_all: @deco.check_session def POST(self, name): diff --git a/deluge/ui/webui/templates/deluge/tab_trackers.html b/deluge/ui/webui/templates/deluge/tab_trackers.html index c0c680f3a..2f5fc2559 100644 --- a/deluge/ui/webui/templates/deluge/tab_trackers.html +++ b/deluge/ui/webui/templates/deluge/tab_trackers.html @@ -1,5 +1,6 @@ $def with (torrent) - +
+ $altrow(True) @@ -8,9 +9,17 @@ $altrow(True) $for tracker in torrent.trackers: - + -
- $tracker['tier'] + $crop(tracker['url'], 60)
+ + + + + + + + +