label templates/info pane position

This commit is contained in:
Martijn Voncken 2008-07-11 16:32:50 +00:00
parent cf71429e8e
commit cdf55da8d6
4 changed files with 90 additions and 2 deletions

View File

@ -106,7 +106,7 @@ class index:
#organize-filters
label_filters = {}
if 'label' in proxy.get_enabled_plugins():
if 'label' in [pl.lower() for pl in proxy.get_enabled_plugins()]:
filter_dict = {}
if vars.filter_cat and vars.filter_value and vars.filter_value <> "All":
filter_dict = {vars.filter_cat:vars.filter_value}

View File

@ -23,7 +23,13 @@ $if label_filters:
</td></tr>
</table>
<div class="panel" id="info_panel_div" style="width:79%;margin-left:180px">
<!--v1-->
<div class="panel" id="info_panel_div" style="width:79%;
$if label_filters:
margin-left:180px
$else:
margin-left:0px
">
<iframe
style="border-style:hidden;width:100%;height:200px;"
id="torrent_info">

View File

@ -0,0 +1,53 @@
$def with (filter_items)
<form method="GET" id="category_form">
<input type="hidden" name="sort" value="$get('sort')">
<input type="hidden" name="order" value="$get('order')">
<input type="hidden" name="filter_cat" value="keyword">
<div id="organize_block">
<div id="organize_state">
<div class="title">$_('Keyword')</div>
<input type="text" name="filter_value" id="filter_value"
$if get('filter_cat') == "keyword":
value="$get('filter_value')"
style="width:100px;padding:0px" title="$_('Filter on a keyword')"/>
$if get('filter_cat') == "keyword":
$if get('filter_value'):
<img src="$base/static/images/tango/edit-clear.png" alt="$_('Clear')"
onclick="el('keyword').value='';el('category_form').submit();"
>
</form>
<br /><br />
<!--
$filter_items
-->
$for cat in ["state", "tracker", "label"]:
<div class="title">$cat</div>
<ul>
$for value, count in filter_items[cat]:
<li
$if cat == get('filter_cat'):
$if value == get('filter_value'):
class="selected"
$# I hate this, special case for All
$# templetor sucks with multiple conditions in 1 if-statement, i need to find a better way,
$if cat == "state":
$if value == "All":
$if not get('filter_value'):
$if not get('filter_cat'):
class="selected"
>
<a href="$self_url(filter_cat=cat, filter_value=value)">
$if cat == "state":
<img src="/pixmaps/$(value.lower())"></img>
$value ($count)</a>
</li>
</ul>
</div>
</div>

View File

@ -0,0 +1,29 @@
$def with (torrent_ids, torrent_list, labels)
$:render.header(_("Label torrent"))
<div class="panel">
<form method="POST" action='$base/torrent/label/$torrent_ids'>
<div id="del_torrent">
<h2>$_("Label torrent")</h2>
<ul>
$for torrent in torrent_list:
<li>$torrent.name ($torrent.label)</li>
</ul>
<div class="form_row2">
<span class="form_label2">
<select size=$(len(labels) + 1) style="width:150px" name="label" id="label">
<option value="">No Label</option>
$for label in labels:
<option value="$label">$label</option>
</select>
</div>
<div class="form_row2">
<span class="form_label2"></span>
<input type="submit" name="submit"
value="$_('Label')" class="form_input">
</div>
</div>
</form>
</div>
$:render.footer()