1. Jay Baird
  2. Ochs

Source

Ochs / ochs_filebrowser / templates / filebrowser / include / filter.html

{% load i18n %}
<script type="text/javascript">
if (typeof jQuery != 'undefined') {
    $(document).ready(function(){
       $('.filterset h3').click(function() {
           $(this).parent().toggleClass('collapse-closed');
           $(this).parent().toggleClass('collapse-open');
           $(this).next().next().toggle();
       });
    });
}
</script>

<div id="changelist-filter">
    <h2>{% trans "Filter" %}</h2>
    {% if query.filter_date %}
    <div class="filterset collapse-open">
    {% else %}
    <div class="filterset collapse-closed">
    {% endif %}
    <h3>{% trans "By Date" %}</h3>
    <ul id="Date">
         {% if query.filter_date %}<li>{% else %}<li class="selected">{% endif %}<a href="?{{ query.query_nofilterdate }}">{% trans "Any Date" %}</a></li>
         {% ifequal query.filter_date 'today' %}<li class="selected">{% else %}<li>{% endifequal %}
         <a href="?{{ query.query_nofilterdate }}&amp;filter_date=today">{% trans "Today" %}</a></li>
         {% ifequal query.filter_date 'past7days' %}<li class="selected">{% else %}<li>{% endifequal %}
         <a href="?{{ query.query_nofilterdate }}&amp;filter_date=past7days">{% trans "Past 7 days" %}</a></li>
         {% ifequal query.filter_date 'thismonth' %}<li class="selected">{% else %}<li>{% endifequal %}
         <a href="?{{ query.query_nofilterdate }}&amp;filter_date=thismonth">{% trans "Past 30 days" %}</a></li>
         {% ifequal query.filter_date 'thisyear' %}<li class="selected">{% else %}<li>{% endifequal %}
         <a href="?{{ query.query_nofilterdate }}&amp;filter_date=thisyear">{% trans "This year" %}</a></li>
    </ul>
    </div>
    {% if query.filter_type %}
    <div class="filterset collapse-open">
    {% else %}
    <div class="filterset collapse-closed">
    {% endif %}
    <h3>{% trans "By Type" %}</h3>
    <ul id="Type">
        {% if query.filter_type %}<li>{% else %}<li class="selected">{% endif %}<a href="?{{ query.query_nofiltertype }}">{% trans "All" %}</a></li>
        {% for extension in settings_var.EXTENSIONS %}
        {% ifequal query.filter_type extension %}<li class="selected">{% else %}<li>{% endifequal %}<a href="?{{ query.query_nofiltertype }}&amp;filter_type={{ extension }}">{% trans extension %}</a></li>
        {% endfor %}
    </ul>
    </div>
</div>