summaryrefslogtreecommitdiff
path: root/templates/_wagons.html.ep
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-08-08 21:13:39 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-08-08 21:13:39 +0200
commit45dc2e4e2abc8da3f7fdc795ce0863c3664280ce (patch)
tree99f15740fd81016048cb8d9f76f9bf5135a69f03 /templates/_wagons.html.ep
parent7fb0d48d808caa18cc924f1c84f53a045028203b (diff)
Switch to new carriage formation API
Diffstat (limited to 'templates/_wagons.html.ep')
-rw-r--r--templates/_wagons.html.ep12
1 files changed, 9 insertions, 3 deletions
diff --git a/templates/_wagons.html.ep b/templates/_wagons.html.ep
index 106709e..b4af3bc 100644
--- a/templates/_wagons.html.ep
+++ b/templates/_wagons.html.ep
@@ -4,10 +4,16 @@
% if ($wagon_number and my $group_name = app->ice_name->{$wagon_number}) {
„<%= $group_name %>“
% }
- als <b><%= $journey->{type} %> <%= $wagongroup->{no} %></b>
- von <b><%= $wagongroup->{from} %></b> nach <b><%= $wagongroup->{to} %></b><br/>
+ als <b><%= $wagongroup->{type} // $journey->{type} %> <%= $wagongroup->{no} %></b>
+ % if ($wagongroup->{from}) {
+ von <b><%= $wagongroup->{from} %></b>
+ % }
+ % if ($wagongroup->{to}) {
+ nach <b><%= $wagongroup->{to} %></b>
+ % }
+ <br/>
% for my $wagon (@{$wagongroup->{wagons}}) {
- % if (length($wagon->{id}) == 12) {
+ % if (length($wagon->{id}) == 12 or length($wagon->{id}) == 14) {
<span><%= substr($wagon->{id}, 0, 2) %></span><span><%= substr($wagon->{id}, 2, 2) %></span><span><%= substr($wagon->{id}, 4, 1) %></span><span class="wagonclass"><%= substr($wagon->{id}, 5, 3) %></span><span class="wagonnum"><%= substr($wagon->{id}, 8, 3) %></span><span class="checksum"><%= substr($wagon->{id}, 11) %></span>
% }
% elsif ($wagon->{id}) {