mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Add service worker and offline page (needed to install the webapp on mobile devices)
This commit is contained in:
41
resources/views/errors/Offline.twig
Normal file
41
resources/views/errors/Offline.twig
Normal file
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<base href="{{ route('index') }}/">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Firefly III | Offline</title>
|
||||
<!-- Tell the browser to be responsive to screen width -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="stylesheet" href="v2/plugins/local-fonts/gf-source.css" nonce="{{ JS_NONCE }}">
|
||||
<link rel="stylesheet" href="v2/css/app.css" nonce="{{ JS_NONCE }}">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="error-page">
|
||||
<h2 class="headline text-danger"><span class="fas fa-unlink"></span></h2>
|
||||
|
||||
<div class="error-content">
|
||||
<h3><span class="fas fa-exclamation-triangle text-danger"></span> Offline</h3>
|
||||
<p>
|
||||
{{ trans('errors.offline_header') }}
|
||||
</p>
|
||||
<p>
|
||||
{{ trans('errors.offline_unreachable') }}
|
||||
</p>
|
||||
<p>
|
||||
{{ trans('errors.offline_github')|raw }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -228,5 +228,17 @@
|
||||
<noscript><p><img src="//{{ config('firefly.tracker_url') }}/matomo.php?idsite={{ config('firefly.tracker_site_id') }}&rec=1" style="border:0;" alt="" /></p></noscript>
|
||||
{% endif %}
|
||||
|
||||
<script nonce="{{ JS_NONCE }}">
|
||||
// Initialize the service worker
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('serviceworker.js?v={{ FF_VERSION }}', {
|
||||
scope: '{{ route('index') }}'
|
||||
}).then(
|
||||
() => console.log('ServiceWorker registration successful'),
|
||||
(err) => console.log('ServiceWorker registration failed: ', err)
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -61,5 +61,17 @@
|
||||
<noscript><p><img src="//{{ config('firefly.tracker_url') }}/matomo.php?idsite={{ config('firefly.tracker_site_id') }}&rec=1" style="border:0;" alt="" /></p></noscript>
|
||||
{% endif %}
|
||||
|
||||
<script nonce="{{ JS_NONCE }}">
|
||||
// Initialize the service worker
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('serviceworker.js?v={{ FF_VERSION }}', {
|
||||
scope: '{{ route('index') }}'
|
||||
}).then(
|
||||
() => console.log('ServiceWorker registration successful'),
|
||||
(err) => console.log('ServiceWorker registration failed: ', err)
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -76,5 +76,17 @@
|
||||
<noscript><p><img src="//{{ config('firefly.tracker_url') }}/matomo.php?idsite={{ config('firefly.tracker_site_id') }}&rec=1" style="border:0;" alt="" /></p></noscript>
|
||||
{% endif %}
|
||||
|
||||
<script nonce="{{ JS_NONCE }}">
|
||||
// Initialize the service worker
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('serviceworker.js?v={{ FF_VERSION }}', {
|
||||
scope: '{{ route('index') }}'
|
||||
}).then(
|
||||
() => console.log('ServiceWorker registration successful'),
|
||||
(err) => console.log('ServiceWorker registration failed: ', err)
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -36,5 +36,17 @@
|
||||
</div>
|
||||
<script src="v1/js/app.js?v={{ FF_VERSION }}" type="text/javascript" nonce="{{ JS_NONCE }}"></script>
|
||||
{% block scripts %}{% endblock %}
|
||||
|
||||
<script nonce="{{ JS_NONCE }}">
|
||||
// Initialize the service worker
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('serviceworker.js?v={{ FF_VERSION }}', {
|
||||
scope: '{{ route('index') }}'
|
||||
}).then(
|
||||
() => console.log('ServiceWorker registration successful'),
|
||||
(err) => console.log('ServiceWorker registration failed: ', err)
|
||||
);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -19,5 +19,17 @@
|
||||
<body class="hold-transition login-page">
|
||||
{% block content %}{% endblock %}
|
||||
{% block scripts %}{% endblock %}
|
||||
|
||||
<script nonce="{{ JS_NONCE }}">
|
||||
// Initialize the service worker
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('serviceworker.js?v={{ FF_VERSION }}', {
|
||||
scope: '{{ route('index') }}'
|
||||
}).then(
|
||||
() => console.log('ServiceWorker registration successful'),
|
||||
(err) => console.log('ServiceWorker registration failed: ', err)
|
||||
);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -46,9 +46,11 @@
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0 text-dark">
|
||||
{% if mainTitleIcon|default(false) %}<span class="fa fas {{ mainTitleIcon }}"></span>{% endif %}
|
||||
{% if mainTitleIcon|default(false) %}<span
|
||||
class="fa fas {{ mainTitleIcon }}"></span>{% endif %}
|
||||
{{ title }} <small class="text-muted">
|
||||
{% if subTitleIcon|default(false) %}<span class="fa fas {{ subTitleIcon }}"></span>{% endif %}
|
||||
{% if subTitleIcon|default(false) %}<span
|
||||
class="fa fas {{ subTitleIcon }}"></span>{% endif %}
|
||||
{{ subTitle|default('') }}</small></h1>
|
||||
</div><!-- /.col -->
|
||||
<div class="col-sm-6">
|
||||
@@ -91,6 +93,18 @@
|
||||
<script src="v2/js/vendor.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
|
||||
{% block scripts %}{% endblock %}
|
||||
|
||||
<script nonce="{{ JS_NONCE }}">
|
||||
// Initialize the service worker
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('serviceworker.js?v={{ FF_VERSION }}', {
|
||||
scope: '{{ route('index') }}'
|
||||
}).then(
|
||||
() => console.log('ServiceWorker registration successful'),
|
||||
(err) => console.log('ServiceWorker registration failed: ', err)
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
Reference in New Issue
Block a user