From d84bfa2cfae3167e3d7c09060cc3d066850b49b7 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sat, 27 Apr 2024 14:09:09 +0200 Subject: wagenreihung: show train type and direction next to wagons --- templates/_wagon.html.ep | 11 +++++++---- templates/wagenreihung.html.ep | 40 +++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/templates/_wagon.html.ep b/templates/_wagon.html.ep index 2f5a0df..66cf6e8 100644 --- a/templates/_wagon.html.ep +++ b/templates/_wagon.html.ep @@ -44,9 +44,9 @@ % } % }
-% if (not defined $direction) { +% if (not defined $wr->direction) { % } -% elsif ($direction == 100) { +% elsif ($wr->direction == 100) { arrow_downward % } % else { @@ -57,7 +57,7 @@
% if ($exit_dir ne 'right') { -% if (my $img = wagon_image($wagon->train_subtype // $type // '?', $wagon->type, $wagon->uic_id)) { +% if (my $img = wagon_image($wagon->train_subtype // $wr->train_type // '?', $wagon->type, $wagon->uic_id)) { <%= $wagon->type %> % } % else { @@ -77,7 +77,7 @@ <%= 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) %> % } % if ($exit_dir eq 'right') { -% if (my $img = wagon_image($wagon->train_subtype // $type // '?', $wagon->type, $wagon->uic_id)) { +% if (my $img = wagon_image($wagon->train_subtype // $wr->train_type // '?', $wagon->type, $wagon->uic_id)) { <%= $wagon->type %> % } % else { @@ -85,5 +85,8 @@ %= $wagon->type % } +% } +% if ($multi and defined $wagon->group_index and (not defined $prev_gi or $wagon->group_index != $prev_gi)) { +
<%= ($wr->train_descriptions)[$wagon->group_index]{short} %> → <%= $wr->{data}{istformation}{allFahrzeuggruppe}[$wagon->group_index]{zielbetriebsstellename} %> % }
diff --git a/templates/wagenreihung.html.ep b/templates/wagenreihung.html.ep index a68590b..820a484 100644 --- a/templates/wagenreihung.html.ep +++ b/templates/wagenreihung.html.ep @@ -17,27 +17,8 @@ % }
-%= join( ' / ', map { $_->{name} } $wr->origins ) - → -%= join( ' / ', map { $_->{name} } $wr->destinations ) + <%= $wr->station->{name} %> Gleis <%= $wr->platform %>
- % if ($has_multi_dest) { -
- % for my $destination ($wr->destinations) { - Nach <%= $destination->{name} %> in Abschnitt <%= join(q{}, sort @{$destination->{sections} // []}) %>
- % } -
- % } - <%= $wr->station->{name} %> Gleis <%= $wr->platform %>
- % for my $desc ($wr->train_descriptions) { - % if ($desc->{text}) { - %= $desc->{text} - % if ($has_multi_desc and length(join(q{}, sort @{$desc->{sections}}))) { - in Abschnitt <%= join(q{}, sort @{$desc->{sections}}) %> - % } -
- % } - % }
@@ -49,10 +30,27 @@
% } % } +% my $gi; % for my $wagon ($wr->wagons) { -%= include '_wagon', direction => $wr->direction, wagon => $wagon, type => $wr->train_type, wref => $wref, exit_dir => stash('exit_dir'); +%= include '_wagon', wr => $wr, wagon => $wagon, prev_gi => $gi, multi => $has_multi_desc + $has_multi_dest, wref => $wref, exit_dir => stash('exit_dir'); +% $gi = $wagon->group_index; % }
+
+%= join( ' / ', map { $_->{name} } $wr->origins ) + → +%= join( ' / ', map { $_->{name} } $wr->destinations ) +
+ % for my $desc ($wr->train_descriptions) { + % if ($desc->{text}) { +
+ %= $desc->{text} + % if ($has_multi_desc and length(join(q{}, sort @{$desc->{sections}}))) { + in Abschnitt <%= join(q{}, sort @{$desc->{sections}}) %> + % } +
+ % } + % }