episodes.html 1.52 KB
Newer Older
1
2
3
{% extends "emissions/emission_detail.html" %}
{% load paniktags %}
{% block nav %}
Simon Daron's avatar
Simon Daron committed
4
	{% emission_nav klass "episodes" %}
5
6
7
8
{% endblock %}

{% block main %}
<div class="wrapper {% if episodes %}sided{% endif %}">
Simon Daron's avatar
Simon Daron committed
9

fred's avatar
fred committed
10
	{% if search_query and not episodes %}
fred's avatar
fred committed
11
			<div class="big error padded center">Manque de pot, pas de résultats à cette recherche !</div>
fred's avatar
fred committed
12
13
	{% endif %}

Simon Daron's avatar
Simon Daron committed
14
15
16
	{% if search_query and episodes or episodes.count <= 24 %}
		<ul class="custom columns list">
		{% for episode in episodes %}
fred's avatar
fred committed
17
			<li class="item {% for category in episode.emission.categories.all %} {{ category|slugify }}{% endfor %}">
Simon Daron's avatar
Simon Daron committed
18
				{% episode_resume model="inline"%}			
Simon Daron's avatar
Simon Daron committed
19
20
21
22
			</li>
		{% endfor %}
		</ul>
	{% else %}
23
24
25
26
27
28
29
30
31
32
	<div id="Emission-container" class="emission padded">
		{% if 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 button" 						
							onclick="$('#{{ month.grouper|slugify }}').toggle();"
33
						>&gt; {{ month.grouper }}</div>
34
35
36
37
38
39
40
41
42
43
44
45
46
						<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 %}
						</ul>
					</div>
				{% endfor %}
				</div>
			{% endwith %}
		{% endif %}
	</div>
Simon Daron's avatar
Simon Daron committed
47
	{% endif %}
48
49
</div>
{% endblock %}