$def with (filter_items)


<div id="organize_block">
<div id="organize_state">

$if get_config("show_keyword_search"):
    <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 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/16/edit-clear.png" alt="$_('Clear')"
            onclick="el('keyword').value='';el('category_form').submit();"
            >
    </form>
    <br /><br />
<!--
$filter_items
-->
$for cat in filter_items.keys():
    <div class="title" id="filter_cat_$cat">$id_to_label(cat)</div>
    <ul>
    $for value, count in filter_items[cat]:
        <li id="filter_$(cat)_$(value)"
        $if cat == get('filter_cat'):
            $if value == get('filter_value'):
                class="selected filter_$cat"
            $else:
                class="filter_$cat"
        $else:
            class="filter_$cat"
        /*BROKEN, todo: fix this!!
        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 filter_$cat"
        >
        <a href="$self_url(filter_cat=cat, filter_value=value, sort=get('sort'), order=get('order')) ">
        $if cat == "state":
            <img src="$base/pixmaps/$(value.lower())"></img>
        $if cat == "tracker_host":
            <img src="$base/tracker/icon/$value" width="16" height="16"></img>
        $if not value:
            $if cat == "label":
                $_("No Label") ($count)</a>
            $else:
                $_("None") ($count)</a>
        $else:
            $value ($count)</a>
        </li>
    </ul>
</div>
</div>




