From 3c85cd22395be60462959ee7d3cf59d0e939b6a3 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 14 Dec 2020 18:23:23 +0100 Subject: wagonorder: move wagon display to a separate template --- templates/_wagon.html.ep | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 templates/_wagon.html.ep (limited to 'templates/_wagon.html.ep') diff --git a/templates/_wagon.html.ep b/templates/_wagon.html.ep new file mode 100644 index 0000000..95b1c2e --- /dev/null +++ b/templates/_wagon.html.ep @@ -0,0 +1,66 @@ +% my $bg = ''; +% my $extra_class = ''; +% if ($wagon->is_first_class) { +% $extra_class .= ' firstclass'; +% } +% if ($wagon->is_locomotive or $wagon->is_powercar) { +% $extra_class .= ' powercar'; +% } +% if ($wagon->train_no ne $train_no) { +% $extra_class .= ' nondestwagon'; +% } +
+% if ($wagon->is_locomotive or $wagon->is_powercar) { +% } +% else { +%= $wagon->number // '?' +% if ($wagon->has_accessibility) { + accessible +% } +% if ($wagon->has_bistro) { + restaurant +% } +% if ($wagon->has_compartments) { + +% } +% if ($wagon->has_quiet_area) { + volume_off +% } +% if ($wagon->has_phone_area) { + smartphone +% } +% if ($wagon->has_family_area) { + people +% } +% if ($wagon->has_bahn_comfort) { + star +% } +% } +
+% if (not defined $direction) { +% } +% elsif ($direction == 100) { + arrow_downward +% } +% else { + arrow_upward +% } +
+
+
+ +%= $wagon->type + +% my $uic_id = $wagon->uic_id; +% if (length($uic_id) != 12) { + <%= $uic_id %> +% } +% elsif (substr($uic_id, 0, 2) >= 90) { + <%= substr($uic_id, 0, 2) %><%= substr($uic_id, 2, 2) %><%= substr($uic_id, 4, 1) %><%= substr($uic_id, 5, 3) %><%= substr($uic_id, 8, 3) %><%= substr($uic_id, 11) %> +% } +% else { + <%= substr($uic_id, 0, 2) %><%= substr($uic_id, 2, 2) %><%= substr($uic_id, 4, 2) %><%= substr($uic_id, 6, 2) %><%= substr($uic_id, 8, 3) %><%= substr($uic_id, 11) %> +% } +
-- cgit v1.2.3