diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/_train_details.html.ep | 49 | ||||
-rw-r--r-- | templates/_wagon.html.ep | 6 | ||||
-rw-r--r-- | templates/about.html.ep | 14 | ||||
-rw-r--r-- | templates/app.html.ep | 12 | ||||
-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 | 28 |
8 files changed, 63 insertions, 52 deletions
diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index d70ef30..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 = defined $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 c19087c..59a2ca1 100644 --- a/templates/_wagon.html.ep +++ b/templates/_wagon.html.ep @@ -86,7 +86,7 @@ </span> % } % } -% if ($multi and defined $wagon->group_index and (not defined $prev_gi or $wagon->group_index != $prev_gi)) { +% if ($multi and $first) { <br/> <span class="groupno"> % if (scalar $wr->train_nos > 1) { @@ -96,8 +96,8 @@ → <%= $wr->{data}{istformation}{allFahrzeuggruppe}[$wagon->group_index]{zielbetriebsstellename} %> % } </span> - % if (scalar $wr->train_descriptions > 1 and ($wr->train_descriptions)[$wagon->group_index]{short}) { - <span class="grouptype"><%= ($wr->train_descriptions)[$wagon->group_index]{short} %></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/about.html.ep b/templates/about.html.ep index b5af92b..a68dc69 100644 --- a/templates/about.html.ep +++ b/templates/about.html.ep @@ -20,10 +20,12 @@ Diese Installation nutzt <strong>DBF v<%= stash('version') // '???' %></strong> mit folgenden Backends: <ul> - <li> Innerdeutscher Regional- und Fernverkehr: DB IRIS via <a href="https://finalrewind.org/projects/Travel-Status-DE-IRIS/">Travel::Status::DE::IRIS</a> + <li>Innerdeutscher Regional- und Fernverkehr: DB IRIS via <a href="https://finalrewind.org/projects/Travel-Status-DE-IRIS/">Travel::Status::DE::IRIS</a> <strong>v<%= $Travel::Status::DE::IRIS::VERSION %></strong></li> - <li> Außerdeutsche Fahrten, Nahverkehr, Details, Karten: HAFAS via <a href="https://finalrewind.org/projects/Travel-Status-DE-DeutscheBahn/">Travel::Status::DE::HAFAS</a> + <li>Außerdeutsche Fahrten, Nahverkehr, Details, Karten: HAFAS via <a href="https://finalrewind.org/projects/Travel-Status-DE-DeutscheBahn/">Travel::Status::DE::HAFAS</a> <strong>v<%= $Travel::Status::DE::HAFAS::VERSION %></strong></li> + <li>Nahverkehr: EFA via <a href="https://finalrewind.org/projects/Travel-Status-DE-VRR/">Travel::Status::DE::EFA</a> + <strong>v<%= $Travel::Status::DE::EFA::VERSION %></strong></li> <li>Wagenreihung: <a href="https://finalrewind.org/projects/Travel-Status-DE-DBWagenreihung/">Travel::Status::DE::DBWagenreihung</a> <strong>v<%= $Travel::Status::DE::DBWagenreihung::VERSION %></strong></li> <li>Zugauslastung Regionalverkehr: VRR EFA via <a href="https://github.com/derf/eva-to-efa-gw">eva-to-efa-gw</a></li> @@ -38,6 +40,14 @@ </ul> </p> <p> + Unterstützte EFA-Instanzen („efa=…“, unfertig/experimentell): + <ul> + % for my $service (Travel::Status::DE::EFA::get_efa_urls()) { + <li><%= $service->{shortname} %> (<%= $service->{name} %>)</li> + % } + </ul> + </p> + <p> Verwendete Open Data-Ressourcen: <ul> <li><a href="https://data.deutschebahn.com/dataset/zugbildungsplanzugbildungsplan-zpar">Zugbildungsplan</a> © DB Fernverkehr AG, lizensiert unter CC-BY 4.0</li> diff --git a/templates/app.html.ep b/templates/app.html.ep index 50f8a5a..214bee1 100644 --- a/templates/app.html.ep +++ b/templates/app.html.ep @@ -151,6 +151,18 @@ % else { <span class="platform"> % } +% if ($departure->{load}{FIRST} or $departure->{load}{SECOND}) { +% my ($text, $icon1, $icon2) = utilization_icon([$departure->{load}{FIRST}, $departure->{load}{SECOND}]); + <span class="load"> + <i class="material-icons" style="vertical-align: bottom;" aria-hidden="true"><%= $icon2 %></i> + </span> +% } +% elsif (my $o = $departure->{occupancy}) { + <span class="load"> +% my ($text, $icon) = occupancy_icon($o); + <i class="material-icons" style="vertical-align: bottom;" aria-hidden="true"><%= $icon %></i> + </span> +% } <span class="visually-hidden">Gleis</span> %= $departure->{platform} </span> 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 7471ae2..8e89e46 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 = 'v97'; # asset version + % my $av = 'v100'; # 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 d3545e0..09b94e6 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 = 'v97'; # asset version + % my $av = 'v100'; # 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 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> % } |