summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-05-03 20:43:46 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-05-03 20:43:46 +0200
commit709919a9624ed4336e9e5ae382e29cd34c795a82 (patch)
tree5562aa8a08048666c162db008db9b69dc554d4c6 /templates
parent9f3b80a859a8e54856dd283b635a4abfe377feb9 (diff)
Experimental PWA support (#13)
Diffstat (limited to 'templates')
-rw-r--r--templates/layouts/default.html.ep12
-rw-r--r--templates/offline.html.ep11
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>