base.html 9.18 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 endpoint, caption, iconlib, gly, visible in navbar if ((visible or ismod()) and (endpoint == request.endpoint)) %}- {{ caption }}{% else%}{% 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

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

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