index.html 6.69 KB
Newer Older
Andreas Valder's avatar
Andreas Valder committed
1
{% from 'macros.html' import preview %}
Andreas Valder's avatar
Andreas Valder committed
2
{% extends "base.html" %}
3
{% set page_border = 0 %}
4
5
6
7
8
9
{% if ismod() %}
	{# Little hack to not show annoucements twice #}
	{% set min_announcement_level = 999 %}
{% else %}
	{% set min_announcement_level = 0 %}
{% endif %}
Andreas Valder's avatar
Andreas Valder committed
10
{% block content %}
11
{% if ismod() %}
12
13
<div class="row">
	<div class="col-xs-12">
14
		{% for msg in get_announcements() %}
Andreas Valder's avatar
Andreas Valder committed
15
16
		<div class="alert alert-{{levels.get(msg.level, ('info', ''))[0]}}" role="alert">
			<div>
17
18
				<div class="pull-right">{{ moderator_delete(('announcements',msg.id,'deleted')) }}</div>
				<div>{{ moderator_editor(('announcements',msg.id,'text'), msg.text) }}</div>
19
			</div>
Andreas Valder's avatar
Andreas Valder committed
20
			<div>
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
				<ul class="list-inline">
					<li>
						{% if not msg.visible %}
							<a href="{{ url_for('edit', prefix='announcements.'+msg.id|string+'.', ref=request.url, visible=1) }}" class="btn btn-primary">Veröffentlichen</a>
						{% elif msg.time_expire and msg.time_expire < datetime.now() %}
							<a href="#" class="btn btn-danger disabled">Abgelaufen</a>
						{% elif msg.time_publish and msg.time_publish > datetime.now() %}
							<a href="#" class="btn btn-default disabled">Geplant</a>
						{% else %}
							<a href="#" class="btn btn-success disabled">Öffentlich</a>
						{% endif %}
					</li>
					<li class="dropdown">
						<span class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">{{levels.get(msg.level, ('', 'Unbekannt'))[1]}} <span class="caret"></span></span>
						<ul class="dropdown-menu">
							{% for level, descr in levels.items() %}
								<li><a href="{{ url_for('edit', prefix='announcements.'+(msg.id|string)+'.', ref=request.url, level=level) }}">{{ descr[1] }}</a></li>
							{% endfor %}
						</ul>
					</li>
					<li>
42
						Aktiv von {{ moderator_editor(('announcements',msg.id,'time_publish'), msg.time_publish) }}
43
44
					</li>
					<li>
45
						bis {{ moderator_editor(('announcements',msg.id,'time_expire'), msg.time_expire) }}
46
47
48
					</li>
				</ul>
			</div>
49
50
51
52
53
54
55
56
		</div>
		{% endfor %}
	</div>
</div>
<div class="row">
	<div class="col-xs-12">
		<ul class="list-inline pull-right">
			<li style="padding-right: 0px;">
57
				<a class="btn btn-default" href="{{ url_for('create', table='announcements', text='Neue Ankündigung', time_publish=datetime.now().replace(hour=0, minute=0, second=0, microsecond=0), time_expire=datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)+timedelta(days=7), ref=request.url) }}">Neue Ankündigung</a>
58
			</li>
59
60
61
		</ul>
	</div>
</div>
62
{% endif %}
63
64
65
66
67
<div class="row">
	<div class="col-md-6 panel-group">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h1 class="panel-title">Video AG</h1>
Andreas Valder's avatar
Andreas Valder committed
68
			</div>
69
70
			<div class="panel-body">
				<p>Wir machen Vorlesungsvideos, damit du dir deine Vorlesungen angucken kannst, wann, wo und so oft <strong>du</strong> willst ;)</p>
71
				<p><strong>Probleme?</strong><a href="{{url_for('faq')}}"> Hier gehts zur FAQ</a></p>
72
73
74
75
76
				<p>Wenn du die Videos nützlich fandest, schreib doch bitte den Dozenten eine kurze E-Mail. Waren die Videos grauenhaft? Kritik an uns.</p>
				<p>Wenn du mitmachen willst, Fragen oder Anregungen hast, oder nur mal schauen möchtest, komm zu unserem AG-Treffen oder schreib uns eine E-Mail.
				Insbesondere freuen wir uns über Studis der Mathematik und Physik, die ihre Vorlesungen filmen wollen.</p>
				<p>Die nächste Sitzung der AG findet am <strong>10.08.2016 ab 18:00 Uhr in den Räumlichkeiten der Fachschaft im Augustinerbach 2a, 1. Obergeschoss</strong> statt.
				</p>
Andreas Valder's avatar
Andreas Valder committed
77
78
			</div>
		</div>
Andreas Valder's avatar
Andreas Valder committed
79
		{% if (featured|length > 0) or ismod() %}
Andreas Valder's avatar
Andreas Valder committed
80
81
			<div class="panel panel-default">
				<div class="panel-heading">
Andreas Valder's avatar
Andreas Valder committed
82
83
					<h1 class="panel-title">Featured
						{% if ismod() %}
84
							<a class="btn btn-default" href="{{ url_for('create', table='featured', title='Neuer Artikel', ref=request.url) }}">Neue Empfehlung</a>
Andreas Valder's avatar
Andreas Valder committed
85
86
						{% endif %}
					</h1>
Andreas Valder's avatar
Andreas Valder committed
87
88
				</div>
				<div class="panel-body">
Andreas Valder's avatar
Andreas Valder committed
89
					<div id="myCarousel" class="carousel slide" data-ride="carousel" style="background-color: #EEE; min-height: 400px;" {% if ismod() %}data-interval="false"{% endif %}>
Andreas Valder's avatar
Andreas Valder committed
90
91
						<ol class="carousel-indicators">
							{% for i in featured %}
Andreas Valder's avatar
Andreas Valder committed
92
							<li data-target="#myCarousel" data-slide-to="{{ loop.index0 }}" {% if loop.first %} class="active" {% endif %}></li>
Andreas Valder's avatar
Andreas Valder committed
93
94
95
96
97
							{% endfor %}
						</ol>
							<div class="carousel-inner" role="listbox">
						{% for i in featured %}
								<div class="item {% if loop.first %}active{% endif %}">
Andreas Valder's avatar
Andreas Valder committed
98
99
									{% if ismod() %}
										<div class="center-block">
100
101
102
											{{ moderator_editor(('featured',i.id,'text'), i.text) }}
											{{ moderator_editor(('featured',i.id,'title'), i.title) }}
											{{ moderator_checkbox(('featured',i.id,'visible'),i.visible) }}
Andreas Valder's avatar
Andreas Valder committed
103
104
105
106
107
										</div>
									{% else %}
										{{i.text|safe}}
									{% endif %}
									<div class="carousel-caption">{{ i.title }}</div>
Andreas Valder's avatar
Andreas Valder committed
108
109
110
								</div>
						{% endfor %}
							</div>
Andreas Valder's avatar
Andreas Valder committed
111
112
113
114
115
116
117
118
119
120
							{% if not ismod() %}
								<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
									<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
									<span class="sr-only">Previous</span>
								</a>
								<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
									<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
									<span class="sr-only">Next</span>
								</a>
							{% endif %}
Andreas Valder's avatar
Andreas Valder committed
121
122
					</div>
				</div>
Andreas Valder's avatar
Andreas Valder committed
123
			</div>
Andreas Valder's avatar
Andreas Valder committed
124
		{% endif %}
125
126
	</div>
	<div class="col-md-6">
Andreas Valder's avatar
Andreas Valder committed
127
128
129
130
		<div class="panel panel-default">
			<div class="panel-heading">
				<h1 class="panel-title">Nächste Aufnahmen</h1">
			</div>
131
132
133
134
135
136
137
138
			{% if upcomming|length > 0 %}
				<ul class="list-group">
					{% for g in upcomming|groupby('date') %}
						<li class="list-group-item">
							<ul class="list-group" style="margin: 0px;">
								<strong>{{ g.grouper|date }}</strong>
								{% for i in g.list %}
								<li class="list-group-item list-group-item-condensed">
139
									{{i.time|time}} {{i.place}} <a href="{{url_for('course', id=i.course_id)}}">{{i.course.title}}</a>: <a href="{{url_for('course', id=i.course_id)}}#lecture-{{i.id}}">{{i.title}}</a>
Andreas Valder's avatar
Andreas Valder committed
140

141
142
143
144
145
146
147
								</li>
								{% endfor %}
							</ul>
						</li>
					{% endfor %}
				</ul>
			{% else %}
148
149
150
				<div class="panel-body">
					<p>In den nächsten 7 Tagen wird noch nichts aufgenommen oder gestreamt.</p>
				</div>
151
			{% endif %}
Andreas Valder's avatar
Andreas Valder committed
152
		</div>
153
154
		<div class="panel panel-default">
			<div class="panel-heading">
Andreas Valder's avatar
Andreas Valder committed
155
				<h1 class="panel-title">Neueste Videos <a class="fa fa-rss-square pull-right" aria-hidden="true" href="{{url_for('feed')}}"  style="text-decoration: none"></a></h1">
156
157
158
159
160
161
			</div>
			<ul class="list-group videopreview">
				{% for i in latestvideos %}
					{{ preview(i) }}
				{% endfor %}
			</ul>
Andreas Valder's avatar
Andreas Valder committed
162
163
164
165
		</div>
	</div>
</div>
{% endblock %}