diff options
author | Daniel Friesel <derf@finalrewind.org> | 2022-10-29 15:37:57 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2022-10-29 15:37:57 +0200 |
commit | cc76d03925b18cacc91c8f0f86cc39b6f42bf3b8 (patch) | |
tree | 87b035cfc001275f4f46a55beb96073271417a5c /templates/_train_details.html.ep | |
parent | 148cf58c871ae28cfe3b2bcd806375f43f7791e7 (diff) |
train_details: handle stops without arr/dep data
Diffstat (limited to 'templates/_train_details.html.ep')
-rw-r--r-- | templates/_train_details.html.ep | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index e5d5c72..d3815fe 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -214,11 +214,11 @@ % else { generic-stop % } -% if ($stop->{rt_dep} and $stop->{dep_delay}) { - "><%= $stop->{sched_dep}->strftime('%H:%M') %> (heute <%= $stop->{rt_dep}->strftime('%H:%M') %>) <%= $stop->{name} %></a> +% 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->{name} %></a> % } % else { - "><%= $stop->{sched_dep} ? $stop->{sched_dep}->strftime('%H:%M') : q{} %> + "><%= ($stop->{sched_dep} // $stop->{sched_arr}) ? ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') : q{} %> % if ($stop->{rt_bogus}) { <i class="material-icons" aria-label="Echtzeitdaten fehlen">gps_off</i> % } @@ -259,11 +259,11 @@ % else { generic-stop % } -% if ($stop->{rt_arr} and $stop->{arr_delay}) { - "><%= $stop->{sched_arr}->strftime('%H:%M') %> (heute <%= $stop->{rt_arr}->strftime('%H:%M') %>) <%= $stop->{name} %></a> +% 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->{name} %></a> % } % else { - "><%= $stop->{sched_arr} ? $stop->{sched_arr}->strftime('%H:%M') : q{} %> + "><%= ($stop->{sched_arr} // $stop->{sched_dep}) ? ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') : q{} %> % if ($stop->{rt_bogus}) { <i class="material-icons" aria-label="Echtzeitdaten fehlen">gps_off</i> % } |