summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-07-17 13:32:40 +0200
committerDaniel Friesel <derf@finalrewind.org>2022-07-17 13:32:40 +0200
commitf923c6dacf950143e34c3f69ffee8694156d8421 (patch)
treece3453975dbad672a7e503bc4b07d91cf8b78bee
parent2cccc8c913564f9baa14206e6274bd2367c0ee4a (diff)
do not lose show_realtime setting in detail views4.10.1
-rw-r--r--public/static/js/collapse.js3
-rw-r--r--templates/_train_details.html.ep4
2 files changed, 5 insertions, 2 deletions
diff --git a/public/static/js/collapse.js b/public/static/js/collapse.js
index 8aed392..95088e4 100644
--- a/public/static/js/collapse.js
+++ b/public/static/js/collapse.js
@@ -102,6 +102,9 @@ function dbf_reg_handlers() {
if (window.location.href.includes('past=1')) {
suffix += '&past=1';
}
+ if (window.location.href.includes('show_realtime=1')) {
+ suffix += '&show_realtime=1';
+ }
history.pushState({'page':'traindetail','station':station,'train':trainElem.data('no')}, 'test', '/z/' + trainElem.data('train') + '/' + trainElem.data('station') + suffix);
dbf_show_moreinfo(trainElem, false);
});
diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep
index a996128..121f46d 100644
--- a/templates/_train_details.html.ep
+++ b/templates/_train_details.html.ep
@@ -195,7 +195,7 @@
<ul class="mroute">
% for my $stop (@{$departure->{route_pre_diff}}) {
<li class="<%= $stop->{isPast} ? 'past-stop' : 'future-stop' %>">
- <a href="<%= url_for('station', station => $stop->{name})->query({detailed => param('detailed'), past => param('past')}) %>#<%= ($departure->{train_type} // q{x}) . ($departure->{train_no} // q{x}) %>" class="
+ <a href="<%= url_for('station', station => $stop->{name})->query({detailed => param('detailed'), past => param('past'), show_realtime => param('show_realtime')}) %>#<%= ($departure->{train_type} // q{x}) . ($departure->{train_no} // q{x}) %>" class="
% if ($stop->{isAdditional}) {
additional-stop
% }
@@ -240,7 +240,7 @@
% }
% for my $stop (@{$departure->{route_post_diff}}) {
<li class="<%= $stop->{isPast} ? 'past-stop' : 'future-stop' %>">
- <a href="<%= url_for('station', station => $stop->{name})->query({detailed => param('detailed'), past => param('past')}) %>#<%= ($departure->{train_type} // q{x}) . ($departure->{train_no} // q{x}) %>" class="
+ <a href="<%= url_for('station', station => $stop->{name})->query({detailed => param('detailed'), past => param('past'), show_realtime => param('show_realtime')}) %>#<%= ($departure->{train_type} // q{x}) . ($departure->{train_no} // q{x}) %>" class="
% if ($stop->{isAdditional}) {
additional-stop
% }