grid.html 2.58 KB
Newer Older
fred's avatar
fred committed
1
{% extends "base.html" %}
fred's avatar
fred committed
2
{% load paniktags %}
fred's avatar
fred committed
3

Simon Daron's avatar
Simon Daron committed
4
{% block bodyID %}Grid{% endblock %}
Simon Daron's avatar
Simon Daron committed
5
6
{% block title %}La grille{% endblock %}
{% block nav %}
Simon Daron's avatar
Simon Daron committed
7
	<nav id="gridNav" class="checkable">
8
		<ul class="distributed by{{ categories.count }}">
Simon Daron's avatar
Simon Daron committed
9
10
11
12
		        <li><button onclick="
					$('#grid *').removeClass('highlighted');
					$('#grid .nonstop').addClass('highlighted');
				">Non-stop</button></li>
13
14
		{% for category in categories %}
		        <li><button onclick="
Simon Daron's avatar
Simon Daron committed
15
					$('#grid *').removeClass('highlighted');
16
17
18
					$('#grid .{{ category|slugify }}').addClass('highlighted');
				">{{ category }}</button></li>
		{% endfor %}
Simon Daron's avatar
Simon Daron committed
19
20
		</ul>
	</nav>
Simon Daron's avatar
Simon Daron committed
21
22
{% endblock %}
{% block main %}
23
<div id="grid" class="">
Simon Daron's avatar
Simon Daron committed
24
25
26
	<table>
		<tbody>
		<tr>
27
			  <td style=""><br/></td>
Simon Daron's avatar
Simon Daron committed
28
29
30
			  {% for weekday in weekdays %}
			    <th class="day" width="13%">{{ weekday }}</th>
			  {% endfor %}
31
			  <td style=""><br/></td>
Simon Daron's avatar
Simon Daron committed
32
33
34
		</tr>
		{% for time_header, time_cells in times|zip:grid %}
		<tr>
Simon Daron's avatar
Simon Daron committed
35
			  <th class="heure">{{ time_header }}</th>
Simon Daron's avatar
Simon Daron committed
36
			  {% for cell in time_cells %}
Simon Daron's avatar
Simon Daron committed
37
			  <td class="small cell {% if cell.schedules|length > 1 %}many {% endif %}{% if cell.schedules %}scheduled{% else %}nonstop{% endif %}" {% if cell.w > 1 %}colspan="{{cell.w}}"{% endif %}
Simon Daron's avatar
Simon Daron committed
38
39
				      {% if cell.h > 1 %}rowspan="{{cell.h}}"{% endif %}>
					{% if cell.time_label %}
Simon Daron's avatar
Simon Daron committed
40
						<div class="time-label">{{ cell.time_label }}</div>
Simon Daron's avatar
Simon Daron committed
41
42
43
					{% endif %}
				      {% if cell.schedules %}
					{% for schedule in cell.schedules %}
Simon Daron's avatar
Simon Daron committed
44
					{% if forloop.first == False and cell.schedules|length > 1 %}<hr />{% endif %}
45
46
47
48
49
					<div class="item {% for category in schedule.emission.categories.all %}{{ category|slugify }}{% endfor %}">
					
						<strong>
							<a href="{% url 'emission-view' slug=schedule.emission.slug %}">{{ schedule.emission.title }}</a>
						</strong>
50
51
52
53
54
55
56
57
58
59
60
61
62
						<br />
						{% if schedule.weeks_string or schedule.time_label %}
						{% spaceless %}
						<span>(</span>
						  {% if schedule.time_label %}
						  <span>{{ schedule.time_label }}</span>
						    {% if schedule.weeks_string %}<span>, </span>{% endif %}
						  {% endif %}
						  {% if schedule.weeks_string %}
						  <span>{{ schedule.weeks_string }}</span>
						  {% endif %}
						<span>)</span>
						{% endspaceless %}
Simon Daron's avatar
Simon Daron committed
63
64
65
66
						{% endif %}
					</div>
					{% endfor %}
				      {% else %}
Simon Daron's avatar
Simon Daron committed
67
					<div class="continu"><strong>{{ cell }}</strong></div>
Simon Daron's avatar
Simon Daron committed
68
69
70
71
					{% if cell.w > 1 and cell.h > 1%}<p>la musique en continu</p>{% endif %}
				      {% endif %}
			  </td>
			  {% endfor %}
72
			  <th class="heure">{{ time_header }}</th>
Simon Daron's avatar
Simon Daron committed
73
74
75
76
		</tr>
		{% endfor %}
		</tbody>
	</table>
77
</div>
fred's avatar
fred committed
78
{% endblock %}
fred's avatar
fred committed
79
80
81

{% block news %}
{% endblock %}
Simon Daron's avatar
Simon Daron committed
82