From d854bdd7c4146a223e3c94aa123da8d41e5a6c84 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 28 Apr 2024 08:15:56 +0200 Subject: wagenreihung: only show trai no / direction if it has changed --- templates/_wagon.html.ep | 13 ++++++++++++- templates/wagenreihung.html.ep | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/templates/_wagon.html.ep b/templates/_wagon.html.ep index ce3789b..c19087c 100644 --- a/templates/_wagon.html.ep +++ b/templates/_wagon.html.ep @@ -87,6 +87,17 @@ % } % } % if ($multi and defined $wagon->group_index and (not defined $prev_gi or $wagon->group_index != $prev_gi)) { -
<%= $wr->train_type %> <%= ($wr->groups)[$wagon->group_index]->train_no %> → <%= $wr->{data}{istformation}{allFahrzeuggruppe}[$wagon->group_index]{zielbetriebsstellename} %> <%= ($wr->train_descriptions)[$wagon->group_index]{short} %> +
+ +% if (scalar $wr->train_nos > 1) { + <%= $wr->train_type %> <%= ($wr->groups)[$wagon->group_index]->train_no %> +% } +% if (scalar $wr->destinations > 1) { + → <%= $wr->{data}{istformation}{allFahrzeuggruppe}[$wagon->group_index]{zielbetriebsstellename} %> +% } + + % if (scalar $wr->train_descriptions > 1 and ($wr->train_descriptions)[$wagon->group_index]{short}) { + <%= ($wr->train_descriptions)[$wagon->group_index]{short} %> +% } % } diff --git a/templates/wagenreihung.html.ep b/templates/wagenreihung.html.ep index 820a484..cd4d611 100644 --- a/templates/wagenreihung.html.ep +++ b/templates/wagenreihung.html.ep @@ -32,7 +32,7 @@ % } % my $gi; % for my $wagon ($wr->wagons) { -%= include '_wagon', wr => $wr, wagon => $wagon, prev_gi => $gi, multi => $has_multi_desc + $has_multi_dest, wref => $wref, exit_dir => stash('exit_dir'); +%= include '_wagon', wr => $wr, wagon => $wagon, prev_gi => $gi, multi => $has_multi_desc + (scalar $wr->destinations) - 1 + (scalar $wr->train_nos) - 1, wref => $wref, exit_dir => stash('exit_dir'); % $gi = $wagon->group_index; % } -- cgit v1.2.3