grid.html 2.53 KB
Newer Older
Simon Daron's avatar
Simon Daron committed
1
{% extends "emissions.html" %}
fred's avatar
fred committed
2
{% load paniktags i18n %}
Simon Daron's avatar
Simon Daron committed
3
{% block bodyID %}Grid{% endblock %}
fred's avatar
fred committed
4
{% block title %}{% trans 'Grid' %}{% endblock %}
fred's avatar
fred committed
5
{% block toptitle %}
6
<h1 class="top bg-title"><a href="{% url 'grid' %}">{% trans 'Program' %}</a></h1>
fred's avatar
fred committed
7
{% endblock %}
Simon Daron's avatar
Simon Daron committed
8
{% block nav %}
Simon Daron's avatar
Simon Daron committed
9
	{% emission_nav with klass="grid" %}
Simon Daron's avatar
Simon Daron committed
10 11
{% endblock %}
{% block main %}
fred's avatar
fred committed
12

Simon Daron's avatar
Simon Daron committed
13
<div id="grid" class="wrapper">
Simon Daron's avatar
Simon Daron committed
14 15 16
	<table>
		<tbody>
		<tr>
17
			  <td style=""><br/></td>
Simon Daron's avatar
Simon Daron committed
18 19 20
			  {% for weekday in weekdays %}
			    <th class="day" width="13%">{{ weekday }}</th>
			  {% endfor %}
21
			  <td style=""><br/></td>
Simon Daron's avatar
Simon Daron committed
22 23 24
		</tr>
		{% for time_header, time_cells in times|zip:grid %}
		<tr>
Simon Daron's avatar
Simon Daron committed
25
			  <th class="heure">{{ time_header }}</th>
Simon Daron's avatar
Simon Daron committed
26
			  {% for cell in time_cells %}
fred's avatar
fred committed
27
			  <td class="small cell {% if cell.schedules|length > 1 %}many {% endif %}{% if cell.schedules %}scheduled{% else %}nonstop musique-en-continu{% endif %}" {% if cell.w > 1 %}colspan="{{cell.w}}"{% endif %}
Simon Daron's avatar
Simon Daron committed
28 29
				      {% if cell.h > 1 %}rowspan="{{cell.h}}"{% endif %}>
					{% if cell.time_label %}
30
						<div class="time-label">{{ cell.time_label }}</div>
Simon Daron's avatar
Simon Daron committed
31 32 33
					{% endif %}
				      {% if cell.schedules %}
					{% for schedule in cell.schedules %}
Simon Daron's avatar
Simon Daron committed
34
					{% if forloop.first == False and cell.schedules|length > 1 %}<hr />{% endif %}
fred's avatar
fred committed
35
					<div class="item {% for category in schedule.emission.categories.all %} {{ category|slugify }}{% endfor %}">
36 37
					
						<strong>
38 39 40
							<a href="{% url 'emission-view' slug=schedule.emission.slug %}">
								<span>{{ schedule.emission.title }}</span>												
							</a>
41
						</strong>
42 43 44 45 46 47 48 49 50 51 52
						<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 %}
53 54 55
						  {% if schedule.time_label_extra %}
						  <span>{{ schedule.time_label_extra }}</span>
						  {% endif %}
56 57
						<span>)</span>
						{% endspaceless %}
Simon Daron's avatar
Simon Daron committed
58
						{% endif %}
59
						
Simon Daron's avatar
Simon Daron committed
60 61 62
					</div>
					{% endfor %}
				      {% else %}
fred's avatar
fred committed
63
				      <div class="continu"><strong><a href="{% url 'emission-view' slug=cell.nonstop_slug %}">{{ cell }}</a></strong></div>
Simon Daron's avatar
Simon Daron committed
64 65 66 67
					{% if cell.w > 1 and cell.h > 1%}<p>la musique en continu</p>{% endif %}
				      {% endif %}
			  </td>
			  {% endfor %}
68
			  <th class="heure">{{ time_header }}</th>
Simon Daron's avatar
Simon Daron committed
69 70 71 72
		</tr>
		{% endfor %}
		</tbody>
	</table>
73
</div>
fred's avatar
fred committed
74
{% endblock %}
fred's avatar
fred committed
75 76 77

{% block news %}
{% endblock %}
78