summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-04-26 22:27:07 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-04-26 22:27:07 +0200
commit8c1888263ba1b79c86c677b8f7f665b7342b04c2 (patch)
treea54791fd4a6da3d4a8f6c9935b0f9b791fa2d4e0
parente500c2e537703f13b7af75cdc45d403314c8190f (diff)
show marker when unable to sync
-rw-r--r--public/static/js/travelynx-actions.js1
-rw-r--r--public/static/js/travelynx-actions.min.js2
l---------public/static/v8 (renamed from public/static/v6)0
-rw-r--r--templates/_checked_in.html.ep1
-rw-r--r--templates/layouts/default.html.ep2
5 files changed, 4 insertions, 2 deletions
diff --git a/public/static/js/travelynx-actions.js b/public/static/js/travelynx-actions.js
index b1e4d43..015a35d 100644
--- a/public/static/js/travelynx-actions.js
+++ b/public/static/js/travelynx-actions.js
@@ -23,6 +23,7 @@ function tvly_update() {
tvly_reg_handlers();
setTimeout(tvly_update, 15000);
}).fail(function() {
+ $('.sync-failed-marker').css('display', 'block');
setTimeout(tvly_update, 15000);
});
}
diff --git a/public/static/js/travelynx-actions.min.js b/public/static/js/travelynx-actions.min.js
index 4dafe2f..7bf9922 100644
--- a/public/static/js/travelynx-actions.min.js
+++ b/public/static/js/travelynx-actions.min.js
@@ -1 +1 @@
-function tvly_run(t,a,n){var e='<i class="material-icons">error</i>',c=$('<div class="progress"><div class="indeterminate"></div></div>');t.hide(),t.after(c),$.post("/action",a,function(a){a.success?$(location).attr("href",a.redirect_to):(M.toast({html:e+" "+a.error}),c.remove(),n&&n(),t.append(" "+e),t.show())})}function tvly_update(){$.get("/ajax/status_card.html",function(t){$(".statuscol").html(t),tvly_reg_handlers(),setTimeout(tvly_update,15e3)}).fail(function(){setTimeout(tvly_update,15e3)})}function tvly_reg_handlers(){$(".action-checkin").click(function(){var t=$(this);tvly_run(t,{action:"checkin",station:t.data("station"),train:t.data("train")})}),$(".action-checkout").click(function(){var t=$(this),a={action:"checkout",station:t.data("station"),force:t.data("force")};tvly_run(t,a,function(){t.append(" – Ohne Echtzeitdaten auschecken?"),t.data("force",!0)})}),$(".action-undo").click(function(){var t=$(this);tvly_run(t,{action:"undo",undo_id:t.data("id")})}),$(".action-cancelled-from").click(function(){var t=$(this);tvly_run(t,{action:"cancelled_from",station:t.data("station"),train:t.data("train")})}),$(".action-cancelled-to").click(function(){var t=$(this);tvly_run(t,{action:"cancelled_to",station:t.data("station"),force:!0})}),$(".action-delete").click(function(){var t=$(this),a={action:"delete",id:t.data("id"),checkin:t.data("checkin"),checkout:t.data("checkout")};really_delete=confirm("Diese Zugfahrt wirklich löschen? Der Eintrag wird sofort aus der Datenbank entfernt und kann nicht wiederhergestellt werden."),really_delete&&tvly_run(t,a)})}$(document).ready(function(){tvly_reg_handlers(),$(".statuscol .autorefresh").length&&setTimeout(tvly_update,15e3)});
+function tvly_run(t,a,e){var n='<i class="material-icons">error</i>',c=$('<div class="progress"><div class="indeterminate"></div></div>');t.hide(),t.after(c),$.post("/action",a,function(a){a.success?$(location).attr("href",a.redirect_to):(M.toast({html:n+" "+a.error}),c.remove(),e&&e(),t.append(" "+n),t.show())})}function tvly_update(){$.get("/ajax/status_card.html",function(t){$(".statuscol").html(t),tvly_reg_handlers(),setTimeout(tvly_update,15e3)}).fail(function(){$(".sync-failed-marker").css("display","block"),setTimeout(tvly_update,15e3)})}function tvly_reg_handlers(){$(".action-checkin").click(function(){var t=$(this);tvly_run(t,{action:"checkin",station:t.data("station"),train:t.data("train")})}),$(".action-checkout").click(function(){var t=$(this),a={action:"checkout",station:t.data("station"),force:t.data("force")};tvly_run(t,a,function(){t.append(" – Ohne Echtzeitdaten auschecken?"),t.data("force",!0)})}),$(".action-undo").click(function(){var t=$(this);tvly_run(t,{action:"undo",undo_id:t.data("id")})}),$(".action-cancelled-from").click(function(){var t=$(this);tvly_run(t,{action:"cancelled_from",station:t.data("station"),train:t.data("train")})}),$(".action-cancelled-to").click(function(){var t=$(this);tvly_run(t,{action:"cancelled_to",station:t.data("station"),force:!0})}),$(".action-delete").click(function(){var t=$(this),a={action:"delete",id:t.data("id"),checkin:t.data("checkin"),checkout:t.data("checkout")};really_delete=confirm("Diese Zugfahrt wirklich löschen? Der Eintrag wird sofort aus der Datenbank entfernt und kann nicht wiederhergestellt werden."),really_delete&&tvly_run(t,a)})}$(document).ready(function(){tvly_reg_handlers(),$(".statuscol .autorefresh").length&&setTimeout(tvly_update,15e3)});
diff --git a/public/static/v6 b/public/static/v8
index 945c9b4..945c9b4 120000
--- a/public/static/v6
+++ b/public/static/v8
diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep
index 6c777bc..f31d41f 100644
--- a/templates/_checked_in.html.ep
+++ b/templates/_checked_in.html.ep
@@ -1,5 +1,6 @@
<div class="card green darken-4 autorefresh">
<div class="card-content white-text">
+ <i class="material-icons small right sync-failed-marker" style="display: none;">sync_problem</i>
<span class="card-title">Eingecheckt</span>
<p>
In <b><%= $journey->{train_type} %> <%= $journey->{train_no} %></b>
diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep
index a2a5648..9dfd741 100644
--- a/templates/layouts/default.html.ep
+++ b/templates/layouts/default.html.ep
@@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="#673ab7">
- % my $av = 'v7'; # asset version
+ % my $av = 'v8'; # asset version
%= stylesheet "/static/${av}/css/materialize.min.css"
%= stylesheet "/static/${av}/css/material-icons.css"
%= stylesheet "/static/${av}/css/local.css"