From 4b11079594080885642591f5f3c4787e5ffa1a50 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Mon, 4 Mar 2024 18:22:21 +0100 Subject: show carriage numbers (or classes) on traininfo page --- templates/_train_details.html.ep | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'templates') diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index c89a01c..ccdb70a 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -113,6 +113,27 @@ +% if (my $wr = $departure->{wr}) { +
+% my @wagons = $wr->wagons; +% my $direction = $wr->direction == 100 ? '→' : '←'; +% if ($departure->{direction}) { +% $direction = $departure->{direction} eq 'l' ? '◀' : '▶'; +% if (($departure->{direction} eq 'l' ? 0 : 100) != $wr->direction) { +% @wagons = reverse @wagons; +% } +% } + + %= $direction +% for my $wagon (@wagons) { +% if (not ($wagon->is_locomotive or $wagon->is_powercar)) { +%= $wagon->number || ($wagon->type =~ m{AB} ? '½' : $wagon->type =~ m{A} ? '1.' : $wagon->type =~ m{B} ? '2.' : '?' ) +% } +% } + %= $direction + +
+% }
% if ($departure->{trip_id}) { % if (stash('station_name')) { -- cgit v1.2.3