diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-05-25 17:10:31 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-05-25 17:11:21 +0200 |
commit | 463e293850cb26a0f22fdad46c9a6559aff33ad8 (patch) | |
tree | 83585cba7c075da5883a7b7902121e4e3c188399 | |
parent | 7844270322c4062817b0398ad2eb07a586fd5232 (diff) |
Show short wagon order in timelien view
-rwxr-xr-x | lib/Travelynx.pm | 1 | ||||
-rw-r--r-- | 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 @@ </ul> </div> % } - % if ( @{$journey->{wagongroups} // []} and not stash('from_timeline')) { - <div class="wagons" style="margin-top: 2ex;"> - Wagen:<br/> - %= include '_wagons', wagongroups => $journey->{wagongroups}; - </div> + % if ( @{$journey->{wagongroups} // []} ) { + % if (stash('from_timeline')) { + <div class="wagons" style="margin-top: 2ex;"> + % 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} %> + % } + <br/> + % } + </div> + % } + % else { + <div class="wagons" style="margin-top: 2ex;"> + Wagen:<br/> + %= include '_wagons', wagongroups => $journey->{wagongroups}; + </div> + % } % } % if (not stash('from_timeline')) { <div style="margin-top: 2ex;"> @@ -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 { |