grid.html 2.26 KB
Newer Older
Simon Daron's avatar
Simon Daron committed
1
{% extends "emissions.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
	{% emission_nav with klass="grid" %}
Simon Daron's avatar
Simon Daron committed
8
9
{% endblock %}
{% block main %}
10
<div id="grid" class="">
Simon Daron's avatar
Simon Daron committed
11
12
13
	<table>
		<tbody>
		<tr>
14
			  <td style=""><br/></td>
Simon Daron's avatar
Simon Daron committed
15
16
17
			  {% for weekday in weekdays %}
			    <th class="day" width="13%">{{ weekday }}</th>
			  {% endfor %}
18
			  <td style=""><br/></td>
Simon Daron's avatar
Simon Daron committed
19
20
21
		</tr>
		{% for time_header, time_cells in times|zip:grid %}
		<tr>
Simon Daron's avatar
Simon Daron committed
22
			  <th class="heure">{{ time_header }}</th>
Simon Daron's avatar
Simon Daron committed
23
			  {% for cell in time_cells %}
Simon Daron's avatar
Simon Daron committed
24
			  <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
25
26
				      {% if cell.h > 1 %}rowspan="{{cell.h}}"{% endif %}>
					{% if cell.time_label %}
Simon Daron's avatar
Simon Daron committed
27
						<div class="time-label">{{ cell.time_label }}</div>
Simon Daron's avatar
Simon Daron committed
28
29
30
					{% endif %}
				      {% if cell.schedules %}
					{% for schedule in cell.schedules %}
Simon Daron's avatar
Simon Daron committed
31
					{% if forloop.first == False and cell.schedules|length > 1 %}<hr />{% endif %}
32
33
34
35
36
					<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>
37
38
39
40
41
42
43
44
45
46
47
						<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 %}
48
49
50
						  {% if schedule.time_label_extra %}
						  <span>{{ schedule.time_label_extra }}</span>
						  {% endif %}
51
52
						<span>)</span>
						{% endspaceless %}
Simon Daron's avatar
Simon Daron committed
53
54
55
56
						{% 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 %}
Simon Daron's avatar
Simon Daron committed
72