summaryrefslogtreecommitdiff
path: root/templates/layouts/default.html.ep
blob: 4877488793dabf784d8e84661e489d08fea4cfb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!DOCTYPE html>
<html lang="de">
<head>
	<title><%= stash('title') // 'travelynx' %></title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="theme-color" content="#673ab7">
	<link rel="manifest" href="/static/manifest.json">
	% my $av = 'v10'; # asset version
	%= stylesheet "/static/${av}/css/materialize.min.css"
	%= stylesheet "/static/${av}/css/material-icons.css"
	%= stylesheet "/static/${av}/css/local.css"
	%= javascript "/static/${av}/js/jquery-2.2.4.min.js"
	%= javascript "/static/${av}/js/materialize.min.js"
	%= javascript "/static/${av}/js/travelynx-actions.min.js"
	% if (stash('with_geolocation')) {
		%= javascript "/static/${av}/js/geolocation.min.js"
	% }
	% if (stash('with_autocomplete')) {
		%= javascript "/static/${av}/js/autocomplete.min.js"
	% }
</head>
<body>

<nav class="deep-purple">
	<div class="nav-wrapper container">
		<a href="/" class="brand-logo left">travelynx</a>
		<ul id="nav-mobile" class="right">
			% if (is_user_authenticated()) {
				<li class="<%= navbar_class('/history') %>"><a href='/history' title="History"><i class="material-icons">history</i></a></li>
				<li class="<%= navbar_class('/account') %>"><a href="/account" title="Account"><i class="material-icons">account_circle</i></a></li>
			% }
			<li class="<%= navbar_class('/about') %>"><a href='/about' title="About"><i class="material-icons">info_outline</i></a></li>
		</ul>
	</div>
</nav>

% if (app->mode eq 'development') {
<div class="container">
	<div class="row">
		<div class="col s12 red darken-4 white-text">
			Development Mode – Datenbank: <%= app->config->{db}->{database} %>
			@ <%= app->config->{db}->{host} %>
		</div>
	</div>
</div>
% }

<div class="container">
	% if (is_user_authenticated()) {
		% my $acc = current_user();
		% if ($acc and $acc->{deletion_requested}) {
			%= include '_deletion_note', timestamp => $acc->{deletion_requested}
		% }
	% }
	%= content
</div>

<script>
if ('serviceWorker' in navigator) {
  window.addEventListener('load', () => {
    navigator.serviceWorker.register('/service-worker.js')
        .then((reg) => {
          console.log('Service worker registered.', reg);
        });
  });
}
</script>

</body>
</html>