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

{% block news %}
{% endblock %}