From 463e293850cb26a0f22fdad46c9a6559aff33ad8 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 25 May 2025 17:10:31 +0200 Subject: Show short wagon order in timelien view --- lib/Travelynx.pm | 1 + templates/_public_status_card.html.ep | 29 +++++++++++++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index aa48128..521ea2c 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -1496,6 +1496,7 @@ sub startup { @{ $user_data->{wagongroups} }, { name => $group->name, + desc => $group->desc_short, description => $group->description, designation => $group->designation, to => $group->destination, diff --git a/templates/_public_status_card.html.ep b/templates/_public_status_card.html.ep index 70b9ee7..3ee56df 100644 --- a/templates/_public_status_card.html.ep +++ b/templates/_public_status_card.html.ep @@ -197,11 +197,28 @@ % } - % if ( @{$journey->{wagongroups} // []} and not stash('from_timeline')) { -
- Wagen:
- %= include '_wagons', wagongroups => $journey->{wagongroups}; -
+ % if ( @{$journey->{wagongroups} // []} ) { + % if (stash('from_timeline')) { +
+ % for my $wagongroup (@{$journey->{wagongroups}}) { + %= $wagongroup->{desc} // $wagongroup->{name} + % if ($wagongroup->{designation}) { + „<%= $wagongroup->{designation} %>“ + % } + — <%= $wagongroup->{type} // $journey->{type} %> <%= $wagongroup->{no} %> + % if ($wagongroup->{to}) { + → <%= $wagongroup->{to} %> + % } +
+ % } +
+ % } + % else { +
+ Wagen:
+ %= include '_wagons', wagongroups => $journey->{wagongroups}; +
+ % } % } % if (not stash('from_timeline')) {
@@ -213,7 +230,7 @@ % if (($station->[1] and $station->[1] == $journey->{dep_eva}) or $station->[0] eq $journey->{dep_name}) { % $within = 1; $at_startstop = 1; % } - % elsif ($journey->{arr_eva} and ($station->[1] and $station->[1] == $journey->{arr_eva}) or $station->[0] eq $journey->{arr_name}) { + % elsif ($journey->{arr_eva} and (($station->[1] and $station->[1] == $journey->{arr_eva}) or $station->[0] eq $journey->{arr_name})) { % $within = 0; $at_startstop = 1; % } % else { -- cgit v1.2.3