travelynx/templates/departures.html.ep

122 lines
3.3 KiB
Text
Raw Normal View History

2018-09-02 19:41:33 +00:00
<div class="row">
<div class="col s12 center-align">
<b><%= $station %></b>
% for my $related_station (sort { $a->{name} cmp $b->{name} } @{$related_stations}) {
<br/><%= $related_station->{name} %>
% }
</div>
</div>
% my $status = $self->get_user_status;
% my $have_connections = 0;
% if ($status->{checked_in}) {
<div class="row">
<div class="col s12">
2019-05-16 14:10:53 +00:00
<div class="card">
<div class="card-content">
2018-09-02 19:41:33 +00:00
<span class="card-title">Aktuell eingecheckt</span>
<p>In <%= $status->{train_type} %> <%= $status->{train_no} %>
ab <%= $status->{dep_name} %></p>
2018-09-02 19:41:33 +00:00
</div>
<div class="card-action">
2019-12-26 21:48:50 +00:00
<a class="action-checkout" data-station="<%= $eva %>" data-force="1">
2018-10-05 14:33:59 +00:00
Hier auschecken
</a>
2018-09-02 19:41:33 +00:00
</div>
</div>
</div>
</div>
% }
% elsif ($status->{cancellation} and $station eq $status->{cancellation}{dep_name}) {
<div class="row">
<div class="col s12">
%= include '_cancelled_departure', journey => $status->{cancellation};
</div>
</div>
% }
% elsif ($status->{timestamp_delta} < 180) {
<div class="row">
<div class="col s12">
%= include '_checked_out', journey => $status;
</div>
2018-09-02 19:41:33 +00:00
</div>
% }
% elsif (not param('train') and my @connections = @{stash('connections') // []}) {
% $have_connections = 1;
<div class="row">
<div class="col s12">
<p>Häufig genutzte Verbindungen Zug auswählen zum Einchecken mit Zielwahl</p>
2019-12-26 21:48:50 +00:00
%= include '_connections', connections => \@connections, checkin_from => $eva;
</div>
</div>
% }
2018-09-02 19:41:33 +00:00
<div class="row">
2019-03-08 17:02:18 +00:00
<div class="col s12">
<p>
% if ($have_connections) {
Alle Abfahrten
% }
% if (@{$results}) {
Zug auswählen zum Einchecken.
% }
% else {
Keine Abfahrten gefunden. Ein Checkin ist frühestens 30 Minuten vor
und maximal 120 Minuten nach Abfahrt möglich.
% }
</p>
2019-03-08 17:02:18 +00:00
<table class="striped">
<tbody>
% my $orientation_bar_shown = param('train');
% my $now_epoch = now()->epoch;
2019-03-08 17:02:18 +00:00
% for my $result (@{$results}) {
2019-03-19 17:20:05 +00:00
% my $td_class = '';
% my $link_class = 'action-checkin';
2019-03-19 16:17:53 +00:00
% if ($result->departure_is_cancelled) {
2019-03-19 17:20:05 +00:00
% $td_class = "cancelled";
% $link_class = 'action-cancelled-from';
2019-03-19 16:17:53 +00:00
% }
% if (not $orientation_bar_shown and $result->departure->epoch < $now_epoch) {
% $orientation_bar_shown = 1;
<tr>
<td>
</td>
<td>
— Anfragezeitpunkt —
</td>
<td>
</td>
</tr>
% }
2022-07-14 19:05:07 +00:00
<tr class="<%= $link_class %>" data-station="<%= $result->station_uic %>" data-train="<%= $result->train_id %>" data-tr="3">
2019-03-08 17:02:18 +00:00
<td>
2022-07-14 19:05:07 +00:00
<a>
2019-03-08 17:02:18 +00:00
<%= $result->line %>
</a>
</td>
2019-03-19 17:20:05 +00:00
<td class="<%= $td_class %>">
2022-07-14 19:05:07 +00:00
<a>
2019-03-08 17:02:18 +00:00
<%= $result->destination %>
</a>
</td>
<td class="<%= $td_class %>">
% if ($result->departure_hidden) {
(<%= $result->departure->strftime('%H:%M') %>)
% }
% else {
%= $result->departure->strftime('%H:%M')
% }
2019-03-08 17:02:18 +00:00
% if ($result->departure_delay) {
2019-03-20 16:50:14 +00:00
(<%= sprintf('%+d', $result->departure_delay) %>)
2019-03-08 17:02:18 +00:00
% }
% elsif (not $result->has_realtime and $result->start->epoch < $now_epoch) {
<i class="material-icons" aria-label="Keine Echtzeitdaten vorhanden" style="font-size: 16px;">gps_off</i>
% }
2019-03-08 17:02:18 +00:00
</td>
</tr>
% }
</tbody>
</table>
</div>
2018-09-02 19:41:33 +00:00
</div>
2022-09-23 17:25:17 +00:00
%= include '_footer', version => stash('version')