travelynx/templates/departures.html.ep

104 lines
2.8 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->{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>
% }
2019-12-26 21:48:50 +00:00
% elsif (not param('train') and my @connections = get_connecting_trains(eva => $eva)) {
% $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>
% }
2019-03-08 17:02:18 +00:00
<tr>
<td>
<a class="<%= $link_class %>" data-station="<%= $result->station_uic %>" data-train="<%= $result->train_id %>">
2019-03-08 17:02:18 +00:00
<%= $result->line %>
</a>
</td>
2019-03-19 17:20:05 +00:00
<td class="<%= $td_class %>">
<a class="<%= $link_class %>" data-station="<%= $result->station_uic %>" data-train="<%= $result->train_id %>">
2019-03-08 17:02:18 +00:00
<%= $result->destination %>
</a>
</td>
2019-03-19 17:20:05 +00:00
<td class="<%= $td_class %>"><%= $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
% }
</td>
</tr>
% }
</tbody>
</table>
</div>
2018-09-02 19:41:33 +00:00
</div>