base.html 7.6 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', 'Überall sichtbar (Hinweis)'), 2: ('warning', 'Überall sichtbar (Warnung)'), 3: ('danger', 'Überall sichtbar (Wichtig)')} %}
5
{% from 'macros.html' import moderator_editor, moderator_checkbox, moderator_delete %}
6

Andreas Valder's avatar
Andreas Valder committed
7
8
9
<!DOCTYPE html>
<html>
	<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
15
16
		<meta http-equiv="content-language" content="de-DE">
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
		<meta charset="UTF-8">
17
		<meta name="viewport" content="width=device-width, initial-scale=1">
18

19
		<link href="{{url_for('static', filename='bootstrap/bootstrap.css')}}" rel="stylesheet">
20
		<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='style.css')}}">
21
		<link rel="stylesheet" href="{{url_for('static', filename='font-awesome/css/font-awesome.css')}}">
22
23
		<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='videojs/video-js.css')}}">
		<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='videojs/videojs-resolution-switcher.css')}}">
24
25

		<script src="{{url_for('static', filename='jquery.js')}}"></script>
26
		<script src="{{url_for('static', filename='bootstrap/bootstrap.js')}}"></script>
27
		<script src="{{url_for('static', filename='js.cookie.js')}}"></script>
28
29
		{%if ismod() %}
		<script src="{{url_for('static', filename='moderator.js')}}"></script>
30
		<script src="{{url_for('static', filename='plotly.min.js')}}"></script>
31
		{% endif %}
32
33
34
		<script src="{{url_for('static', filename='videojs/video.js')}}"></script>
		<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
		{% endblock %}
Andreas Valder's avatar
Andreas Valder committed
38
39
	</head>
	<body>
Andreas Valder's avatar
Andreas Valder committed
40
	{% block navbar %}
41
		<nav class="hidden-print navbar navbar-default navbar-static-top" {% if config.DEBUG %} style="background-color: red" {% endif %} >
42
			<div class="container-fluid">
43
44
45
46
47
48
49
50
51
52
53
54
55
56
				<div class="navbar-header">
					<button type="button" class="navbar-toggle" data-toggle="collapse" 
						 data-target=".navbar-collapse">
						<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;">
						<img alt="Brand" src="{{url_for('static', filename='logo.png')}}" style="height: 100%;" >
					</a>
				</div>
				<div class="collapse navbar-collapse">
					<ul class="nav nav-pills" style="margin-top: 5px;">
Andreas Valder's avatar
Andreas Valder committed
57
						{% for endpoint, caption, iconlib, gly, visible in navbar if visible or ismod() %}
58
59
60
							<li{% if endpoint == request.endpoint %} class="active"{% endif %}>
								<a href="{{ url_for(endpoint) }}">
									{% if gly != '' %}
Andreas Valder's avatar
Andreas Valder committed
61
62
63
64
65
										{% 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 %}
66
67
68
69
70
71
72
73
									{{ caption }}
									{% endif %}
								</a>
							</li>
						{% endfor %}

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