From ce794a272fad0bc272a3e54f73a37508eac2554f Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 23 May 2025 19:36:17 +0200 Subject: show load at next stop in timeline / status card, if available --- templates/_checked_in.html.ep | 16 ++----------- templates/_public_status_card.html.ep | 43 +++++++++++++++++++++++++++-------- templates/_show_load_icons.html.ep | 7 ++++++ 3 files changed, 42 insertions(+), 24 deletions(-) create mode 100644 templates/_show_load_icons.html.ep diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep index e3c6e33..3fd226b 100644 --- a/templates/_checked_in.html.ep +++ b/templates/_checked_in.html.ep @@ -242,13 +242,7 @@ <%= $station->[0] %> - % if ($station->[2]{load}{SECOND}) { - % my ($first, $second) = load_icon($station->[2]{load}); - % if ($first ne 'help_outline') { - - % } - - % } + %= include '_show_load_icons', station => $station % if ($station->[2]{isCancelled}) { entfällt % } @@ -389,13 +383,7 @@ <%= $station->[0] %> - % if ($station->[2]{load}{SECOND}) { - % my ($first, $second) = load_icon($station->[2]{load}); - % if ($first ne 'help_outline') { - - % } - - % } + %= include '_show_load_icons', station => $station % if ($station->[2]{isCancelled}) { entfällt % } diff --git a/templates/_public_status_card.html.ep b/templates/_public_status_card.html.ep index c646158..11ef85b 100644 --- a/templates/_public_status_card.html.ep +++ b/templates/_public_status_card.html.ep @@ -95,20 +95,31 @@ % last; % } % if (($station->[2]{arr_countdown} // 0) > 0 and $station->[2]{arr}) { - <%= $station->[0] %>
<%= $station->[2]{arr}->strftime('%H:%M') %> + %= $station->[0] +
+ %= $station->[2]{arr}->strftime('%H:%M') % if ($station->[2]{arr_delay}) { - %= sprintf('(%+d)', $station->[2]{arr_delay} / 60); + %= sprintf('(%+d)', $station->[2]{arr_delay} / 60) + % } + % if ($station->[2]{load}{SECOND}) { +
+ %= include '_show_load_icons', station => $station % } % last; % } % if (($station->[2]{dep_countdown} // 0) > 0 and $station->[2]{dep}) { - <%= $station->[0] %>
+ %= $station->[0] +
% if ($station->[2]{arr}) { <%= $station->[2]{arr}->strftime('%H:%M') %> → % } %= $station->[2]{dep}->strftime('%H:%M') % if ($station->[2]{dep_delay}) { - %= sprintf('(%+d)', $station->[2]{dep_delay} / 60); + %= sprintf('(%+d)', $station->[2]{dep_delay} / 60) + % } + % if ($station->[2]{load}{SECOND}) { +
+ %= include '_show_load_icons', station => $station % } % last; % } @@ -123,19 +134,31 @@ % } % if (($station->[2]{arr_countdown} // 0) > 0 and $station->[2]{arr}) { Nächster Halt:
- <%= $station->[0] %>
<%= $station->[2]{arr}->strftime('%H:%M') %> + %= $station->[0] +
+ %= $station->[2]{arr}->strftime('%H:%M') % if ($station->[2]{arr_delay}) { - %= sprintf('(%+d)', $station->[2]{arr_delay} / 60); + %= sprintf('(%+d)', $station->[2]{arr_delay} / 60) + % } + % if ($station->[2]{load}{SECOND}) { +
+ %= include '_show_load_icons', station => $station % } % last; % } % if (($station->[2]{dep_countdown} // 0) > 0 and $station->[2]{arr} and $station->[2]{dep}) { Aktueller Halt:
- <%= $station->[0] %>
- <%= $station->[2]{arr}->strftime('%H:%M') %> → - <%= $station->[2]{dep}->strftime('%H:%M') %> + %= $station->[0] +
+ %= $station->[2]{arr}->strftime('%H:%M') + → + %= $station->[2]{dep}->strftime('%H:%M') % if ($station->[2]{dep_delay}) { - %= sprintf('(%+d)', $station->[2]{dep_delay} / 60); + %= sprintf('(%+d)', $station->[2]{dep_delay} / 60) + % } + % if ($station->[2]{load}{SECOND}) { +
+ %= include '_show_load_icons', station => $station % } % last; % } diff --git a/templates/_show_load_icons.html.ep b/templates/_show_load_icons.html.ep new file mode 100644 index 0000000..e69dab5 --- /dev/null +++ b/templates/_show_load_icons.html.ep @@ -0,0 +1,7 @@ +% if ($station->[2]{load}{SECOND}) { + % my ($first, $second) = load_icon($station->[2]{load}); + % if ($first ne 'help_outline') { + + % } + +% } -- cgit v1.2.3