schedule.html 1.6 KB
Newer Older
Andreas Valder's avatar
Andreas Valder committed
1
2
3
4
5
6
7
{% extends "base.html" %}
{% block content %}
<div class="panel-group" id="accordion">
	<div class="panel panel-default">
		<div class="panel-heading">
			<h1 class="panel-title">Drehplan</h1>
		</div>
8
9
		<div class="panel-body row">
			<table class="table-bordered col-xs-12">
Andreas Valder's avatar
Andreas Valder committed
10
				<tr><th></th>{% for d in days if (d.index < 5) or (d.lectures|length) > 0%}<th colspan="{{d.maxcol}}">{{ d.date.strftime("%A (%d.%m.%Y)") }}</th>{% endfor %}</tr>
11
12
				{% for t in times %}
				{% set time_loop = loop %}
Andreas Valder's avatar
Andreas Valder committed
13
14
15
				<tr height="15px">
					{% if ((loop.index - 1) is divisibleby 4)  %} <td rowspan="4" style="vertical-align: top;">{{ t.strftime("%H:%M") }}</td> {% endif %}
					{% for d in days  if (d.index < 5) or (d.lectures|length) > 0 %}
16
17
						{% for i in range(1,d.maxcol+1) %}
						{% for l in d.lectures|selectattr('schedule_col','equalto',i) if (((l.time_asdate.time() > t) and (l.time_asdate.time() < times[time_loop.index+1])) != (l.time_asdate.time() == t ) ) %}
Andreas Valder's avatar
Andreas Valder committed
18
19
						<td rowspan="{{l.duration / 15}}" style="background: lightgrey;">
							<p class="small">
20
							<strong><a href="{{url_for('course', id=l['course_id'])}}#{{l.id}}">{{l.short}}</a></strong><br>
Andreas Valder's avatar
Andreas Valder committed
21
22
23
								{{l.time_asdate.strftime("%H:%M")}} - {{l.end_asdate.strftime("%H:%M")}}<br>
								{{l.place}}</p>
						</td>
24
25
26
27
28
29
30
31
32
33
34
							{% else %}
								{% for l in d.lectures|selectattr('schedule_col','equalto',i) if (l.time_asdate.time() < t) and (l.end_asdate.time() > t) %}
								{% else %}
									<td></td>
								{% endfor %}
							{% endfor %}
						{% endfor %}
					{% endfor %}
				</tr>
				{% endfor %}
			</table>
Andreas Valder's avatar
Andreas Valder committed
35
36
37
38
39
40
		</div>
	</div>
</div>
</div>

{% endblock %}