From d4a8507f859342898a5ca215a5700d7d74cb0b9d Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Tue, 13 Aug 2024 19:36:12 +0200 Subject: carriage formation preview: fix direction when platform data is available --- templates/_checked_in.html.ep | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep index 843caf3..249997a 100644 --- a/templates/_checked_in.html.ep +++ b/templates/_checked_in.html.ep @@ -70,17 +70,19 @@
% my $direction = $wr->direction == 100 ? '→' : '←'; + % my $rev = 0; % if ($journey->{dep_direction}) { % $direction = $journey->{dep_direction} eq 'l' ? '◀' : '▶'; + % $rev = (($journey->{dep_direction} eq 'l' ? 0 : 100) == $wr->direction) ? 0 : 1; % } %= $direction % my $had_entry = 0; - % for my $group ($wr->groups) { + % for my $group ($rev ? reverse $wr->groups : $wr->groups) { % if ($had_entry) { % $had_entry = 0; • % } - % for my $wagon ($group->carriages) { + % for my $wagon ($rev ? reverse $group->carriages : $group->carriages) { % if (not ($wagon->is_locomotive or $wagon->is_powercar)) { % $had_entry = 1; % if ($wagon->is_closed) { -- cgit v1.2.3