{% comment %}
	This is a modification of the standard filter.html template that allows for
	more flexible filters.
	
	If a filter returns its title as "__filtrate__" the more flexible rendering
	is activated and the `choices()` method of the filter must return a dict
	wrapped in a list with the keys `title` and `content` instead.
{% endcomment %}

{% load i18n %}
{% if title != '__filtrate__' %}
<h3>{% blocktrans with title as filter_title %} By {{ filter_title }} {% endblocktrans %}</h3>
<ul>
{% for choice in choices %}
    <li{% if choice.selected %} class="selected"{% endif %}>
    <a href="{{ choice.query_string|iriencode }}">{{ choice.display }}</a></li>
{% endfor %}
</ul>
{% else %}
<div class="filtrate">
	{% if choices.0.title %}
		<h3>{{choices.0.title}}</h3>
	{% endif %}
	<div class="content">
		{{choices.0.content}}
	</div>
</div>
{% endif %}