|
|
@ -16,16 +16,20 @@ |
|
|
|
{%- endmacro %} |
|
|
|
{%- endmacro %} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% macro filter_box(title, query_key, items) -%} |
|
|
|
{% macro filter_box(title, query_key, items, extras=None) -%} |
|
|
|
|
|
|
|
{% if not extras %} |
|
|
|
|
|
|
|
{% set extras = dict() %} |
|
|
|
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
{% set extras_active = context|are_extras_active(extras) %} |
|
|
|
<div class="well sidebar-nav"> |
|
|
|
<div class="well sidebar-nav"> |
|
|
|
<ul class="nav nav-list"> |
|
|
|
<ul class="nav nav-list"> |
|
|
|
<li class="nav-header">{{ title }}</li> |
|
|
|
<li class="nav-header">{{ title }}</li> |
|
|
|
<li {% if not context.filters.get(query_key) %}class="active"{% endif %}> |
|
|
|
<li {% if not context.filters.get(query_key) and extras_active %}class="active"{% endif %}> |
|
|
|
<a href="{{ context.url( (query_key, None), (context.query_key_current_page, 1) ) }}">All</a> |
|
|
|
<a href="{{ context.url( (query_key, None), (context.query_key_current_page, 1), *extras.items() ) }}">All</a> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
{% for filter, display in items %} |
|
|
|
{% for filter, display in items %} |
|
|
|
<li {% if context.filters.get(query_key) == filter %}class="active"{% endif %}> |
|
|
|
<li {% if context.filters.get(query_key) == filter and extras_active %}class="active"{% endif %}> |
|
|
|
<a href="{{ context.url( (query_key, filter), (context.query_key_current_page, 1) ) }}">{{ display }}</a> |
|
|
|
<a href="{{ context.url( (query_key, filter), (context.query_key_current_page, 1), *extras.items() ) }}">{{ display }}</a> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
{% endfor %} |
|
|
|
{% endfor %} |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|