timetable.html 2.6 KB
Newer Older
Andreas Valder's avatar
Andreas Valder committed
1 2 3 4
{% extends "base.html" %}
{% block content %}
<div class="panel-group" id="accordion">
	<div class="panel panel-default">
5
		<div class="hidden-print panel-heading">
Andreas Valder's avatar
Andreas Valder committed
6 7
			<h1 class="panel-title">Drehplan</h1>
		</div>
8
		<div class="row hidden-print">
9
			<div  style="margin-top: 10px;" class="col-xs-12">
10 11 12
				<a href="{{url_for('timetable', kw=kw-1) }}" class="pull-left btn btn-default">{{ "<<" }}</a>
				<a href="{{url_for('timetable', kw=kw+1) }}" class="pull-right btn btn-default">{{ ">>" }}</a>
				<a href="{{url_for('timetable', kw=0) }}" style="width: 80px;" class="center-block btn btn-default">today</a>
13 14
			</div>
       		</div>
15
		<div class="panel-body row table-responsive" style="margin-left: 0px; margin-right: 0px; padding-left: 0px; padding-right: 0px">
16
			<table id="timetable" class="table table-bordered col-xs-12" style="width: auto; min-width: 100%;">
Andreas Valder's avatar
Andreas Valder committed
17
				<tr><th style="width: 30px;"></th>{% for d in days if (d.index < 5) or (d.lectures|length) > 0 %}<th style="width: {{ 100/(days|length -1) }}%; min-width: 10em;" colspan="{{d.maxcol}}">{{ d.date.strftime("%A (%d.%m.%Y)") }}</th>{% endfor %}</tr>
18 19
				{% for t in times %}
				{% set time_loop = loop %}
20
				<tr height="12px" {% if t.strftime("%M") == "00" %} class="hourlytime" {% endif %}>
Andreas Valder's avatar
Andreas Valder committed
21 22
					{% 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 %}
23
						{% for i in range(1,d.maxcol+1) %}
24
						{% for l in d.lectures|selectattr('timetable_col','equalto',i) if (((l.time.time() > t) and (l.time.time() < times[time_loop.index+1])) != (l.time.time() == t ) ) %}
25
						<td {% if i == 1 %} class="newday"{% endif %} rowspan="{{l.duration / 15}}" style="background: {% if l.visible and l.course.visible %}lightgrey;{% else %}#f2dede{% endif %}">
Andreas Valder's avatar
Andreas Valder committed
26
							<p class="small">
27 28 29 30 31 32 33
								<strong>
									<a class="hidden-print" href="{{url_for('course', id=l.course_id)}}#lecture-{{l.id}}">
										{{l.course.short}}
									</a>
									<span class="visible-print-inline">{{l.course.short}}</span>
								</strong>
								<br>
34
								{{l.time.strftime("%H:%M")}} - {{l.time_end.strftime("%H:%M")}}<br>
35 36
								{{l.place}}
							</p>
Andreas Valder's avatar
Andreas Valder committed
37
						</td>
38
							{% else %}
39
								{% for l in d.lectures|selectattr('timetable_col','equalto',i) if (l.time.time() < t) and (l.time_end.time() > t) %}
40
								{% else %}
41
								<td {% if i == 1 %} class="newday"{% endif %}></td>
42 43 44 45 46 47 48
								{% endfor %}
							{% endfor %}
						{% endfor %}
					{% endfor %}
				</tr>
				{% endfor %}
			</table>
Andreas Valder's avatar
Andreas Valder committed
49 50 51 52 53 54
		</div>
	</div>
</div>
</div>

{% endblock %}