Commit 1a49ee11 authored by Simon Daron's avatar Simon Daron

Categories for Listen

parent 33127b60
......@@ -122,6 +122,7 @@ def news_inline(content=None, klass=None, logo=None):
@register.inclusion_tag('news/roll.html', takes_context=True)
def newsroll(context, nbr=None):
return {
'categories': context.get('categories'),
'news': context.get('news'),
'focus': context.get('focus'),
'nbr': nbr,
......
......@@ -447,6 +447,7 @@ class Listen(TemplateView):
# lookups
for episode in context['episodes']:
episode.main_sound = soundfiles.get(episode.id)
context['categories'] = Category.objects.all()
return context
......
{% extends "base.html" %}
{% load paniktags %}
{% block nav %}
<div class="wrapper">
{% if categories %}
<nav id="gridNav" class="checkable">
<ul class="by{{ categories.count }}">
<li><button class="check icon-check" data-about="#Main" data-toggle=".nocat">?</button></li>
{% for category in categories %}
<li><button class="check icon-check" data-about="#Main" data-toggle=".{{ category|slugify }}">{{ category }}</button></li>
{% endfor %}
</ul>
</nav>
{% endif %}
</div>
{% endblock %}
{% block main %}
<div class="padded">
<ul class="custom columns list">
{% for episode in episodes %}
<li class="item">
<li class="item {% if episode.emission.categories.all.count = 0 %}nocat{% endif %} {% for category in episode.emission.categories.all %} {{ category|slugify }}{% endfor %}">
{% episode_resume model="inline" klass="standalone"%}
</li>
{% endfor %}
......
{% load paniktags %}
{% newsroll %}
<div class="wrapper">
{% if categories %}
<nav id="gridNav" class="checkable">
<ul class="by{{ categories.count }}">
{% for category in categories %}
<li><button class="check icon-check" data-about="#Main" data-toggle=".{{ category|slugify }}">{{ category }}</button></li>
{% endfor %}
</ul>
</nav>
{% endif %}
</div>
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