summaryrefslogtreecommitdiff
path: root/templates/app.html.ep
diff options
context:
space:
mode:
Diffstat (limited to 'templates/app.html.ep')
-rw-r--r--templates/app.html.ep49
1 files changed, 29 insertions, 20 deletions
diff --git a/templates/app.html.ep b/templates/app.html.ep
index 07c78bf..50f8a5a 100644
--- a/templates/app.html.ep
+++ b/templates/app.html.ep
@@ -30,6 +30,9 @@
% $route_str .= $stop . ($via_cur < $via_max ? ' - ' : q{});
% }
<li
+% if (param('hafas')) {
+ data-jid="<%= $departure->{journey_id} =~ s{#}{%23}gr %>"
+% }
data-train="<%= ($departure->{train_type} // q{}) %> <%= ($departure->{train_no} // $departure->{train} // q{}) %>"
data-line="<%= $departure->{train_type} %> <%= $departure->{train_line} // $departure->{train_no} %>"
data-no="<%= $departure->{train_line} ? $departure->{train_no} : q{} %>"
@@ -40,7 +43,7 @@
data-platform="<%= $departure->{scheduled_platform} // $departure->{platform} // '' %>"
data-arrival="<%= $departure->{sched_arrival} // '' %>"
data-departure="<%= $departure->{sched_departure} // '' %>"
- data-moreinfo="<%= join(q{|}, map { ($_->[0]->isa('DateTime') ? $_->[0]->strftime('%H:%M') : $_->[0]) . ' ' . $_->[1] } @{ $departure->{moreinfo} // [] } ) %>"
+ data-moreinfo="<%= join(q{|}, map { ($_->[0]->isa('DateTime') ? $_->[0]->strftime('%H:%M') . ' ' . $_->[1] : $_->[0] . ' ' . $_->[1]{text}) } @{ $departure->{moreinfo} // [] } ) %>"
data-routeprev="<%= join(q{|}, @{ $departure->{route_pre} // [] } ) %>"
data-routenext="<%= join(q{|}, @{ $departure->{route_post} // [] } ) %>"
% if ($departure->{is_cancelled} or $departure->{departure_is_cancelled}) {
@@ -49,7 +52,12 @@
% else {
>
% }
- <a href="/z/<%= Mojo::Util::url_escape(($departure->{train_type} // q{}) . ' ' . ($departure->{train_no} // $departure->{train} // q{}) . '/' . ($departure->{station} // $station)) %>">
+% if (param('hafas')) {
+ <a href="/z/<%= Mojo::Util::url_escape($departure->{journey_id}) . '?hafas=1&highlight=' . Mojo::Util::url_escape($departure->{station} // $station) %>">
+% }
+% else {
+ <a href="/z/<%= Mojo::Util::url_escape(($departure->{train_type} // q{}) . ' ' . ($departure->{train_no} // $departure->{train} // q{})) . '/' . Mojo::Util::url_escape($departure->{station} // $station) %>">
+% }
<div class="anchor" id="<%= ($departure->{train_type} // q{x}) . ($departure->{train_no} // q{x}) %>"></div>
<div class="line <%= $departure->{linetype} %>">
% if ($departure->{train_type} and $departure->{train_no}) {
@@ -59,9 +67,6 @@
%= $departure->{train_line}
% }
% elsif ($departure->{train_no}) {
-% if (param('detailed') and $departure->{linetype} eq 'fern' and exists $ice_type->{$departure->{train_no}} and $ice_type->{$departure->{train_no}}[1]) {
- <span class="trainsubtype" aria-hidden="true"><%= $ice_type->{$departure->{train_no}}[1] %></span>
-% }
<span class="trainno"><%= $departure->{train_no} %></span>
% }
% else {
@@ -84,38 +89,40 @@
</div>
% }
% if ($departure->{sched_departure}) {
- <span class="dest" aria-label="nach <%= $departure->{destination} %>">
+ <span class="dest">
+ <span class="visually-hidden">nach</span>
%= $departure->{destination}
</span>
% }
% else {
- <span class="origin" aria-label="von <%= $departure->{origin} %>">
+ <span class="origin">
+ <span class="visually-hidden">von</span>
%= $departure->{origin}
</span>
% }
<span class="time <%= ($show_realtime and $departure->{delay} and not
$departure->{is_cancelled}) ? 'delayed' : q{} %>">
% if ($departure->{delay} and not $departure->{is_cancelled}) {
-% my $aria_delay = sprintf("Verspätung %d Minuten", $departure->{delay});
% if ($show_realtime) {
-% if ($departure->{delay} > 0) {
- <span class="delaynorm" aria-label="<%= $aria_delay %>">(+<%= $departure->{delay} %>)</span>
+% if ($departure->{delay} > ($hide_low_delay ? 4 : 0)) {
+ <span class="delaynorm" aria-hidden="true">+<%= $departure->{delay} %> ⇒</span>
% }
-% else {
- <span class="undelaynorm" aria-label="<%= $aria_delay %>">(<%= $departure->{delay} %>)</span>
+% elsif ($departure->{delay} < 0) {
+ <span class="undelaynorm" aria-hidden="true"><%= $departure->{delay} %> ⇒</span>
% }
% }
% else {
-% if ($departure->{delay} > 0) {
- <span class="delay" aria-label="<%= $aria_delay %>">(+<%= $departure->{delay} %>)</span>
+% if ($departure->{delay} > ($hide_low_delay ? 4 : 0)) {
+ <span class="delay" aria-hidden="true">+<%= $departure->{delay} %></span>
% }
-% else {
- <span class="undelay" aria-label="<%= $aria_delay %>">(<%= $departure->{delay} %>)</span>
+% elsif ($departure->{delay} < 0) {
+ <span class="undelay" aria-hidden="true"><%= $departure->{delay} %></span>
% }
% }
% }
% elsif ($departure->{missing_realtime}) {
- <span class="no-realtime" aria-label="Echtzeitdaten fehlen"><i class="material-icons" aria-hidden="true">gps_off</i></span>
+ <span class="visually-hidden">Echtzeitdaten fehlen</span>
+ <span class="no-realtime" aria-hidden="true"><i class="material-icons">gps_off</i></span>
% }
% if (param('detailed')) {
% my $arrow = '→';
@@ -139,11 +146,12 @@
% if (($departure->{scheduled_platform} and $departure->{platform} and
% $departure->{scheduled_platform} ne $departure->{platform})
% or $departure->{changed_platform}) {
- <span class="platform changed-platform" aria-label="Gleis <%= $departure->{platform} %>">
+ <span class="platform changed-platform">
% }
% else {
- <span class="platform" aria-label="Gleis <%= $departure->{platform} %>">
+ <span class="platform">
% }
+ <span class="visually-hidden">Gleis</span>
%= $departure->{platform}
</span>
% if ($departure->{info} and length $departure->{info}) {
@@ -152,7 +160,8 @@
</span>
% }
% else {
- <span class="route" aria-label="Über <%= $route_str %>">
+ <span class="route">
+ <span class="visually-hidden">über</span>
%= $route_str
</span>
% }