diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/_train_details.html.ep | 49 | ||||
-rw-r--r-- | templates/_wagon.html.ep | 22 | ||||
-rw-r--r-- | templates/exception.html.ep | 2 | ||||
-rw-r--r-- | templates/layouts/app.html.ep | 2 | ||||
-rw-r--r-- | templates/layouts/legacy.html.ep | 2 | ||||
-rw-r--r-- | templates/wagenreihung.html.ep | 52 |
6 files changed, 65 insertions, 64 deletions
diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index 709a1ac..f560950 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -68,10 +68,10 @@ % else { % my $left = ''; % my $right = ''; -% if ($departure->{direction} and $departure->{direction} eq 'l') { +% if ($departure->{wr_direction} and $departure->{wr_direction} eq 'l') { % $left = '◀ '; % } -% elsif ($departure->{direction} and $departure->{direction} eq 'r') { +% elsif ($departure->{wr_direction} and $departure->{wr_direction} eq 'r') { % $right = ' ▶'; % } % if ($departure->{scheduled_platform} and $departure->{platform} @@ -118,32 +118,27 @@ </div> <!-- dataline --> % if (my $wr = $departure->{wr}) { <div class="wagonorder-preview"> -% my @wagons = $wr->wagons; -% my $direction = $wr->direction ? $wr->direction == 100 ? '→' : '←' : q{}; -% if ($departure->{direction}) { -% $direction = $departure->{direction} eq 'l' ? '◀' : '▶'; -% if (($departure->{direction} eq 'l' ? 0 : 100) != $wr->direction) { -% @wagons = reverse @wagons; -% } +% my $left = defined $wr->direction ? $wr->direction == 100 ? q{} : '←' : q{}; +% my $right = defined $wr->direction ? $wr->direction == 100 ? '→' : q{} : q{}; +% if ($departure->{wr_direction} and $departure->{wr_direction} eq 'l') { +% $left = '◀'; +% $right = q{}; % } - <a href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>?e=<%= $departure->{direction} // '' %>"> - %= $direction -% my $gi; -% for my $wagon (@wagons) { -% if (not ($wagon->is_locomotive or $wagon->is_powercar)) { -% if (defined $gi and $gi != $wagon->group_index) { - • -% } -% if ($wagon->is_closed) { - X -% } -% else { -%= $wagon->number || ($wagon->type =~ m{AB} ? '½' : $wagon->type =~ m{A} ? '1.' : $wagon->type =~ m{B} ? '2.' : $wagon->type ) -% } -% } -% $gi = $wagon->group_index; +% elsif ($departure->{wr_direction} and $departure->{wr_direction} eq 'r') { +% $left = q{}; +% $right = '▶'; % } - %= $direction + <a href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>?e=<%= $departure->{wr_direction} // '' %>"> + %= $left + % for my $entry ((defined $departure->{wr_direction_num} and $departure->{wr_direction_num} != $wr->direction) ? reverse @{$departure->{wr_preview} // []} : @{$departure->{wr_preview} // []}) { + % if ($entry->[1]) { + <span class="<%= $entry->[1] %>"><%= $entry->[0] %></span> + % } + % else { + %= $entry->[0] + % } + % } + %= $right </a> </div> % } @@ -157,7 +152,7 @@ % } % } % if ($departure->{wr_link}) { - <a class="smallbutton" href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>?e=<%= $departure->{direction} // '' %>"><i class="material-icons" aria-hidden="true">train</i> <%= $departure->{wr_text} || 'Wagen' %> + <a class="smallbutton" href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>?e=<%= $departure->{wr_direction} // '' %>"><i class="material-icons" aria-hidden="true">train</i> <%= $departure->{wr_text} || 'Wagen' %> </a> % } % if ($departure->{train_type} and $departure->{train_no}) { diff --git a/templates/_wagon.html.ep b/templates/_wagon.html.ep index 2f5a0df..59a2ca1 100644 --- a/templates/_wagon.html.ep +++ b/templates/_wagon.html.ep @@ -44,9 +44,9 @@ % } % } <div class="direction"> -% if (not defined $direction) { +% if (not defined $wr->direction) { % } -% elsif ($direction == 100) { +% elsif ($wr->direction == 100) { <i class="material-icons">arrow_downward</i> % } % else { @@ -57,7 +57,7 @@ <div class="details" style=" top: <%= $wagon->{position}{start_percent} %>%; bottom: <%= 100 - $wagon->{position}{end_percent} %>%;"> % 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)) { <a class="type" href="/w/<%= $img %>?n=<%= $wagon->number // '' %>&s=<%= $wagon->section %>&r=<%= $wref %>"><%= $wagon->type %></a> % } % else { @@ -77,7 +77,7 @@ <span class="uicexchange"><%= substr($uic_id, 0, 2) %></span><span class="uiccountry"><%= substr($uic_id, 2, 2) %></span><span class="uic56"><%= substr($uic_id, 4, 2) %></span><span class="uic78"><%= substr($uic_id, 6, 2) %></span><span class="uicno"><%= substr($uic_id, 8, 3) %></span><span class="uiccheck"><%= substr($uic_id, 11) %></span> % } % 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)) { <a class="type" href="/w/<%= $img %>?n=<%= $wagon->number // '' %>&s=<%= $wagon->section %>&r=<%= $wref %>"><%= $wagon->type %></a> % } % else { @@ -86,4 +86,18 @@ </span> % } % } +% if ($multi and $first) { + <br/> + <span class="groupno"> +% 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} %> +% } + </span> + % if ($multi and ($wr->groups)[$wagon->group_index]->desc_short) { + <span class="grouptype"><%= ($wr->groups)[$wagon->group_index]->desc_short %></span> +% } +% } </div> diff --git a/templates/exception.html.ep b/templates/exception.html.ep index 65ec7ff..7654c0b 100644 --- a/templates/exception.html.ep +++ b/templates/exception.html.ep @@ -5,7 +5,7 @@ Beim Bearbeiten der Anfrage ist ein Fehler aufgetreten.<br/> <pre> ----------[Debug start]---------- % if ($exception) { -%= $exception->message +%= ref($exception) ? $exception->message : $exception Stash: %= dumper $snapshot % } diff --git a/templates/layouts/app.html.ep b/templates/layouts/app.html.ep index 1578298..9c39019 100644 --- a/templates/layouts/app.html.ep +++ b/templates/layouts/app.html.ep @@ -18,7 +18,7 @@ <meta http-equiv="refresh" content="<%= $self->stash('refresh_interval') %>"/> % } - % my $av = 'v96'; # asset version + % my $av = 'v99'; # asset version % if (session('theme') and session('theme') eq 'dark' or param('dark')) { %= stylesheet "/static/${av}/css/dark.min.css", id => 'theme' % } diff --git a/templates/layouts/legacy.html.ep b/templates/layouts/legacy.html.ep index 43a3cc5..5389c4b 100644 --- a/templates/layouts/legacy.html.ep +++ b/templates/layouts/legacy.html.ep @@ -17,7 +17,7 @@ <meta http-equiv="refresh" content="<%= $self->stash('refresh_interval') %>"/> % } - % my $av = 'v96'; # asset version + % my $av = 'v99'; # asset version %= stylesheet "/static/${av}/css/legacy.css" %= stylesheet "/static/${av}/css/material-icons.css" %= stylesheet "/static/${av}/css/jquery-ui.min.css" diff --git a/templates/wagenreihung.html.ep b/templates/wagenreihung.html.ep index 493d9c6..6781dca 100644 --- a/templates/wagenreihung.html.ep +++ b/templates/wagenreihung.html.ep @@ -7,37 +7,10 @@ </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;"> -%= join( ' / ', $wr->origins ) - → -%= join( ' / ', map { $_->{name} } $wr->destinations ) + <%= $wr->station->{name} %> Gleis <%= $wr->platform %><br/> </div> - % if ($has_multi_dest) { - <div style="text-align: center;"> - % for my $destination ($wr->destinations) { - Nach <%= $destination->{name} %> in Abschnitt <%= join(q{}, sort @{$destination->{sections} // []}) %><br/> - % } - </div> - % } - <%= $wr->station_name %> Gleis <%= $wr->platform %><br/> - % 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}}) %> - % } - <br/> - % } - % } </div> <div class="container"> <div class="wagonorder exit-<%= stash('exit_dir') // 'unknown'%>"> @@ -49,10 +22,29 @@ </div> % } % } -% for my $wagon ($wr->wagons) { -%= include '_wagon', direction => $wr->direction, wagon => $wagon, type => $wr->train_type, wref => $wref, exit_dir => stash('exit_dir'); +% 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;"> +%= join( ' / ', map { $_->{name} } $wr->origins ) + → +%= join( ' / ', map { $_->{name} } $wr->destinations ) + </div> + % for my $group ($wr->groups) { + % if ($group->description) { + <div style="text-align: center;"> + %= $group->description + % if (scalar $wr->groups > 1 and $group->has_sections) { + in Abschnitt <%= join(q{}, sort $group->sections) %> + % } + </div> + % } + % } <!-- <div> Legende: ♿ Behindertengerechte Ausstattung / 🍴 Bistro/Restaurant / 🚪 Abteile vorhanden </div> |