base.html 9.71 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')}}">
Julian Rother's avatar
Julian Rother committed
19
		<link rel="stylesheet" href="{{url_for('static', filename='font-awesome/css/all.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
		<script src="{{url_for('static', filename='videojs/videojs-resolution-switcher.js')}}"></script>
38
		<script src="{{url_for('static', filename='videojs/videojs.hotkeys.js')}}"></script>
39
		<script src="{{url_for('static', filename='videojs/videojs-markers.js')}}"></script>
40
		{% endblock %}
Andreas Valder's avatar
Andreas Valder committed
41
42
	</head>
	<body>
Andreas Valder's avatar
Andreas Valder committed
43
	{% block navbar %}
44
45
46
47
48
49
50
51
52
53
54
55
56
57
		{% 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 %}
58
		<nav class="hidden-print navbar navbar-default navbar-static-top" {% if config.DEBUG %} style="background-color: red" {% endif %} >
59
			<div class="container-fluid">
60
				<div class="navbar-header">
61
					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
62
63
64
65
66
67
						<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
68
						<img alt="Brand" src="{{url_for('static', filename='logo.png')}}" style="height: 44px; width: 44px" >
69
					</a>
70
					<ul class="nav nav-pills" style="margin-top: 5px; padding-left: 40px;">
71
72
						{% for n in navbar if n.visible and (not n.userendpoint) %}
							{{ navbaricon(n) }}
73
74
						{% endfor %}
					</ul>
75
				</div>
Andreas Valder's avatar
Andreas Valder committed
76
				<div class="collapse navbar-collapse" style="overflow-y: inherit">
77
					<ul class="nav nav-pills" style="margin-top: 5px;">
78
79
						{% for n in navbar if (not n.visible) and ismod() and (not n.userendpoint) and (not n.group) %}
							{{ navbaricon(n) }}
80
81
						{% endfor %}

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