Commit b9241031 authored by Simon Daron's avatar Simon Daron

show only first months in episodes list

parent c0eeeab6
......@@ -31,13 +31,18 @@
</div>
{% if episodes %}
<div data-tabbed="true" id="Emission-tabs-episodes" class="episodes">
{% with episodes|slice:"1:11" as episodes %}
{% with episodes as episodes %}
{% regroup episodes by first_diffusion|date:"F Y"|capfirst as month_list %}
<div>
{% for month in month_list %}
<div class="monthGroup {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}">
<div class="legend">{{ month.grouper }}</div>
<ul class="custom list">
<div
class="legend button"
onclick="$('#{{ month.grouper|slugify }}').toggle();"
>{{ month.grouper }}</div>
<ul class="custom list" id="{{ month.grouper|slugify }}"
{% if forloop.counter >= 3 %}style="display:none;"{% endif %}
>
{% for episode in month.list %}
<li>{% episode_resume model="inline" date="daytime" %}</li>
{% endfor %}
......
......@@ -55,7 +55,7 @@
</li>
<li>
<button data-tab="#Emission-tabs-episodes">
<span class="iconLabel">Episodes</span>
<span class="iconLabel">Episodes ({{ episodes.count }})</span>
</button >
</li>
</ul>
......
......@@ -22,9 +22,9 @@
{% if episode.image %}
<div class="logo right">
{% if model = "inline" %}
<img width="50" height="50" src="{{ episode.image|thumbnail:'50x50' }}"/>
<img src="{{ episode.image|thumbnail:'75x75' }}"/>
{% else %}
<img width="100" height="100" src="{{ episode.image|thumbnail:'100x100' }}"/>
<img src="{{ episode.image|thumbnail:'150x150' }}"/>
{% endif %}
</div>
{% endif %}
......
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