summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-05-19 18:11:51 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-05-19 18:11:51 +0200
commit976acbed43591c6681e0c2344680232558a2e595 (patch)
tree2dbd234443cfa7a546af2d91e9618738a2d8f8b6
parente293bb9b1473a4ae4815c344e719b640dc5aa9ba (diff)
HAFAS, EFA backend: show expected occupancy in departure list
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm1
-rw-r--r--sass/app.scss6
-rw-r--r--templates/app.html.ep12
3 files changed, 19 insertions, 0 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm
index 4691a86..f537064 100644
--- a/lib/DBInfoscreen/Controller/Stationboard.pm
+++ b/lib/DBInfoscreen/Controller/Stationboard.pm
@@ -1925,6 +1925,7 @@ sub handle_result {
origin => $result->route_end =~ s{,\Q$city\E}{}r,
platform => $result->platform,
scheduled_platform => $result->sched_platform,
+ load => $result->load // {},
info => $info,
is_cancelled => $result->is_cancelled,
linetype => $linetype,
diff --git a/sass/app.scss b/sass/app.scss
index fb81921..347133e 100644
--- a/sass/app.scss
+++ b/sass/app.scss
@@ -382,6 +382,12 @@ div.app {
}
}
+ .load {
+ color: $fg;
+ font-weight: normal;
+ margin-right: 0.5em;
+ }
+
.platform {
background-color: transparent;
font-size: 3em;
diff --git a/templates/app.html.ep b/templates/app.html.ep
index 50f8a5a..214bee1 100644
--- a/templates/app.html.ep
+++ b/templates/app.html.ep
@@ -151,6 +151,18 @@
% else {
<span class="platform">
% }
+% if ($departure->{load}{FIRST} or $departure->{load}{SECOND}) {
+% my ($text, $icon1, $icon2) = utilization_icon([$departure->{load}{FIRST}, $departure->{load}{SECOND}]);
+ <span class="load">
+ <i class="material-icons" style="vertical-align: bottom;" aria-hidden="true"><%= $icon2 %></i>
+ </span>
+% }
+% elsif (my $o = $departure->{occupancy}) {
+ <span class="load">
+% my ($text, $icon) = occupancy_icon($o);
+ <i class="material-icons" style="vertical-align: bottom;" aria-hidden="true"><%= $icon %></i>
+ </span>
+% }
<span class="visually-hidden">Gleis</span>
%= $departure->{platform}
</span>