summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-05-25 11:01:30 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2025-05-25 11:01:30 +0200
commit08d77279a5af8a600f2938794aa2019b59f6e3e5 (patch)
tree0c1173d97a8c037954fb3ea4f6931ba65fa9520c
parent1f43edc6947147e5137c68d8dda730059b02c9ae (diff)
status card: show complete route and expected load2.11.32
-rw-r--r--lib/Travelynx/Model/InTransit.pm2
-rw-r--r--templates/_public_status_card.html.ep55
2 files changed, 53 insertions, 4 deletions
diff --git a/lib/Travelynx/Model/InTransit.pm b/lib/Travelynx/Model/InTransit.pm
index 1ec7137..2bd3dad 100644
--- a/lib/Travelynx/Model/InTransit.pm
+++ b/lib/Travelynx/Model/InTransit.pm
@@ -392,7 +392,7 @@ sub postprocess {
= $dep_info->{rt_arr}->epoch - $epoch;
}
- for my $station (@route_after) {
+ for my $station (@route) {
if ( @{$station} > 1 ) {
# Note: $station->[2]{sched_arr} may already have been
diff --git a/templates/_public_status_card.html.ep b/templates/_public_status_card.html.ep
index 280d4dd..e8b6fbb 100644
--- a/templates/_public_status_card.html.ep
+++ b/templates/_public_status_card.html.ep
@@ -197,13 +197,62 @@
</ul>
</div>
% }
- % if ( $journey->{wagongroups} and @{$journey->{wagongroups}} and not stash('from_timeline')) {
- <div class="wagons">
+ % if ( @{$journey->{wagongroups} // []} and not stash('from_timeline')) {
+ <div class="wagons" style="margin-bottom: 2ex;">
+ Wagen:<br/>
%= include '_wagons', wagongroups => $journey->{wagongroups};
</div>
% }
+ % if (not stash('from_timeline')) {
+ <div>
+ Zuglauf:<br/>
+ % my $before = 1;
+ % my $within = 0;
+ % my $at_startstop = 0;
+ % for my $station (@{$journey->{route}}) {
+ % if (($station->[1] and $station->[1] == $journey->{dep_eva}) or $station->[0] eq $journey->{dep_name}) {
+ % $within = 1; $at_startstop = 1;
+ % }
+ % elsif (($station->[1] and $station->[1] == $journey->{arr_eva}) or $station->[0] eq $journey->{arr_name}) {
+ % $within = 0; $at_startstop = 1;
+ % }
+ % else {
+ % $at_startstop = 0;
+ % }
+ <span style="color: #808080;">
+ % if ($before and $station->[2]{sched_dep}) {
+ %= $station->[2]{sched_dep}->strftime('%H:%M')
+ % }
+ % elsif (not $before and $station->[2]{sched_arr}) {
+ %= $station->[2]{sched_arr}->strftime('%H:%M')
+ % }
+ </span>
+ % if ($at_startstop or $within) {
+ %= $station->[0]
+ % }
+ % else {
+ <span style="color: #808080;"><%= $station->[0] %></span>
+ % }
+ <span>
+ %= include '_show_load_icons', station => $station
+ </span>
+ <span style="color: #808080;">
+ % if ($before and $station->[2]{rt_dep} and $station->[2]{dep_delay}) {
+ %= sprintf('%+d', $station->[2]{dep_delay} / 60)
+ % }
+ % elsif (not $before and $station->[2]{rt_arr} and $station->[2]{arr_delay}) {
+ %= sprintf('%+d', $station->[2]{arr_delay} / 60)
+ % }
+ </span>
+ % if (($station->[1] and $station->[1] == $journey->{dep_eva}) or $station->[0] eq $journey->{dep_name}) {
+ % $before = 0;
+ % }
+ <br/>
+ % }
+ </div>
+ % }
</div>
- % if (not stash('from_timeline')) {
+ % if (0 and not stash('from_timeline')) {
<div class="card-action">
% if ($journey->{traewelling_url}) {
<a style="margin-right: 0;" href="<%= $journey->{traewelling_url} %>"><i class="material-icons left">timeline</i> Träwelling</a>