cutprogress.html 2.41 KB
Newer Older
1
{% extends "base.html" %}
2
{% set page_border = 0 %}
3
4
5
6
7
{% block content %}
<div class="panel-group">
	<div class="panel panel-default">
		<div class="panel-heading">
			<span class="panel-title">
Andreas Valder's avatar
Andreas Valder committed
8
				Schnittfortschritt{% if user %} für {{ user.realname }}{% endif %}
9
			</span>
Andreas Valder's avatar
Andreas Valder committed
10
11
12
				<span class="pull-right">
					Semester <select id="semesterselect" name="semester"></select>
				</span>
13
14
		</div>
		<div class="panel-body table-responsive">
15
			<table id="cutprogress" class="table table-condensed table-bordered">
16
				<tr>
17
18
19
					<th class="text-left">
						Datum
					</th>
20
21
22
23
24
25
26
27
				{% for course in courses %}
					<th class="text-center rotate">
						<div>
							<a title="Zuständig: {{ course.responsible|join(attribute='realname') }}" href="{{ url_for("course", handle=course.handle) }}">{{ course.short }}</a>
						</div>
					</th>
				{% endfor %}
				</tr>
28
29
30
31
32

			{% for row in tablebody %}
				<tr class="text-center {% if row.is_new_week %}weekbreak{% endif %}">
					<td class="text-left">{{ row.date.strftime("%d.%m.%Y (%a)") }}</td>
					{% for cell in row.cells %}
33
					<td>
34
35
36
						{% for lecture in cell %}
						<a href="{{ url_for('course', handle=lecture.course_id) }}#lecture-{{ lecture.id }}" title="Uhrzeit: {{ lecture.time.strftime('%H:%M') }}&#10;Titel: {{ lecture.title|replace('\n','') }}&#10;Videos: {{ lecture.videos_total }}&#10;Interner Kommentar: {{ lecture.internal }}">
							{% if lecture.videos_total == 0 %}
37
								<span style="color: red" aria-hidden="true" class="fa fa-times"></span>
38
39
							{% elif lecture.videos_visible == 0 %}
								<span style="color: orange" aria-hidden="true" class="glyphicon glyphicon-ok"></span>
40
							{% else %}
41
								<span style="color: green" aria-hidden="true" class="glyphicon glyphicon-ok"></span>
42
							{% endif %}
43
44
						</a>
						{% endfor %}
45
46
47
					</td>
					{% endfor %}
				</tr>
48
			{% endfor %}
49
50
51
52
53
54
55
56
57
58
59
			</table>
		</div>
	</div>
</div>
<script>
$( document ).ready(function () {
	{% for s in allsemester %}
	$("#semesterselect").append('<option value="{{ s.semester}}">{{ s.semester|semester }}</option>');
	{% endfor %}
	$("#semesterselect").val("{{ semester }}")
	$("#semesterselect").on("change", function () {
Andreas Valder's avatar
Andreas Valder committed
60
61
62
63
64
		{% if user %}
		window.location.href="{{ url_for('cutprogress_user', user=user.id) }}?semester="+$("#semesterselect").val();
		{% else %}
		window.location.href="{{ url_for('cutprogress') }}?semester="+$("#semesterselect").val();
		{% endif %}
65
66
67
68
	});
});
</script>
{% endblock %}