cutprogress.html 2.45 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
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
		</div>
		<div class="panel-body table-responsive">
			<table class="table table-condensed table-bordered">
				<tr>
				{% 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>
				{% for i in range(maxlecturecount) %}
				<tr class="text-center">
					{% for course in courses %}
					<td>
						{% set l = course.lectures[i]|d({}) %}
						{% if "time" in l %}
						<a href="{{ url_for("course", handle=course.handle) }}#lecture-{{ l.id }}" title="{{ l.time }} &#10;Titel: {{ l.title|replace('\n','') }} &#10;Videos: {{ l.videos|count }} &#10;Internes Kommentar: {{ l.internal }}">
							{% if l.time < datetime.now() %}
								{% if l.videos|count == 0 %}
								<span style="color: red" aria-hidden="true" class="fa fa-times"></span>
								{% else %}
36
37
38
39
40
									{% if l.videos|selectattr('visible')|list|count == 0 %}
										<span style="color: orange" aria-hidden="true" class="glyphicon glyphicon-ok"></span>
									{% else %}
										<span style="color: green" aria-hidden="true" class="glyphicon glyphicon-ok"></span>
									{% endif %}
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
								{% endif %}
							{% else %}
								<span style="color: grey" aria-hidden="true" class="fa fa-times"></span>
							{% endif %}
							</a>
						{% else %}
						{% endif %}
					</td>
					{% endfor %}
				</tr>
				{% endfor %}
			</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
63
64
65
66
67
		{% 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 %}
68
69
70
71
	});
});
</script>
{% endblock %}