From c74b91b09f8888b5d4a35b7b2cb49d313db342d9 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Tue, 30 Jul 2024 15:14:24 +0200 Subject: Switch to new bahn.de carriage formation API (WiP) --- templates/wagenreihung.html.ep | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'templates/wagenreihung.html.ep') diff --git a/templates/wagenreihung.html.ep b/templates/wagenreihung.html.ep index 6781dca..0af66bd 100644 --- a/templates/wagenreihung.html.ep +++ b/templates/wagenreihung.html.ep @@ -9,42 +9,39 @@ % else {
- <%= $wr->station->{name} %> Gleis <%= $wr->platform %>
+ Gleis <%= $wr->platform %>
-% if (not $wr->has_bad_wagons) { -% for my $section ($wr->sections) { -
-%= $section->{name} -
-% } +% for my $sector ($wr->sectors) { +
+%= $sector->name +
% } % 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'); +% for my $wagon ($group->carriages) { +%= include '_wagon', wr => $wr, group => $group, wagon => $wagon, first => $first, multi => (scalar $wr->destinations) - 1 + (scalar $wr->train_numbers) - 1, wref => $wref, exit_dir => stash('exit_dir'), train_no => param('number'); % $first = 0; % } % }
-
-%= join( ' / ', map { $_->{name} } $wr->origins ) - → -%= join( ' / ', map { $_->{name} } $wr->destinations ) -
% for my $group ($wr->groups) { % if ($group->description) {
%= $group->description - % if (scalar $wr->groups > 1 and $group->has_sections) { - in Abschnitt <%= join(q{}, sort $group->sections) %> + % if (scalar $wr->groups > 1 and $group->has_sectors) { + in Abschnitt <%= join(q{}, sort $group->sectors) %> % }
% } % } +
+ nach +%= join( ' / ', map { $_->{name} } $wr->destinations ) +