no label, ui fixes

This commit is contained in:
Martijn Voncken 2008-10-14 21:21:58 +00:00
parent 8c676a950e
commit 4e720b9364
3 changed files with 10 additions and 5 deletions

View File

@ -90,10 +90,9 @@ class index:
def GET(self, name): def GET(self, name):
vars = web.input(sort=None, order=None, filter_cat=None ,filter_value=None , tracker=None) vars = web.input(sort=None, order=None, filter_cat=None ,filter_value=None , tracker=None)
#cookies are a delicious delecacy.
if not vars.sort: #no arguments, default to coockies. if not vars.sort: #no arguments, default to coockies.
newvars = cookies() newvars = cookies()
if vars.filter_cat: #i'm doing it wrong :( , but it works.. if vars.filter_cat:
newvars['filter_cat'] = vars.filter_cat newvars['filter_cat'] = vars.filter_cat
newvars['filter_value'] = vars.filter_value newvars['filter_value'] = vars.filter_value
vars.update(newvars) vars.update(newvars)
@ -105,7 +104,7 @@ class index:
#Filters #Filters
filter_dict = {} filter_dict = {}
if vars.filter_cat and vars.filter_value and vars.filter_value <> "All": if vars.filter_cat and vars.filter_value <> "All":
filter_dict = {vars.filter_cat:vars.filter_value} filter_dict = {vars.filter_cat:vars.filter_value}
torrents = proxy.get_torrents_status(filter_dict, TORRENT_KEYS) torrents = proxy.get_torrents_status(filter_dict, TORRENT_KEYS)

View File

@ -178,7 +178,7 @@ def template_get(key):
val = getattr(web.input(**{key:None}), key) val = getattr(web.input(**{key:None}), key)
if not val: if not val:
val = getcookie(key) val = getcookie(key)
return val return val or ""
def id_to_label(text): def id_to_label(text):
"translated capitalize" "translated capitalize"

View File

@ -44,7 +44,13 @@ $for cat in filter_items.keys():
<img src="/pixmaps/$(value.lower())"></img> <img src="/pixmaps/$(value.lower())"></img>
$if cat == "tracker_host": $if cat == "tracker_host":
<img src="http://$value/favicon.ico" width="16" height="16"></img> <img src="http://$value/favicon.ico" width="16" height="16"></img>
$value ($count)</a> $if not value:
$if cat == "label":
$_("No Label") ($count)</a>
$else:
$_("None") ($count)</a>
$else:
$value ($count)</a>
</li> </li>
</ul> </ul>
</div> </div>