index.html 6.12 KB
Newer Older
1
{% from 'macros.html' import preview, featured_content, livelabel %}
Andreas Valder's avatar
Andreas Valder committed
2
{% extends "base.html" %}
3
{% set page_border = 0 %}
4
5
{% set min_announcement_level = 0 %}
{% block announcements %}
6
{% if ismod() %}
7
8
<div class="row">
	<div class="col-xs-12">
9
		{% for msg in get_announcements() %}
Andreas Valder's avatar
Andreas Valder committed
10
11
		<div class="alert alert-{{levels.get(msg.level, ('info', ''))[0]}}" role="alert">
			<div>
12
13
				<div class="pull-right">{{ moderator_delete(('announcements',msg.id,'deleted')) }}</div>
				<div>{{ moderator_editor(('announcements',msg.id,'text'), msg.text) }}</div>
14
			</div>
Andreas Valder's avatar
Andreas Valder committed
15
			<div>
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
				<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>
37
						Aktiv von {{ moderator_editor(('announcements',msg.id,'time_publish'), msg.time_publish) }}
38
39
					</li>
					<li>
40
						bis {{ moderator_editor(('announcements',msg.id,'time_expire'), msg.time_expire) }}
41
42
43
					</li>
				</ul>
			</div>
44
45
46
47
		</div>
		{% endfor %}
	</div>
</div>
48
49
50
51
52
53
{% else %}
{{ super() }}
{% endif %}
{% endblock %}
{% block content %}
{% if ismod() %}
54
55
56
<div class="row">
	<div class="col-xs-12">
		<ul class="list-inline pull-right">
Julian Rother's avatar
Julian Rother committed
57
58
59
60
			<li style="padding-right: 0px;">
				<div class="btn-group">
					<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Neues Panel <span class="caret"></span></button>
					<ul class="dropdown-menu">
61
62
						<li><a href="{{ url_for('create', table='featured', title='Neues Panel', type='plain', ref=request.url) }}">Nur Text</a></li>
						<li><a href="{{ url_for('create', table='featured', title='Neues Panel', type='image', ref=request.url) }}">Text mit Bild</a></li>
Julian Rother's avatar
Julian Rother committed
63
						<li><a href="{{ url_for('create', table='featured', title='Neues Panel', type='video', ref=request.url) }}">Text mit Video</a></li>
64
						<li><a href="{{ url_for('create', table='featured', title='Neues Panel', type='courses', param='semester', param2='', ref=request.url) }}">Veranstaltungsliste</a></li>
Julian Rother's avatar
Julian Rother committed
65
66
67
					</ul>
				</div>
			</li>
68
			<li style="padding-right: 0px;">
69
				<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>
70
			</li>
71
72
73
		</ul>
	</div>
</div>
74
{% endif %}
75
<div class="row">
76
	<div class="col-md-6">
77
		{% for item in featured %}
78
79
		<div class="panel panel-default">
			<div class="panel-heading">
80
				<span class="panel-title">
81
					{{ moderator_editor(('featured',item.id,'title'), item.title) }} {{ moderator_checkbox(('featured',item.id,'visible'), item.visible) }}
82
					{% if ismod() %}
83
					<span class="btn-group pull-right" role="group">
84
85
						{% if not loop.first %}
							<a class="btn btn-default" href="{{ url_for('edit', **{'featured.'+item.id|string+'.order': featured[loop.index0-1].order, 'featured.'+featured[loop.index0-1].id|string+'.order': item.order, 'ref': request.url})}}"><span class="glyphicon glyphicon-arrow-up"></span></a>
86
						{% else %}
87
88
89
90
91
92
							<button class="btn btn-default disabled"><span class="glyphicon glyphicon-arrow-up"></span></button>
						{% endif %}
						{% if not loop.last %}
							<a class="btn btn-default" href="{{ url_for('edit', **{'featured.'+item.id|string+'.order': featured[loop.index0+1].order, 'featured.'+featured[loop.index0+1].id|string+'.order': item.order, 'ref': request.url})}}"><span class="glyphicon glyphicon-arrow-down"></span></a>
						{% else %}
							<button class="btn btn-default disabled"><span class="glyphicon glyphicon-arrow-down"></span></button>
93
						{% endif %}
94
						{{ moderator_delete(['featured',item.id,'deleted']) }}
95
					</span>
96
					{% endif %}
97
				</span>
Andreas Valder's avatar
Andreas Valder committed
98
			</div>
Julian Rother's avatar
Julian Rother committed
99
			{{ featured_content(item) }}
Andreas Valder's avatar
Andreas Valder committed
100
		</div>
101
		{% endfor %}
102
103
	</div>
	<div class="col-md-6">
Andreas Valder's avatar
Andreas Valder committed
104
105
		<div class="panel panel-default">
			<div class="panel-heading">
106
				<h1 class="panel-title">Nächste Aufnahmen</h1>
Andreas Valder's avatar
Andreas Valder committed
107
			</div>
108
109
110
111
			{% if upcomming|length > 0 %}
				<ul class="list-group">
					{% for g in upcomming|groupby('date') %}
						<li class="list-group-item">
112
							<strong>{{g.grouper.strftime("%a")}}, {{ g.grouper|date }}</strong>
113
114
115
							<ul class="list-group" style="margin: 0px;">
								{% for i in g.list %}
								<li class="list-group-item list-group-item-condensed">
116
									{{i.time|time}} <a href="{{url_for('course', handle=i.course.handle)}}">{{i.course.title}}</a>: <a href="{{url_for('course', handle=i.course.handle)}}#lecture-{{i.id}}">{{i.title}}</a> {{livelabel(i.live, i.nowlive)}}
117
118
119
120
121
122
123
								</li>
								{% endfor %}
							</ul>
						</li>
					{% endfor %}
				</ul>
			{% else %}
124
				<div class="panel-body">
125
					<p>In den nächsten 7 Tagen sind keine Aufnahmen oder Livestreams geplant.</p>
126
				</div>
127
			{% endif %}
Andreas Valder's avatar
Andreas Valder committed
128
		</div>
129
130
		<div class="panel panel-default">
			<div class="panel-heading">
131
				<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>
132
133
134
135
136
137
			</div>
			<ul class="list-group videopreview">
				{% for i in latestvideos %}
					{{ preview(i) }}
				{% endfor %}
			</ul>
Andreas Valder's avatar
Andreas Valder committed
138
139
140
141
		</div>
	</div>
</div>
{% endblock %}