diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/layouts/default.html.ep | 12 | ||||
-rw-r--r-- | templates/offline.html.ep | 11 |
2 files changed, 23 insertions, 0 deletions
diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index a43d9f1..4877488 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -5,6 +5,7 @@ <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" @@ -55,5 +56,16 @@ %= 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> diff --git a/templates/offline.html.ep b/templates/offline.html.ep new file mode 100644 index 0000000..85faff0 --- /dev/null +++ b/templates/offline.html.ep @@ -0,0 +1,11 @@ +<div class="row"> + <div class="col s12 center-align"> + <i class="material-icons large">sync_problem</i> + </div> +</div> +<div class="row"> + <div class="col s12 center-align"> + Server nicht erreichbar.<br/> + travelynx funktioniert nur mit Internetverbindung. + </div> +</div> |