base.html 9.87 KB
Newer Older
1
{% set page_border = page_border|default(1) %}
2
{% set global_permissions = [] %}
3
{% set min_announcement_level = min_announcement_level|default(1) %}
4
{% set levels = {0: ('info', 'Nur auf Hauptseite sichtbar'), 1: ('info', 'Auf allen Unterseiten sichtbar (Hinweis)'), 2: ('warning', 'Auf allen Unterseiten sichtbar (Warnung)'), 3: ('danger', 'Auch auf Embed-Page sichtbar (Wichtig)')} %}
5
{% from 'macros.html' import moderator_editor, moderator_checkbox, moderator_delete %}
6

Andreas Valder's avatar
Andreas Valder committed
7
<!DOCTYPE html>
8
<html lang="de">
Andreas Valder's avatar
Andreas Valder committed
9
	<head>
10
		{% block header %}
11
		<title>Video AG {% block title %}{% for n in navbar if ((n.visible or ismod()) and (endpoint == request.endpoint)) %}- {{ n.name }}{% endfor %}{% endblock %}</title>
12
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
13
		<link rel="icon" type="image/png" href="{{url_for('static', filename='favicon.png')}}">
Andreas Valder's avatar
Andreas Valder committed
14
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
15
		<meta name="viewport" content="width=device-width, initial-scale=1">
16

17
		<link href="{{url_for('static', filename='bootstrap/bootstrap.css')}}" rel="stylesheet">
18
		<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='style.css')}}">
19
		<link rel="stylesheet" href="{{url_for('static', filename='font-awesome/css/font-awesome.css')}}">
20
		<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='videojs/video-js.css')}}">
21
		<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='videojs/videojs.markers.css')}}">
22
		<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='videojs/videojs-resolution-switcher.css')}}">
23
24
25
		{% if ismod() %}
		<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='bootstrap-multiselect.css')}}">
		{% endif %}
26
27

		<script src="{{url_for('static', filename='jquery.js')}}"></script>
28
		<script src="{{url_for('static', filename='bootstrap/bootstrap.js')}}"></script>
29
		<script src="{{url_for('static', filename='js.cookie.js')}}"></script>
30
31
		{%if ismod() %}
		<script src="{{url_for('static', filename='moderator.js')}}"></script>
32
		<script src="{{url_for('static', filename='bootstrap-multiselect.js')}}"></script>
33
		<script src="{{url_for('static', filename='plotly.min.js')}}"></script>
34
		{% endif %}
35
		<script src="{{url_for('static', filename='videojs/video.js')}}"></script>
Andreas Valder's avatar
Andreas Valder committed
36
		<script src="{{url_for('static', filename='videojs/lang/de.js')}}"></script>
37
38
		<script src="{{url_for('static', filename='videojs/ie8/videojs-ie8.js')}}"></script>
		<script src="{{url_for('static', filename='videojs/videojs-resolution-switcher.js')}}"></script>
Andreas Valder's avatar
Andreas Valder committed
39
		<script src="{{url_for('static', filename='videojs/videojs-contrib-hls.js')}}"></script>
40
		<script src="{{url_for('static', filename='videojs/videojs.hotkeys.js')}}"></script>
41
		<script src="{{url_for('static', filename='videojs/videojs-markers.js')}}"></script>
42
		{% endblock %}
Andreas Valder's avatar
Andreas Valder committed
43
44
	</head>
	<body>
Andreas Valder's avatar
Andreas Valder committed
45
	{% block navbar %}
46
47
48
49
50
51
52
53
54
55
56
57
58
59
		{% macro navbaricon(data, user=none) -%}
			<li{% if data.endpoint == request.endpoint %} class="active"{% endif %}>
				<a href="{{ url_for(data.endpoint, user=user) }}" style="padding: 10px 6px;">
					{% if data.gly != '' %}
						{% if data.iconlib == 'bootstrap' %}
							<span aria-hidden="true" class="glyphicon glyphicon-{{ data.icon }}"></span>
						{% elif data.iconlib == 'fa' %}
							<span aria-hidden="true" class="fa fa-{{ data.icon }}"></span>
						{% endif %}
					{{ data.name }}
					{% endif %}
				</a>
			</li>
		{%- endmacro %}
60
		<nav class="hidden-print navbar navbar-default navbar-static-top" {% if config.DEBUG %} style="background-color: red" {% endif %} >
61
			<div class="container-fluid">
62
				<div class="navbar-header">
63
					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
64
65
66
67
68
69
						<span class="sr-only">Toggle navigation</span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>
					<a class="navbar-brand" href="/" style="padding: 3px;">
Andreas Valder's avatar
Andreas Valder committed
70
						<img alt="Brand" src="{{url_for('static', filename='logo.png')}}" style="height: 44px; width: 44px" >
71
					</a>
72
					<ul class="nav nav-pills" style="margin-top: 5px; padding-left: 40px;">
73
74
						{% for n in navbar if n.visible and (not n.userendpoint) %}
							{{ navbaricon(n) }}
75
76
						{% endfor %}
					</ul>
77
				</div>
Andreas Valder's avatar
Andreas Valder committed
78
				<div class="collapse navbar-collapse" style="overflow-y: inherit">
79
					<ul class="nav nav-pills" style="margin-top: 5px;">
80
81
						{% for n in navbar if (not n.visible) and ismod() and (not n.userendpoint) and (not n.group) %}
							{{ navbaricon(n) }}
82
83
						{% endfor %}

84
85
86
87
88
89
90
91
92
93
						{% for grouper, list in navbar|rejectattr("group", "none")|groupby("group") %}
							<li{% if request.endpoint in list|map(attribute='endpoint') %} class="active dropdown"{% endif %}>
								<a data-toggle="dropdown" data-boundary="viewport" class="dropdown-toggle" style="padding: 10px 6px;">{{ grouper }}<span class="caret"></span></a>
								<ul class="dropdown-menu">
									{% for n in list %}
										{{ navbaricon(n) }}
									{% endfor %}
								</ul>
							</li>
						{% endfor %}
94
						<li class="col-xs-9 col-sm-4 pull-right">
95
							<form action="{{ url_for('search') }}" role="search">
96
								<div class="input-group" style="margin-top: 3px">
97
									<input class="form-control" type="text" name="q" placeholder="Search" value="{{ searchtext }}">
98
99
100
101
102
103
									<span class="input-group-btn"><button class="btn btn-secondary" type="submit"><span class="glyphicon glyphicon-search"></span> </button></span>
								</div>
							</form>
						</li>
						<li class="navbar-right">
							{% if not ismod() %}
Andreas Valder's avatar
Andreas Valder committed
104
							<a href="{{url_for('login', ref=request.url)}}" id="loginpopover" data-container="body" data-toggle="popover" data-placement="bottom"> 
105
106
107
								<span class="glyphicon glyphicon-log-in"></span>
							</a>
							<script>
Andreas Valder's avatar
Andreas Valder committed
108
109
110
								$('#loginpopover').on('click',function(e){
									e.preventDefault();
								}).popover(
111
112
113
										{
											html:true,
											title:'Login für Moderatoren',
114
											content:'<form method="post" action="{{url_for('login', ref=request.values.get('ref', request.url))}}"><input autofocus placeholder="User" name="user" type="text" class="form-control"><input placeholder="Password" name="password" type="password" class="form-control"><br><input type="submit" value="Login" class="btn btn-default"></form>'
115
116
117
118
										}
										)
							</script>
							{% else %}
Andreas Valder's avatar
Andreas Valder committed
119
120
								<button data-toggle="dropdown" data-boundary="viewport" class="btn dropdown-toggle" style="padding: 10px 6px;">{{ session.user.givenName }} <span class="caret"></span></button>
								<ul class="dropdown-menu">
121
122
									{% for n in navbar if n.userendpoint %}
										{{ navbaricon(n, user=session.user.dbid) }}
Andreas Valder's avatar
Andreas Valder committed
123
124
125
126
									{% endfor %}
									<li class="divider"></li>
									<li><a href="{{url_for('logout', ref=request.url)}}">Logout</a></li>
								</ul>
127
128
129
							{% endif %}
						</li>
					</ul>	
130
131
132
				</div>
			</div>
		</nav>
Andreas Valder's avatar
Andreas Valder committed
133
		{% endblock %}
134
		<div class="container-fluid" style="margin-bottom: 30px;">
135
136
137
138
			<div class="row">
				{% if page_border == 0 %}
				<div class="col-xs-12">
				{% else %}
139
				<div class="col-xs-12 col-md-offset-{{ page_border }} col-md-{{ 12-(2*page_border) }}">
140
				{% endif %}
141
					{% block announcements %}
142
					{% for msg in get_announcements(min_announcement_level) if (not request.cookies['alert-info-'+msg.id|string]) %}
143
					<div class="hidden-print alert alert-{{levels.get(msg.level, ('info', ''))[0]}}" role="alert">
144
145
						<a href="#" class="close" data-dismiss="alert" aria-label="close" onclick="Cookies.set('alert-info-{{msg.id}}', '1');">&times;</a>
						{{ msg.text|safe }}
Julian Rother's avatar
Julian Rother committed
146
					</div>
147
					{% endfor %}
148
					{% endblock %}
149
150
151
152
153
					{% block alerts %}
					{% for msg in get_flashed_messages(category_filter=["message"]) %}
					<div class="hidden-print alert alert-danger" role="alert">{{ msg|safe }}</div>
					{% endfor %}
					{% endblock %}
Julian Rother's avatar
Julian Rother committed
154
155
					{% block content %}
					{% endblock %}
156
157
				</div>
			</div>
158
		</div>
Andreas Valder's avatar
Andreas Valder committed
159
		{% block footer %}
160
		<footer class="footer hidden-print" {% if config.DEBUG %} style="background-color: red" {% endif %} >
161
			<div class="container-fluid">
Andreas Valder's avatar
Andreas Valder committed
162
				<ul class="list-inline" style="margin-top: 5px;">
163
					<li>
Andreas Valder's avatar
Andreas Valder committed
164
						<a href="https://www.fsmpi.rwth-aachen.de/">Fachschaft I/1</a>
165
166
					</li>
					<li>
Andreas Valder's avatar
Andreas Valder committed
167
						<a href="http://www.vampir.rwth-aachen.de/">Vampir e.V.</a>
168
169
					</li>
					<li>
Andreas Valder's avatar
Andreas Valder committed
170
						<a href="https://www.youtube.com/channel/UCxh5snRN7yZyBsytNbGNuEQ">Youtube</a>
171
172
					</li>
					<li>
Andreas Valder's avatar
Andreas Valder committed
173
						<a href="https://www.facebook.com/videoag">Facebook</a>
174
175
					</li>
					<li>
Andreas Valder's avatar
Andreas Valder committed
176
						<a href="https://twitter.com/rwthvideo">Twitter</a>
177
					</li>
178
					{% if ismod() or config.DEBUG %}
179
					<li class="pull-right">
Andreas Valder's avatar
Andreas Valder committed
180
						<a target="_blank" href="https://git.fsmpi.rwth-aachen.de/videoaginfra/website/commit/{{ gitversion.longhash }}"><span title="{{ gitversion.branch }} {{ gitversion.hash }}: {{ gitversion.msg }}" data-toggle="tooltip">{{ gitversion.hash }}</span></a>
181
						<span>{{ gethostname() }}</span>
182
183
184
						{% if is_readonly() %}
							<span>(read-only)</span>
						{% endif %}
185
186
					</li>
					{% endif %}
187
				</ul>
188
189
			</div>
		</footer>
Andreas Valder's avatar
Andreas Valder committed
190
		{% endblock %}
Andreas Valder's avatar
Andreas Valder committed
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
		{% block modals %}
		<div class="modal fade" id="modal_apierror" role="dialog">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal">&times;</button>
						<h4 style="color:red;"><span class="glyphicon glyphicon-exclamation-sign"></span> Error</h4>
					</div>
					<div class="modal-body">
					</div>
					<div class="modal-footer">
					</div>
				</div>
			</div>
		</div> 
		{% endblock %}
207
208
	{% if ismod() %}
		<script>
209
			$( function () {
210
211
				moderator.permissioneditor.setpermissions({{global_permissions|tojson|safe}});
				moderator.api.setcsrftoken('{{ session['_csrf_token'] }}');
212
			});	
213
214
		</script>
	{% endif %}
215
216
	<script>
		$( function () {
217
218
219
220
221
			$('[data-toggle="tooltip"]').tooltip(
			{ 
				trigger: 'hover',
				html: true
			});
222
223
		});	
	</script>
224
	</body>
Andreas Valder's avatar
Andreas Valder committed
225
</html>