2019-04-30 21:23:49 +00:00
|
|
|
% if ($journey->{checked_in}) {
|
2019-05-16 14:10:53 +00:00
|
|
|
<div class="card autorefresh">
|
2019-05-02 08:05:15 +00:00
|
|
|
<div class="card-content">
|
|
|
|
<i class="material-icons small right sync-failed-marker grey-text" style="display: none;">sync_problem</i>
|
2019-04-30 21:23:49 +00:00
|
|
|
<span class="card-title"><%= $name %> ist unterwegs</span>
|
|
|
|
<p>
|
2019-05-10 16:16:45 +00:00
|
|
|
<div class="center-align"><b><%= $journey->{train_type} %> <%= $journey->{train_no} %></b></div>
|
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-30 21:23:49 +00:00
|
|
|
% if ($journey->{departure_countdown} > 120) {
|
|
|
|
Abfahrt in <%= sprintf('%.f', $journey->{departure_countdown} / 60) %> Minuten
|
|
|
|
% }
|
|
|
|
% elsif ($journey->{departure_countdown} > 60) {
|
|
|
|
Abfahrt in einer Minute
|
|
|
|
% }
|
|
|
|
% elsif ($journey->{departure_countdown} > 0) {
|
|
|
|
Abfahrt in weniger als einer Minute
|
|
|
|
% }
|
|
|
|
% 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' %>
|
|
|
|
% }
|
|
|
|
% elsif ($journey->{arrival_countdown} > 0) {
|
|
|
|
Ankunft in weniger als einer Minute
|
|
|
|
% }
|
|
|
|
% else {
|
|
|
|
Ziel erreicht
|
|
|
|
% }
|
|
|
|
% }
|
|
|
|
% elsif ($journey->{arr_name}) {
|
|
|
|
Ankunft in mehr als zwei Stunden
|
|
|
|
% }
|
|
|
|
</div>
|
2019-05-02 08:05:15 +00:00
|
|
|
<div class="progress grey lighten-3" style="height: 1ex;">
|
|
|
|
<div class="determinate blue" style="width: <%= sprintf('%.2f', 100 * ($journey->{journey_completion} // 0)); %>%;"></div>
|
|
|
|
</div>
|
|
|
|
</p>
|
|
|
|
<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>
|
2019-05-03 08:49:14 +00:00
|
|
|
<div style="float: right; text-align: right;">
|
2019-05-02 08:05:15 +00:00
|
|
|
% if ($journey->{arr_name}) {
|
|
|
|
<b><%= $journey->{arr_name} %></b><br/>
|
|
|
|
% }
|
|
|
|
% else {
|
|
|
|
Fahrt ins Blaue<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) %>)
|
|
|
|
% }
|
|
|
|
% }
|
|
|
|
% elsif ($journey->{arr_name}) {
|
|
|
|
noch nicht bekannt
|
|
|
|
% }
|
|
|
|
</div>
|
|
|
|
<div style="clear: both;">
|
2019-04-30 21:23:49 +00:00
|
|
|
</div>
|
|
|
|
</p>
|
|
|
|
% 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>
|
|
|
|
% }
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
% }
|
|
|
|
% else {
|
2019-05-16 14:10:53 +00:00
|
|
|
<div class="card autorefresh">
|
|
|
|
<div class="card-content">
|
2019-05-02 08:05:15 +00:00
|
|
|
<i class="material-icons small right sync-failed-marker grey-text" style="display: none;">sync_problem</i>
|
2019-04-30 21:23:49 +00:00
|
|
|
<span class="card-title"><%= $name %> ist gerade nicht eingecheckt</span>
|
|
|
|
<p>
|
|
|
|
Zuletzt gesehen in <%= $journey->{arr_name} %>.
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
% }
|