2019-05-16 14:10:53 +00:00
|
|
|
<div class="card autorefresh">
|
2019-05-03 08:49:14 +00:00
|
|
|
<div class="card-content">
|
2019-05-04 06:30:18 +00:00
|
|
|
<i class="material-icons small right sync-failed-marker grey-text" style="display: none;">sync_problem</i>
|
2019-05-03 08:49:14 +00:00
|
|
|
<span class="card-title">Eingecheckt in <%= $journey->{train_type} %> <%= $journey->{train_no} %></span>
|
2019-04-23 20:27:13 +00:00
|
|
|
<p>
|
2019-05-10 15:58:13 +00:00
|
|
|
<div class="center-align countdown"
|
|
|
|
data-duration="<%= $journey->{journey_duration} // 0 %>"
|
|
|
|
data-arrival="<%= $journey->{real_arrival}->epoch %>">
|
2019-04-24 07:00:30 +00:00
|
|
|
% if ($journey->{departure_countdown} > 120) {
|
|
|
|
Abfahrt in <%= sprintf('%.f', $journey->{departure_countdown} / 60) %> Minuten
|
2019-04-23 20:27:13 +00:00
|
|
|
% }
|
2019-04-24 10:15:26 +00:00
|
|
|
% elsif ($journey->{departure_countdown} > 60) {
|
|
|
|
Abfahrt in einer Minute
|
|
|
|
% }
|
|
|
|
% elsif ($journey->{departure_countdown} > 0) {
|
|
|
|
Abfahrt in weniger als einer Minute
|
|
|
|
% }
|
2019-04-24 07:00:30 +00:00
|
|
|
% elsif (defined $journey->{arrival_countdown}) {
|
|
|
|
% if ($journey->{arrival_countdown} > 60) {
|
|
|
|
Ankunft in <%= sprintf('%.f', $journey->{arrival_countdown} / 60) %>
|
|
|
|
Minute<%= sprintf('%.f', $journey->{arrival_countdown} / 60) == 1 ? '' : 'n' %>
|
2019-04-24 05:50:31 +00:00
|
|
|
% }
|
2019-04-24 07:00:30 +00:00
|
|
|
% elsif ($journey->{arrival_countdown} > 0) {
|
2019-04-24 05:50:31 +00:00
|
|
|
Ankunft in weniger als einer Minute
|
2019-04-23 20:27:13 +00:00
|
|
|
% }
|
|
|
|
% else {
|
|
|
|
Ziel erreicht
|
|
|
|
% }
|
2019-05-25 21:04:36 +00:00
|
|
|
% if ($journey->{arrival_countdown} < (60 * 15) and $journey->{arr_platform}) {
|
2019-05-18 15:10:53 +00:00
|
|
|
<br/>auf Gleis <%= $journey->{arr_platform} %>
|
|
|
|
% }
|
2019-04-23 20:27:13 +00:00
|
|
|
% }
|
2019-04-24 07:00:30 +00:00
|
|
|
% elsif ($journey->{arr_name}) {
|
2019-04-23 20:27:13 +00:00
|
|
|
Ankunft in mehr als zwei Stunden
|
|
|
|
% }
|
2019-05-25 21:04:36 +00:00
|
|
|
% if ($journey->{departure_countdown} > 0 and $journey->{dep_platform}) {
|
|
|
|
<br/>von Gleis <%= $journey->{dep_platform} %>
|
|
|
|
% }
|
2019-04-23 20:27:13 +00:00
|
|
|
</div>
|
2019-05-18 08:16:49 +00:00
|
|
|
<div class="progress" style="height: 1ex;">
|
2019-05-16 14:10:53 +00:00
|
|
|
<div class="determinate" style="width: <%= sprintf('%.2f', 100 * ($journey->{journey_completion} // 0)); %>%;"></div>
|
2019-04-23 20:27:13 +00:00
|
|
|
</div>
|
|
|
|
</p>
|
2019-05-03 08:49:14 +00:00
|
|
|
% if ($journey->{arr_name}) {
|
|
|
|
<p>
|
|
|
|
<div style="float: left;">
|
|
|
|
<b><%= $journey->{dep_name} %></b><br/>
|
|
|
|
<b><%= $journey->{real_departure}->strftime('%H:%M') %></b>
|
|
|
|
% if ($journey->{real_departure}->epoch != $journey->{sched_departure}->epoch) {
|
|
|
|
(<%= sprintf('%+d', ($journey->{real_departure}->epoch - $journey->{sched_departure}->epoch)/60) %>)
|
|
|
|
% }
|
|
|
|
</div>
|
|
|
|
<div style="float: right; text-align: right;">
|
|
|
|
<b><%= $journey->{arr_name} %></b><br/>
|
|
|
|
% if ($journey->{real_arrival}->epoch) {
|
|
|
|
<b><%= $journey->{real_arrival}->strftime('%H:%M') %></b>
|
|
|
|
% if ($journey->{real_arrival}->epoch != $journey->{sched_arrival}->epoch) {
|
|
|
|
(<%= sprintf('%+d', ($journey->{real_arrival}->epoch - $journey->{sched_arrival}->epoch)/60) %>)
|
|
|
|
% }
|
|
|
|
% }
|
|
|
|
% else {
|
|
|
|
noch nicht bekannt
|
|
|
|
% }
|
|
|
|
</div>
|
2019-05-31 18:18:22 +00:00
|
|
|
<div class="center-align hide-on-small-only">
|
|
|
|
% for my $station (@{$journey->{route_after}}) {
|
|
|
|
% if ($station->[0] eq $journey->{arr_name}) {
|
|
|
|
% last;
|
|
|
|
% }
|
|
|
|
% if (($station->[1]{rt_arr_countdown} // 0) > 0) {
|
|
|
|
<%= $station->[0] %><br/><%= $station->[1]{rt_arr}->strftime('%H:%M') %>
|
|
|
|
% if ($station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) {
|
|
|
|
%= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60);
|
|
|
|
% }
|
|
|
|
% last;
|
|
|
|
% }
|
|
|
|
% if (($station->[1]{rt_dep_countdown} // 0) > 0) {
|
|
|
|
<%= $station->[0] %><br/>
|
|
|
|
<%= $station->[1]{rt_arr}->strftime('%H:%M') %> →
|
|
|
|
<%= $station->[1]{rt_dep}->strftime('%H:%M') %>
|
|
|
|
% if ($station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) {
|
|
|
|
%= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60);
|
|
|
|
% }
|
|
|
|
% last;
|
|
|
|
% }
|
|
|
|
% }
|
|
|
|
</div>
|
2019-05-03 08:49:14 +00:00
|
|
|
<div style="clear: both;">
|
|
|
|
</div>
|
2019-05-31 18:18:22 +00:00
|
|
|
<div class="hide-on-med-and-up" style="margin-top: 2ex;">
|
|
|
|
% for my $station (@{$journey->{route_after}}) {
|
|
|
|
% if ($station->[0] eq $journey->{arr_name}) {
|
|
|
|
% last;
|
|
|
|
% }
|
|
|
|
% if (($station->[1]{rt_arr_countdown} // 0) > 0) {
|
|
|
|
Nächster Halt:<br/>
|
|
|
|
<%= $station->[0] %><br/><%= $station->[1]{rt_arr}->strftime('%H:%M') %>
|
|
|
|
% if ($station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) {
|
|
|
|
%= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60);
|
|
|
|
% }
|
|
|
|
% last;
|
|
|
|
% }
|
|
|
|
% if (($station->[1]{rt_dep_countdown} // 0) > 0) {
|
|
|
|
Aktueller Halt:<br/>
|
|
|
|
<%= $station->[0] %><br/>
|
|
|
|
<%= $station->[1]{rt_arr}->strftime('%H:%M') %> →
|
|
|
|
<%= $station->[1]{rt_dep}->strftime('%H:%M') %>
|
|
|
|
% if ($station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) {
|
|
|
|
%= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60);
|
|
|
|
% }
|
|
|
|
% last;
|
|
|
|
% }
|
|
|
|
% }
|
|
|
|
</div>
|
2019-05-03 08:49:14 +00:00
|
|
|
</p>
|
|
|
|
% }
|
2019-04-24 12:58:08 +00:00
|
|
|
% if (@{$journey->{messages} // []} > 0 and $journey->{messages}[0]) {
|
|
|
|
<p style="margin-bottom: 2ex;">
|
|
|
|
<ul>
|
|
|
|
% for my $message (reverse @{$journey->{messages} // []}) {
|
|
|
|
% if ($journey->{sched_departure}->epoch - $message->[0]->epoch < 1800) {
|
|
|
|
<li> <i class="material-icons tiny">warning</i> <%= $message->[0]->strftime('%H:%M') %>: <%= $message->[1] %></li>
|
|
|
|
% }
|
|
|
|
% }
|
|
|
|
</ul>
|
|
|
|
</p>
|
|
|
|
% }
|
2019-05-19 06:55:23 +00:00
|
|
|
% if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} < (20*60)) {
|
|
|
|
% if (my @connections = get_connecting_trains()) {
|
2019-05-20 17:15:21 +00:00
|
|
|
<span class="card-title" style="margin-top: 2ex;">Verbindungen</span>
|
|
|
|
% if ($journey->{arrival_countdown} < 0) {
|
|
|
|
<p>Zug auswählen zum Einchecken mit Zielwahl.</p>
|
|
|
|
% }
|
2019-05-19 08:32:57 +00:00
|
|
|
%= include '_connections', connections => \@connections, checkin_from => $journey->{arrival_countdown} < 0 ? $journey->{arr_ds100} : undef;
|
2019-05-19 06:55:23 +00:00
|
|
|
% }
|
|
|
|
% }
|
2019-04-24 07:00:30 +00:00
|
|
|
% if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} <= 0) {
|
2019-05-19 06:55:23 +00:00
|
|
|
<p style="margin-top: 2ex;">
|
2019-04-24 05:50:31 +00:00
|
|
|
Der automatische Checkout erfolgt in wenigen Minuten. Zum Umsteigen:
|
2019-05-11 13:42:10 +00:00
|
|
|
Aktuelle Station erneut in der Liste auswählen. Zum Weiterfahren im
|
2019-05-18 15:10:53 +00:00
|
|
|
aktuellen Zug: Neues Ziel wählen.
|
2019-04-24 05:50:31 +00:00
|
|
|
</p>
|
|
|
|
% }
|
2019-04-24 10:15:26 +00:00
|
|
|
% elsif ($journey->{arr_name}) {
|
2019-05-03 08:49:14 +00:00
|
|
|
<p style="margin-top: 2em;">Ziel ändern?</p>
|
2019-04-23 20:27:13 +00:00
|
|
|
% }
|
|
|
|
% else {
|
2019-04-24 05:50:31 +00:00
|
|
|
<p>Ziel wählen:</p>
|
2019-04-23 20:27:13 +00:00
|
|
|
% }
|
|
|
|
<table>
|
|
|
|
<tbody>
|
|
|
|
% my $is_after = 0;
|
2019-04-24 07:00:30 +00:00
|
|
|
% for my $station (@{$journey->{route_after}}) {
|
2019-05-26 15:28:21 +00:00
|
|
|
% if ($journey->{arr_name} and $station->[0] eq $journey->{arr_name}) {
|
|
|
|
<tr><td><b><a class="action-checkout" data-station="<%= $station->[0] %>"><%= $station->[0] %></a></b></td></tr>
|
2019-04-23 20:27:13 +00:00
|
|
|
% }
|
|
|
|
% else {
|
2019-05-26 15:28:21 +00:00
|
|
|
<tr><td><a class="action-checkout" data-station="<%= $station->[0] %>"><%= $station->[0] %></a></td></tr>
|
2019-04-23 20:27:13 +00:00
|
|
|
% }
|
|
|
|
% }
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2019-04-24 07:00:30 +00:00
|
|
|
% if ($journey->{arr_name}) {
|
2019-04-23 20:27:13 +00:00
|
|
|
<p>
|
|
|
|
Falls das Backend ausgefallen ist oder der Zug aus anderen
|
|
|
|
Gründen verloren ging: <a class="action-checkout"
|
2019-04-24 07:00:30 +00:00
|
|
|
data-force="1" data-station="<%= $journey->{arr_name}
|
|
|
|
%>">Ohne Echtzeitdaten in <%= $journey->{arr_name} %>
|
2019-04-23 20:27:13 +00:00
|
|
|
auschecken</a>.
|
|
|
|
</p>
|
|
|
|
% }
|
|
|
|
</div>
|
|
|
|
<div class="card-action">
|
2019-05-03 08:49:14 +00:00
|
|
|
<a class="action-undo blue-text" data-id="in_transit">
|
2019-05-12 09:44:28 +00:00
|
|
|
<i class="material-icons left">undo</i> Rückgängig
|
2019-04-23 20:27:13 +00:00
|
|
|
</a>
|
2019-05-12 09:44:28 +00:00
|
|
|
% if ($journey->{arr_name}) {
|
|
|
|
% my $attrib = 'im';
|
|
|
|
% if ($journey->{train_type} =~ m{ ^ (?: S | RB ) $ }x) {
|
2019-05-12 09:46:55 +00:00
|
|
|
% $attrib = 'in der';
|
2019-05-12 09:44:28 +00:00
|
|
|
% }
|
|
|
|
<a class="action-share blue-text right"
|
|
|
|
data-text="Ich bin gerade <%= $attrib %> <%= $journey->{train_type} %> <%= $journey->{train_no} %> nach <%= $journey->{arr_name} %> #NowTräwelling #dbl"
|
|
|
|
% if (current_user()->{is_public} & 0x02) {
|
2019-05-29 18:01:52 +00:00
|
|
|
data-url="<%= url_for('/status')->to_abs->scheme('https') %>/<%= current_user->{name} %>/<%= $journey->{sched_departure}->epoch %>"
|
2019-05-12 09:44:28 +00:00
|
|
|
% }
|
|
|
|
>
|
|
|
|
<i class="material-icons left">share</i> Teilen
|
|
|
|
</a>
|
|
|
|
% }
|
2019-04-23 20:27:13 +00:00
|
|
|
</div>
|
|
|
|
</div>
|