diff options
| author | Romain Estievenart <res@odoo.com> | 2020-08-14 09:51:53 +0000 |
|---|---|---|
| committer | Adrien Dieudonne <adr@odoo.com> | 2020-08-25 19:32:45 +0000 |
| commit | ad386bc71e7432b0e058a7c846962c383344f6a4 (patch) | |
| tree | 4909b6a43da3c64d7fa79a9b48937619d42311fe /addons/website_event_track/views | |
| parent | 22613d71b7ebf860003f6c9499de65ecb2b75aaf (diff) | |
[IMP] website_event_track_online: PWA's custom offline page
This page will be used in case of lost connection. The web page will be
automatically fetched when you are back online.
We also use this page when it's not possible to use the cache due to a
redirection.
closes odoo/odoo#56476
X-original-commit: a7c5cadc7467bd2c2423cd3e803cad3677961521
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Diffstat (limited to 'addons/website_event_track/views')
| -rw-r--r-- | addons/website_event_track/views/event_templates.xml | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/addons/website_event_track/views/event_templates.xml b/addons/website_event_track/views/event_templates.xml index 891c374de1a..caf1b7e41c5 100644 --- a/addons/website_event_track/views/event_templates.xml +++ b/addons/website_event_track/views/event_templates.xml @@ -41,4 +41,35 @@ <meta name="theme-color" content="#875A7B"/> </template> +<template id="pwa_offline" inherit_id="website_event.index" primary="True"> + <xpath expr='//div[@id="wrap"]' position="replace"> + <div id="wrap" class="o_wevent_index"> + <div class="container"> + <div class="row"> + <div class="col-12 card-body"> + <div class="h2 mb-3">You're offline!</div> + <div class="alert alert-info text-center"> + <span class="fa-stack fa-4x"> + <i class="fa fa-wifi fa-stack-1x"></i> + <i class="fa fa-ban fa-stack-2x text-muted"></i> + </span> + <p>This page hasn't been saved for offline reading yet.<br/>Please check your network connection.</p> + <p> + <a t-att-href="url_for('/event')" class="btn btn-primary btn-block">Home page</a> + <button onclick="history.back();" class="btn btn-secondary btn-block">Previous page</button> + </p> + </div> + </div> + </div> + </div> + </div> + <script type="text/javascript"> + window.addEventListener('online', function(e) { + console.log('Go back online'); + location.reload(); + }); + </script> + </xpath> +</template> + </odoo> |
