From d08f50909c185dd5c764bfdb0f2241a405c47b31 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 29 Oct 2022 16:01:30 +0200 Subject: train details: show per-stop utilization --- sass/app.scss | 4 ++++ templates/_train_details.html.ep | 35 +++++++++++++++++++++++++---------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/sass/app.scss b/sass/app.scss index 1d4f5e9..a1f2d32 100644 --- a/sass/app.scss +++ b/sass/app.scss @@ -584,6 +584,10 @@ div.app { .future-stop { list-style-type: circle; } + + i.material-icons { + font-size: 14px; + } } .db-attr { diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index d3815fe..9a440ef 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -215,14 +215,19 @@ 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->{name} %> + "><%= ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') %> (heute <%= ($stop->{rt_dep} // $stop->{rt_arr})->strftime('%H:%M') %>) % } % else { "><%= ($stop->{sched_dep} // $stop->{sched_arr}) ? ($stop->{sched_dep} // $stop->{sched_arr})->strftime('%H:%M') : q{} %> -% if ($stop->{rt_bogus}) { - gps_off -% } - <%= $stop->{name} %> +% if ($stop->{rt_bogus}) { + gps_off +% } +% } + <%= $stop->{name} %> +% if ($stop->{load}{FIRST} or $stop->{load}{SECOND}) { +% my ($text, $icon1, $icon2) = utilization_icon([$stop->{load}{FIRST}, $stop->{load}{SECOND}]); + + % } % } @@ -242,6 +247,11 @@ gps_off % } <%= stash('station_name') %> +% if (my $u = $departure->{utilization}) { +% my ($text, $icon1, $icon2) = utilization_icon($u); + + +% } % } % for my $stop (@{$departure->{route_post_diff}}) { @@ -260,14 +270,19 @@ 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->{name} %> + "><%= ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') %> (heute <%= ($stop->{rt_arr} // $stop->{rt_dep})->strftime('%H:%M') %>) % } % else { "><%= ($stop->{sched_arr} // $stop->{sched_dep}) ? ($stop->{sched_arr} // $stop->{sched_dep})->strftime('%H:%M') : q{} %> -% if ($stop->{rt_bogus}) { - gps_off -% } - <%= $stop->{name} %> +% if ($stop->{rt_bogus}) { + gps_off +% } +% } + <%= $stop->{name} %> +% if ($stop->{load}{FIRST} or $stop->{load}{SECOND}) { +% my ($text, $icon1, $icon2) = utilization_icon([$stop->{load}{FIRST}, $stop->{load}{SECOND}]); + + % } % } -- cgit v1.2.3