diff options
author | Daniel Friesel <derf@finalrewind.org> | 2022-11-11 19:01:24 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2022-11-11 19:01:24 +0100 |
commit | c92b6bc9492d1d2cd8147354885d0a89f0fbfdb9 (patch) | |
tree | f4c2bcee2acac3d690faff173130f8eaedc39a9f | |
parent | 91db3834aeaafabbb3e6f0949a1f4fdc8660c7aa (diff) |
status card: handle missing realtime data1.25.1
-rw-r--r-- | templates/_checked_in.html.ep | 16 | ||||
-rw-r--r-- | templates/_public_status_card.html.ep | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep index 2a6ac1d..761849d 100644 --- a/templates/_checked_in.html.ep +++ b/templates/_checked_in.html.ep @@ -124,18 +124,18 @@ % if ($station->[0] eq $journey->{arr_name}) { % last; % } - % if (($station->[1]{rt_arr_countdown} // 0) > 0) { + % if (($station->[1]{rt_arr_countdown} // 0) > 0 and $station->[1]{rt_arr}) { <%= $station->[0] %><br/><%= $station->[1]{rt_arr}->strftime('%H:%M') %> - % if ($station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { + % if ($station->[1]{sched_arr} and $station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { %= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60); % } % last; % } - % if (($station->[1]{rt_dep_countdown} // 0) > 0) { + % if (($station->[1]{rt_dep_countdown} // 0) > 0 and $station->[1]{rt_arr} and $station->[1]{rt_dep}) { <%= $station->[0] %><br/> <%= $station->[1]{rt_arr}->strftime('%H:%M') %> → <%= $station->[1]{rt_dep}->strftime('%H:%M') %> - % if ($station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { + % if ($station->[1]{sched_dep} and $station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { %= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60); % } % last; @@ -149,18 +149,18 @@ % if ($station->[0] eq $journey->{arr_name}) { % last; % } - % if (($station->[1]{rt_arr_countdown} // 0) > 0) { + % if (($station->[1]{rt_arr_countdown} // 0) > 0 and $station->[1]{rt_arr}) { <%= $station->[0] %><br/><%= $station->[1]{rt_arr}->strftime('%H:%M') %> - % if ($station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { + % if ($station->[1]{sched_arr} and $station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { %= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60); % } % last; % } - % if (($station->[1]{rt_dep_countdown} // 0) > 0) { + % if (($station->[1]{rt_dep_countdown} // 0) > 0 and $station->[1]{rt_arr} and $station->[1]{rt_dep}) { <%= $station->[0] %><br/> <%= $station->[1]{rt_arr}->strftime('%H:%M') %> → <%= $station->[1]{rt_dep}->strftime('%H:%M') %> - % if ($station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { + % if ($station->[1]{sched_dep} and $station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { %= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60); % } % last; diff --git a/templates/_public_status_card.html.ep b/templates/_public_status_card.html.ep index 494532b..acc729a 100644 --- a/templates/_public_status_card.html.ep +++ b/templates/_public_status_card.html.ep @@ -79,18 +79,18 @@ % if ($journey->{arr_name} and $station->[0] eq $journey->{arr_name}) { % last; % } - % if (($station->[1]{rt_arr_countdown} // 0) > 0) { + % if (($station->[1]{rt_arr_countdown} // 0) > 0 and $station->[1]{rt_arr}) { <%= $station->[0] %><br/><%= $station->[1]{rt_arr}->strftime('%H:%M') %> - % if ($station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { + % if ($station->[1]{sched_arr} and $station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { %= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60); % } % last; % } - % if (($station->[1]{rt_dep_countdown} // 0) > 0) { + % if (($station->[1]{rt_dep_countdown} // 0) > 0 and $station->[1]{rt_arr} and $station->[1]{rt_dep}) { <%= $station->[0] %><br/> <%= $station->[1]{rt_arr}->strftime('%H:%M') %> → <%= $station->[1]{rt_dep}->strftime('%H:%M') %> - % if ($station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { + % if ($station->[1]{sched_dep} and $station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { %= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60); % } % last; @@ -104,20 +104,20 @@ % if ($journey->{arr_name} and $station->[0] eq $journey->{arr_name}) { % last; % } - % if (($station->[1]{rt_arr_countdown} // 0) > 0) { + % if (($station->[1]{rt_arr_countdown} // 0) > 0 and $station->[1]{rt_arr}) { Nächster Halt:<br/> <%= $station->[0] %><br/><%= $station->[1]{rt_arr}->strftime('%H:%M') %> - % if ($station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { + % if ($station->[1]{sched_arr} and $station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { %= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60); % } % last; % } - % if (($station->[1]{rt_dep_countdown} // 0) > 0) { + % if (($station->[1]{rt_dep_countdown} // 0) > 0 and $station->[1]{rt_arr} and $station->[1]{rt_dep}) { Aktueller Halt:<br/> <%= $station->[0] %><br/> <%= $station->[1]{rt_arr}->strftime('%H:%M') %> → <%= $station->[1]{rt_dep}->strftime('%H:%M') %> - % if ($station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { + % if ($station->[1]{sched_dep} and $station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { %= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60); % } % last; |