mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-17 05:47:50 +00:00
webui:cosmetic+crop_middle
This commit is contained in:
parent
49ec8766ca
commit
faa5b69db4
@ -207,7 +207,6 @@ class index:
|
|||||||
|
|
||||||
setcookie("order", vars.order)
|
setcookie("order", vars.order)
|
||||||
setcookie("sort", vars.sort)
|
setcookie("sort", vars.sort)
|
||||||
log.debug("filters=%s,plugins=%s" % (organize_filters, proxy.get_enabled_plugins()))
|
|
||||||
return render.index(torrent_list, organize_filters)
|
return render.index(torrent_list, organize_filters)
|
||||||
|
|
||||||
class torrent_info:
|
class torrent_info:
|
||||||
|
@ -100,18 +100,11 @@ def category_tabs(torrent_list):
|
|||||||
return render.part_categories(filter_tabs, category_tabs)
|
return render.part_categories(filter_tabs, category_tabs)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def template_crop(text, end):
|
def template_crop_middle(text, maxlen):
|
||||||
try:
|
|
||||||
if len(text) > end:
|
|
||||||
return text[0:end - 3] + '...'
|
|
||||||
except:
|
|
||||||
return "[ERROR NOT A STRING:(%s)]" % text
|
|
||||||
return text
|
|
||||||
|
|
||||||
def template_crop_left(text, maxlen):
|
|
||||||
try:
|
try:
|
||||||
if len(text) > maxlen:
|
if len(text) > maxlen:
|
||||||
return "..." + text[-(maxlen + 3):]
|
half = (maxlen / 2) - 2
|
||||||
|
return text[0:half ] + '...' + text[-half:]
|
||||||
except:
|
except:
|
||||||
return "[ERROR NOT A STRING:(%s)]" % text
|
return "[ERROR NOT A STRING:(%s)]" % text
|
||||||
return text
|
return text
|
||||||
@ -162,8 +155,8 @@ def ftime(val):
|
|||||||
template.Template.globals.update({
|
template.Template.globals.update({
|
||||||
'sort_head': template_sort_head,
|
'sort_head': template_sort_head,
|
||||||
'part_stats':template_part_stats,
|
'part_stats':template_part_stats,
|
||||||
'crop': template_crop,
|
'crop': template_crop_middle,
|
||||||
'crop_left': template_crop_left,
|
'crop_left': template_crop_middle,
|
||||||
'_': _ , #gettext/translations
|
'_': _ , #gettext/translations
|
||||||
'str': str, #because % in templetor is broken.
|
'str': str, #because % in templetor is broken.
|
||||||
'int':int,
|
'int':int,
|
||||||
|
@ -15,7 +15,7 @@ $for state, num in filters.state:
|
|||||||
</select>
|
</select>
|
||||||
<select name='tracker' id='tracker'
|
<select name='tracker' id='tracker'
|
||||||
onchange="document.getElementById('category_form').submit()"
|
onchange="document.getElementById('category_form').submit()"
|
||||||
title="$_('Filter on Tracker')"
|
title="$_('Filter on tracker')"
|
||||||
style="width:150px"
|
style="width:150px"
|
||||||
>
|
>
|
||||||
<option value="">$_('Trackers')</option>
|
<option value="">$_('Trackers')</option>
|
||||||
|
@ -56,6 +56,4 @@ class torrent_options:
|
|||||||
def POST(self, torrent):
|
def POST(self, torrent):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
template.Template.globals["forms"].torrent_options = lambda torrent : TorrentOptionsForm(torrent)
|
||||||
|
|
||||||
template.Template.globals["forms"].torrent_options = lambda torrent : TorrentOptionsForm(torrent)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user