summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-04-03 14:28:01 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-04-03 14:28:01 +0200
commit1893167d1a4403dda6ed07870fa6c83263099946 (patch)
tree75317942a21186f0232f1a26ba03b385cbfec4a3
parent5d2c4699abd7cd0e8054f6a93dc487b2983dd1f6 (diff)
train details: show real-time data first
-rw-r--r--sass/app.scss8
-rw-r--r--templates/_train_details.html.ep11
2 files changed, 14 insertions, 5 deletions
diff --git a/sass/app.scss b/sass/app.scss
index d8052f1..4d8dd0c 100644
--- a/sass/app.scss
+++ b/sass/app.scss
@@ -618,6 +618,14 @@ div.app {
list-style-type: circle;
}
+ .sched-delayed:before {
+ content: "(";
+ }
+
+ .sched-delayed:after {
+ content: ")";
+ }
+
i.material-icons {
font-size: 14px;
}
diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep
index 5c58e63..9d7241f 100644
--- a/templates/_train_details.html.ep
+++ b/templates/_train_details.html.ep
@@ -252,7 +252,7 @@
generic-stop
% }
% if (($stop->{rt_dep} and $stop->{dep_delay}) or (not $stop->{rt_dep} and $stop->{rt_arr} and $stop->{arr_delay})) {
- "><%= ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') %> (heute <%= ($stop->{rt_dep} // $stop->{rt_arr})->strftime('%H:%M') %>)
+ "><%= ($stop->{rt_dep} // $stop->{rt_arr})->strftime('%H:%M') %> <span class="sched-delayed"><%= ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') %></span>
% }
% else {
"><%= ($stop->{sched_dep} // $stop->{sched_arr}) ? ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') : q{} %>
@@ -269,12 +269,13 @@
</li>
% }
% if (stash('station_name')) {
- <li class="<%= $departure->{is_cancelled} ? 'cancelled-stop' : q{} %> <%= $departure->{isPast} ? 'past-stop' : 'future-stop' %>"><%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %>
+ <li class="<%= $departure->{is_cancelled} ? 'cancelled-stop' : q{} %> <%= $departure->{isPast} ? 'past-stop' : 'future-stop' %>">
+%= $departure->{departure} // $departure->{arrival} // $departure->{sched_departure} // $departure->{sched_arrival} // q{}
% if ($departure->{departure} and $departure->{sched_departure} and $departure->{departure} ne $departure->{sched_departure}) {
- (heute <%= $departure->{departure} %>)
+ <span class="sched-delayed"><%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %></span>
% }
% elsif ($departure->{arrival} and $departure->{sched_arrival} and $departure->{arrival} ne $departure->{sched_arrival}) {
- (heute <%= $departure->{arrival} %>)
+ <span class="sched-delayed"><%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %></span>
% }
% if ($departure->{missing_realtime} or $departure->{no_realtime_yet}) {
<i class="material-icons" aria-label="Echtzeitdaten fehlen">gps_off</i>
@@ -303,7 +304,7 @@
generic-stop
% }
% if (($stop->{rt_arr} and $stop->{arr_delay}) or (not $stop->{rt_arr} and $stop->{rt_dep} and $stop->{dep_delay})) {
- "><%= ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') %> (heute <%= ($stop->{rt_arr} // $stop->{rt_dep})->strftime('%H:%M') %>)
+ "><%= ($stop->{rt_arr} // $stop->{rt_dep})->strftime('%H:%M') %> <span class="sched-delayed"><%= ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') %></span>
% }
% else {
"><%= ($stop->{sched_arr} // $stop->{sched_dep}) ? ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') : q{} %>