summaryrefslogtreecommitdiff
path: root/templates/wagenreihung.html.ep
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-04-29 19:10:40 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-04-29 19:10:40 +0200
commitf0d831ebbb2d45b10b64f2456643d81b9af1ae06 (patch)
tree7cf433367290c107e408af82c689705675df8b59 /templates/wagenreihung.html.ep
parentee546af265f3571e2d2fc179b42cbe887e7eca14 (diff)
replace DBWagenreihung group_index hack with new group accessor
Diffstat (limited to 'templates/wagenreihung.html.ep')
-rw-r--r--templates/wagenreihung.html.ep28
1 files changed, 11 insertions, 17 deletions
diff --git a/templates/wagenreihung.html.ep b/templates/wagenreihung.html.ep
index cd4d611..6781dca 100644
--- a/templates/wagenreihung.html.ep
+++ b/templates/wagenreihung.html.ep
@@ -7,14 +7,6 @@
</div>
% }
% else {
- % my $has_multi_dest = 0;
- % my $has_multi_desc = 0;
- % if (scalar $wr->destinations > 1) {
- % $has_multi_dest = 1;
- % }
- % if (scalar $wr->train_descriptions > 1) {
- % $has_multi_desc = 1;
- % }
<div class="container">
<div style="text-align: center;">
<%= $wr->station->{name} %> Gleis <%= $wr->platform %><br/>
@@ -30,10 +22,12 @@
</div>
% }
% }
-% my $gi;
-% for my $wagon ($wr->wagons) {
-%= 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;
+% for my $group ($wr->groups) {
+% my $first = 1;
+% for my $wagon ($group->wagons) {
+%= include '_wagon', wr => $wr, wagon => $wagon, first => $first, multi => (scalar $wr->destinations) - 1 + (scalar $wr->train_nos) - 1, wref => $wref, exit_dir => stash('exit_dir');
+% $first = 0;
+% }
% }
</div>
<div style="text-align: center;">
@@ -41,12 +35,12 @@
%= join( ' / ', map { $_->{name} } $wr->destinations )
</div>
- % for my $desc ($wr->train_descriptions) {
- % if ($desc->{text}) {
+ % for my $group ($wr->groups) {
+ % if ($group->description) {
<div style="text-align: center;">
- %= $desc->{text}
- % if ($has_multi_desc and length(join(q{}, sort @{$desc->{sections}}))) {
- in Abschnitt <%= join(q{}, sort @{$desc->{sections}}) %>
+ %= $group->description
+ % if (scalar $wr->groups > 1 and $group->has_sections) {
+ in Abschnitt <%= join(q{}, sort $group->sections) %>
% }
</div>
% }