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

{% block news %}
{% endblock %}