episodes.html 1.84 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
{% endblock %}

{% block main %}
Simon Daron's avatar
Simon Daron committed
8
9
10
<form method="get" action="." class="padded center" id="search-form">
	<div class="big ">
		<label for="id_q">Rechercher:</label>
fred's avatar
fred committed
11
		<input id="id_q" name="q" type="text" {% if search_query %}value="{{ search_query }}{% endif %}">
Simon Daron's avatar
Simon Daron committed
12
13
14
		<button class="icon-search"></button>
	</div>
</form>
15
<div class="wrapper {% if episodes %}sided{% endif %}">
Simon Daron's avatar
Simon Daron committed
16

fred's avatar
fred committed
17
18
19
20
	{% if search_query and not episodes %}
			<div class="big error padded center">Sorry, no result with your query!</div>
	{% endif %}

Simon Daron's avatar
Simon Daron committed
21
22
23
24
	{% if search_query and episodes or episodes.count <= 24 %}
		<ul class="custom columns list">
		{% for episode in episodes %}
			<li class="item {% if episode.emission.categories.all.count = 0 %}nocat{% endif %} {% for category in episode.emission.categories.all %} {{ category|slugify }}{% endfor %}">
Simon Daron's avatar
Simon Daron committed
25
				{% episode_resume model="inline"%}			
Simon Daron's avatar
Simon Daron committed
26
27
28
29
			</li>
		{% endfor %}
		</ul>
	{% else %}
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
	<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();"
						>{{ 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 %}
						</ul>
					</div>
				{% endfor %}
				</div>
			{% endwith %}
		{% endif %}
	</div>
Simon Daron's avatar
Simon Daron committed
54
	{% endif %}
55
56
</div>
{% endblock %}