Commit 259f8dc1 authored by Mathieu Bridon's avatar Mathieu Bridon

radio: Get the active theme filters displayed

The ideascube search and filter system is a bit of a mess, and it's
entirely inextensible. So we need to be creative to hook ourselves in it
and pretend things are working.

Fixes #8
parent fcd3a10e
{% load i18n ideascube_tags %}
{% spaceless %}
{% if q or kind or lang or tags or source or theme %}
<div class="filters card tinted">
<h4>{% trans "Filters" %}</h4>
<ul>
{% if q %}
<li>
<a href="{% remove_qs q=q %}">
{{ q }}
<i class="fa fa-close"></i>
</a>
</li>
{% endif %}
{% if kind %}
<li>
<a href="{% remove_qs kind=kind %}">
{{ view.model.KIND_DICT|getitem:kind }}
<i class="fa fa-close"></i>
</a>
</li>
{% endif %}
{% if lang %}
{% with LANG_INFO|getitem:lang as lang_info %}
<li>
<a href="{% remove_qs lang=lang %}">
{{ lang_info.name_local }}
<i class="fa fa-close"></i>
</a>
</li>
{% endwith %}
{% endif %}
{% if source %}
<li>
<a href="{% remove_qs source=source %}">
{{ source_name }}
<i class="fa fa-close"></i>
</a>
</li>
{% endif %}
{% for t in tags %}
<li>
<a href="{% remove_qs tags=t %}">
{{ t|tag_name }}
<i class="fa fa-close"></i>
</a>
</li>
{% endfor %}
{% if theme %}
<li>
<a href="{% remove_qs theme=theme %}">
{{ theme_name }}
<i class="fa fa-close"></i>
</a>
</li>
{% endif %}
</ul>
</div>
{% endif %}
{% endspaceless %}
......@@ -226,6 +226,12 @@ class RadioIndex(
self._set_available_tags(context)
self._set_available_themes(context)
theme = self.request.GET.get('theme')
for t in RadioShow.THEMES:
if t[0] == theme:
context['theme'] = theme
context['theme_name'] = t[1]
return context
def get_queryset(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment