summaryrefslogtreecommitdiff
path: root/templates/_checked_in.html.ep
diff options
context:
space:
mode:
Diffstat (limited to 'templates/_checked_in.html.ep')
-rw-r--r--templates/_checked_in.html.ep173
1 files changed, 84 insertions, 89 deletions
diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep
index 797ff57..69754e3 100644
--- a/templates/_checked_in.html.ep
+++ b/templates/_checked_in.html.ep
@@ -4,7 +4,7 @@
<div class="card-content">
<i class="material-icons right sync-failed-marker grey-text" style="display: none;">sync_problem</i>
% if (not $journey->{arr_name}) {
- <span class="card-title center-align">Ziel wählen</span>
+ <span class="card-title center-align"><%= L('status.select-destination') %></span>
% }
<span class="card-title center-align">
%= include '_format_train', journey => $journey
@@ -19,26 +19,26 @@
data-dest="<%= $journey->{arr_name} %>"
>
% if ($journey->{boarding_countdown} > 60) {
- Einfahrt in <%= journeys->min_to_human(int($journey->{boarding_countdown} / 60)) %><br/>
+ <%= L('status.boarding-in.pre') %> <%= journeys->min_to_human(int($journey->{boarding_countdown} / 60)) %> <%= L('status.boarding-in.post') %><br/>
% }
% elsif ($journey->{boarding_countdown} > 0) {
- Fährt ein<br/>
+ <%= L('status.boarding-soon') %><br/>
% }
% if ($journey->{departure_countdown} > 60) {
- Abfahrt in <%= journeys->min_to_human(int($journey->{departure_countdown} / 60)) %>
+ <%= L('status.departure-in.pre') %> <%= journeys->min_to_human(int($journey->{departure_countdown} / 60)) %> <%= L('status.departure-in.post') %>
% }
% elsif ($journey->{departure_countdown} > 0) {
- Abfahrt in weniger als einer Minute
+ %= L('status.departure-soon')
% }
% elsif (defined $journey->{arrival_countdown}) {
% if ($journey->{arrival_countdown} > 60) {
- Ankunft in <%= journeys->min_to_human(int($journey->{arrival_countdown} / 60)) %>
+ <%= L('status.arrival-in.pre') %> <%= journeys->min_to_human(int($journey->{arrival_countdown} / 60)) %> <%= L('status.arrival-in.post') %>
% }
% elsif ($journey->{arrival_countdown} > 0) {
- Ankunft in weniger als einer Minute
+ %= L('status.arrival-soon')
% }
% else {
- Ziel erreicht
+ %= L('status.arrived')
% }
% if ($journey->{arrival_countdown} < (60 * 15) and $journey->{arr_platform}) {
% if ($journey->{arr_direction} and $journey->{arr_direction} eq 'r') {
@@ -48,7 +48,7 @@
<br/>◀ <%= $journey->{platform_type} %> <%= $journey->{arr_platform} %>
% }
% else {
- <br/>auf <%= $journey->{platform_type} %> <%= $journey->{arr_platform} %>
+ <br/><%= L('status.arrive-on.pre') %> <%= $journey->{platform_type} %> <%= $journey->{arr_platform} %> <%= L('status.arrive-on.post') %>
% }
% }
% }
@@ -63,12 +63,12 @@
<br/>◀ <%= $journey->{platform_type} %> <%= $journey->{dep_platform} %>
% }
% else {
- <br/>von <%= $journey->{platform_type} %> <%= $journey->{dep_platform} %>
+ <br/><%= L('status.depart-from.pre') %> <%= $journey->{platform_type} %> <%= $journey->{dep_platform} %> <%= L('status.depart-from.post') %>
% }
% }
% if (my $wr = $journey->{wagonorder}) {
<br/>
- <!-- <a href="https://dbf.finalrewind.org/carriage-formation?<%= $journey->{train_no} %>/<%= $journey->{sched_departure}->strftime('%Y%m%d%H%M') %>?e=<%= $journey->{dep_direction} // q{} %>"> -->
+ <a href="https://dbf.finalrewind.org/carriage-formation?<%= join('&', map { $_ . '=' . $journey->{extra_data}{wagonorder_param}{$_} } sort keys %{$journey->{extra_data}{wagonorder_param}}) %>&amp;e=<%= $journey->{dep_direction} // q{} %>">
% my $direction = $wr->direction == 100 ? '→' : '←';
% my $rev = 0;
% if ($journey->{dep_direction}) {
@@ -111,7 +111,7 @@
% }
% }
%= $direction
- <!-- </a> -->
+ </a>
% }
</div>
<div class="progress" style="height: 1ex;">
@@ -128,7 +128,7 @@
% }
</div>
<div style="float: right; text-align: right;">
- <b><a href="<%= resolve_sb_template($user->{sb_template}, name => $journey->{arr_name}, eva => $journey->{arr_eva}, tt => $journey->{train_type} // q{x}, tn => $journey->{train_no}, id => $journey->{train_id}, hafas => $journey->{is_hafas} ? $journey->{backend_name} : q{}) %>" class="unmarked"><%= $journey->{arr_name} %></a></b><br/>
+ <b><a href="<%= resolve_sb_template($user->{sb_template}, name => $journey->{arr_name}, eva => $journey->{arr_eva}, tt => $journey->{train_type} // q{x}, tn => $journey->{train_no}, id => $journey->{train_id} =~ s{[ #|]}{x}gr, dbris => $journey->{is_dbris} ? $journey->{backend_name} : q{}, efa => $journey->{is_efa} ? $journey->{backend_name} : q{}, hafas => $journey->{is_hafas} ? $journey->{backend_name} : q{}, is_iris => $journey->{is_iris}, motis => $journey->{is_motis} ? $journey->{backend_name} : q{}) %>" class="unmarked"><%= $journey->{arr_name} %></a></b><br/>
% if ($journey->{real_arrival}->epoch) {
<b><%= $journey->{real_arrival}->strftime('%H:%M') %></b>
% if ($journey->{real_arrival}->epoch != $journey->{sched_arrival}->epoch) {
@@ -202,8 +202,11 @@
% if (@{$journey->{messages} // []} or @{$journey->{extra_data}{qos_msg} // []} or not $journey->{extra_data}{rt}) {
<p style="margin-bottom: 2ex;">
<ul>
- % if (not $journey->{extra_data}{rt}) {
- <li><i class="material-icons tiny">gps_off</i> Keine Echtzeitdaten vorhanden
+ % if ($journey->{extra_data}{manual}) {
+ <li><i class="material-icons tiny">gps_off</i> Manueller Checkin ohne Echtzeitdaten
+ % }
+ % elsif (not $journey->{extra_data}{rt}) {
+ <li><i class="material-icons tiny">gps_off</i> <%= L('status.realtime-unavailable') %>
% }
% for my $message (reverse @{$journey->{messages} // []}) {
% if ($journey->{sched_departure}->epoch - $message->[0]->epoch < 1800) {
@@ -232,8 +235,7 @@
% }
% if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} <= 0) {
<p style="margin-top: 2ex;">
- Der automatische Checkout erfolgt wegen teilweise langsamer
- Echtzeitdatenupdates erst etwa zehn Minuten nach der Ankunft.
+ %= L('status.delayed-auto-checkout')
</p>
% }
% elsif (not $journey->{arr_name}) {
@@ -242,13 +244,7 @@
<a class="tablerow action-checkout" data-station="<%= $station->[1] // $station->[0] %>">
<span><%= $station->[0] %></span>
<span>
- % if ($station->[2]{load}{SECOND}) {
- % my ($first, $second) = load_icon($station->[2]{load});
- % if ($first ne 'help_outline') {
- <i class="material-icons tiny" aria-hidden="true"><%= $first %></i>
- % }
- <i class="material-icons tiny" aria-hidden="true"><%= $second %></i>
- % }
+ %= include '_show_load_icons', station => $station
% if ($station->[2]{isCancelled}) {
entfällt
% }
@@ -278,7 +274,7 @@
% }
% else {
<a class="action-undo blue-text" data-id="in_transit" data-checkints="<%= $journey->{timestamp}->epoch %>" style="margin-right: 0;">
- <i class="material-icons left" aria-hidden="true">undo</i> Rückgängig
+ <i class="material-icons left" aria-hidden="true">undo</i> <%= L('status.undo') %>
</a>
% }
% if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} <= 0) {
@@ -287,7 +283,7 @@
style="margin-right: 0;"
data-station="<%= $journey->{arr_name}%>">
<i class="material-icons left">done</i>
- Auschecken
+ %= L('status.check-out')
</a>
% }
% elsif ($journey->{arr_name}) {
@@ -314,12 +310,12 @@
data-url="<%= url_for('/status')->to_abs->scheme('https') %>/<%= $user->{name} %>/<%= $journey->{sched_departure}->epoch %>?token=<%= $journey->{dep_eva} %>-<%= $journey->{timestamp}->epoch % 337 %>"
% }
>
- <i class="material-icons left" aria-hidden="true">share</i> Teilen
+ <i class="material-icons left" aria-hidden="true">share</i> <%= L('status.share') %>
</a>
% }
% else {
<a class="right" href="/journey/visibility">
- <i class="material-icons left"><%= visibility_icon($journey_visibility) %></i> Sichtbarkeit
+ <i class="material-icons left"><%= visibility_icon($journey_visibility) %></i> <%= L('status.privacy-level') %>
</a>
% }
</div>
@@ -327,15 +323,16 @@
% if (@{stash('timeline') // []}) {
%= include '_timeline_link', timeline => stash('timeline'), from_checkin => 1
% }
- % if ($journey->{arr_name}) {
+ % if ($journey->{arr_name} and @{$journey->{extra_data}{him_msg} // []}) {
<div class="card" style="margin-top: <%= scalar @{stash('timeline') // []} ? '1.5rem' : '3em' %>;">
<div class="card-content">
- <span class="card-title">Details</span>
+ <i class="material-icons small right sync-failed-marker grey-text" style="display: none;">sync_problem</i>
+ <span class="card-title"><%= L('status.messages') %></span>
% if (@{$journey->{extra_data}{him_msg} // []}) {
<p style="margin-bottom: 2ex;">
<ul>
% for my $message (@{$journey->{extra_data}{him_msg} // []}) {
- <li> <i class="material-icons tiny">info</i> <%= $message->{header} %> <%= $message->{lead} %></li>
+ <li> <i class="material-icons tiny"><%= ($message->{prio} and $message->{prio} eq 'HOCH') ? 'warning' : 'info' %></i> <%= $message->{header} %> <%= $message->{lead} %></li>
% }
</ul>
</p>
@@ -355,77 +352,75 @@
</p>
% }
</div>
- <div class="card-action">
- % my $url = 'https://bahn.expert/details/';
- % if ($journey->{train_id} =~ m{[|]}) {
- % if ($journey->{train_type} and $journey->{train_no}) {
- % $url .= $journey->{train_type} . ' ' . $journey->{train_no};
- % }
- % $url .= '/' . $journey->{sched_departure}->epoch . '000?jid=' . $journey->{train_id} =~ s{#}{%23}gr;
- % }
- % else {
- % $url .= $journey->{train_type} . ' ' . $journey->{train_no} . '/' . $journey->{sched_departure}->epoch . '000?station=' . $journey->{dep_eva};
- % }
- % if ($journey->{backend_id} <= 1) {
- <a style="margin-right: 0;" href="<%= $url %>"><i class="material-icons left" aria-hidden="true">timeline</i> Zuglauf</a>
- % }
- % else {
- &nbsp;
- % }
- % if ($journey->{extra_data}{trip_id}) {
- <a class="right" style="margin-right: 0;" href="https://dbf.finalrewind.org/map/<%= $journey->{extra_data}{trip_id} =~ s{#}{%23}gr %>/<%= $journey->{train_line} || 0 %>?hafas=<%= $journey->{backend_name} // 'DB' %>&amp;from=<%= $journey->{dep_name} %>&amp;to=<%= $journey->{arr_name} %>&amp;dark=<%= (session('theme') and session('theme') eq 'dark') ? 1 : 0 %>"><i class="material-icons left" aria-hidden="true">map</i> Karte</a>
- % }
- </div>
</div>
+ % }
+ % if ($journey->{arr_name}) {
<div class="card" style="margin-top: 3em;">
<div class="card-content">
<i class="material-icons small right sync-failed-marker grey-text" style="display: none;">sync_problem</i>
- <span class="card-title">Ziel ändern?</span>
- <div class="targetlist">
- % for my $station (@{$journey->{route_after}}) {
- % my $is_dest = ($journey->{arr_name} and $station->[0] eq $journey->{arr_name});
- <a class="action-checkout tablerow" style="<%= $is_dest? 'font-weight: bold;' : '' %>" data-station="<%= $station->[1] // $station->[0] %>">
- <span><%= $station->[0] %></span>
- <span>
- % if ($station->[2]{load}{SECOND}) {
- % my ($first, $second) = load_icon($station->[2]{load});
- % if ($first ne 'help_outline') {
- <i class="material-icons tiny" aria-hidden="true"><%= $first %></i>
- % }
- <i class="material-icons tiny" aria-hidden="true"><%= $second %></i>
- % }
- % if ($station->[2]{isCancelled}) {
- entfällt
- % }
- % elsif ($station->[2]{rt_arr} or $station->[2]{sched_arr}) {
- %= ($station->[2]{rt_arr} || $station->[2]{sched_arr})->strftime('%H:%M')
- % }
- % elsif ($station->[2]{rt_dep} or $station->[2]{sched_dep}) {
- (<%= ($station->[2]{rt_dep} || $station->[2]{sched_dep})->strftime('%H:%M') %>)
- % }
- % elsif ($station->[2]{isAdditional}) {
- Zusatzhalt
- % }
- </span>
+ <span class="card-title"><%= L('status.map') %></span>
+ <div id="map" style="height: 70vh;">
+ </div>
+ %= include '_map', with_map_header => 0, station_coordinates => stash('station_coordinates'), polyline_groups => stash('polyline_groups'), markers => stash('markers')
+ </div>
+ </div>
+ % if ($journey->{extra_data}{manual}) {
+ <div class="card" style="margin-top: 3em;">
+ <div class="card-content">
+ <i class="material-icons small right sync-failed-marker grey-text" style="display: none;">sync_problem</i>
+ <span class="card-title">Manueller Checkin</span>
+ </div>
+ <div class="card-action">
+ <a class="action-undo blue-text" data-id="in_transit" data-checkints="<%= $journey->{timestamp}->epoch %>" style="margin-right: 0;">
+ <i class="material-icons left" aria-hidden="true">undo</i> <%= L('status.undo-checkin') %>
</a>
- <a class="nonflex" href="<%= resolve_sb_template($user->{sb_template}, name => $station->[0], eva => $station->[1], tt => $journey->{train_type} // q{x}, tn => $journey->{train_no}, id => $journey->{train_id}, hafas => $journey->{is_hafas} ? $journey->{backend_name} : q{}) %>"><i class="material-icons tiny"><%= $journey->{is_hafas} ? 'directions' : 'train' %></i></a>
- % }
</div>
</div>
- <div class="card-action">
- <a class="action-undo blue-text" data-id="in_transit" data-checkints="<%= $journey->{timestamp}->epoch %>" style="margin-right: 0;">
- <i class="material-icons left" aria-hidden="true">undo</i> Checkin Rückgängig
- </a>
+ % }
+ % else {
+ <div class="card" style="margin-top: 3em;">
+ <div class="card-content">
+ <i class="material-icons small right sync-failed-marker grey-text" style="display: none;">sync_problem</i>
+ <span class="card-title"><%= L('status.change-destination') %></span>
+ <div class="targetlist">
+ % for my $station (@{$journey->{route_after}}) {
+ % my $is_dest = ($journey->{arr_name} and $station->[0] eq $journey->{arr_name});
+ <a class="action-checkout tablerow" style="<%= $is_dest? 'font-weight: bold;' : '' %>" data-station="<%= $station->[1] // $station->[0] %>">
+ <span><%= $station->[0] %></span>
+ <span>
+ %= include '_show_load_icons', station => $station
+ % if ($station->[2]{isCancelled}) {
+ entfällt
+ % }
+ % elsif ($station->[2]{rt_arr} or $station->[2]{sched_arr}) {
+ %= ($station->[2]{rt_arr} || $station->[2]{sched_arr})->strftime('%H:%M')
+ % }
+ % elsif ($station->[2]{rt_dep} or $station->[2]{sched_dep}) {
+ (<%= ($station->[2]{rt_dep} || $station->[2]{sched_dep})->strftime('%H:%M') %>)
+ % }
+ % elsif ($station->[2]{isAdditional}) {
+ Zusatzhalt
+ % }
+ </span>
+ </a>
+ <a class="nonflex" href="<%= resolve_sb_template($user->{sb_template}, name => $station->[0], eva => $station->[1], tt => $journey->{train_type} // q{x}, tn => $journey->{train_no}, id => $journey->{train_id} =~ s{[ #|]}{x}gr, dbris => $journey->{is_dbris} ? $journey->{backend_name} : q{}, efa => $journey->{is_efa} ? $journey->{backend_name} : q{}, hafas => $journey->{is_hafas} ? $journey->{backend_name} : q{}, is_iris => $journey->{is_iris}, motis => $journey->{is_motis} ? $journey->{backend_name} : q{}) %>"><i class="material-icons tiny"><%= $journey->{is_hafas} ? 'directions' : 'train' %></i></a>
+ % }
+ </div>
+ </div>
+ <div class="card-action">
+ <a class="action-undo blue-text" data-id="in_transit" data-checkints="<%= $journey->{timestamp}->epoch %>" style="margin-right: 0;">
+ <i class="material-icons left" aria-hidden="true">undo</i> <%= L('status.undo-checkin') %>
+ </a>
+ </div>
</div>
- </div>
+ % }
<p>
- Falls das Backend ausgefallen ist oder die Fahrt aus anderen
- Gründen verloren ging:
+ %= L('status.force-checkout-lead')
</p>
<p class="center-align">
<a class="action-checkout waves-light btn"
data-force="1" data-station="<%= $journey->{arr_name}
- %>">Ohne Echtzeitdaten auschecken</a>
+ %>"><%= L('status.force-checkout') %></a>
</p>
% }
</div>