1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
<div class="row">
<div class="col s8">
<strong style="font-size: 120%;">
<%= $station %>
</strong>
% for my $related_station (sort { $a->{name} cmp $b->{name} } @{$related_stations}) {
+ <%= $related_station->{name} %> <br/>
% }
</div>
<div class="col s4 center-align">
% my $self_link = url_for('sstation', station => $station // param('station'));
% if (param('dbris')) {
<a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">directions</i><%= param('dbris') %></a>
% }
% elsif (param('hafas')) {
<a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">directions</i><%= param('hafas') %></a>
% }
% elsif (param('motis')) {
<a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">directions</i><%= param('motis') %></a>
% }
% else {
% if ($user->{backend_id}) {
<a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">directions</i><%= $user->{backend_name} %></a>
% }
% else {
<a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">train</i>IRIS</a>
% }
% }
</div>
</div>
% my $have_connections = 0;
% if ($user_status->{checked_in}) {
<div class="row">
<div class="col s12">
<div class="card">
<div class="card-content">
<span class="card-title">Aktuell eingecheckt</span>
<p>In
% if ( not $user_status->{is_motis} ) {
<%= $user_status->{train_type} %>
% }
<%= $user_status->{train_line} // $user_status->{train_no} %>
% if ( $user_status->{arr_name}) {
von <%= $user_status->{dep_name} %> nach <%= $user_status->{arr_name} %>
% }
% else {
ab <%= $user_status->{dep_name} %>
% }
</p>
</div>
<div class="card-action">
% if ($can_check_out) {
<a class="action-undo" data-hafas="<%= param('hafas') // q{} %>" data-id="in_transit" data-checkints="<%= $user_status->{timestamp}->epoch %>" style="margin-right: 0;">
<i class="material-icons left" aria-hidden="true">undo</i> Rückgängig
</a>
<a class="action-checkout right" data-hafas="<%= param('hafas') // q{} %>" data-station="<%= $eva %>" data-force="1">
Hier auschecken
</a>
% }
% else {
<a class="action-undo" data-id="in_transit" data-checkints="<%= $user_status->{timestamp}->epoch %>" style="margin-right: 0;">
<i class="material-icons left" aria-hidden="true">undo</i> Rückgängig
</a>
<a class="action-checkout right" data-hafas="<%= param('hafas') // q{} %>" data-station="<%= $eva %>" data-force="1">
<i class="material-icons left" aria-hidden="true">gps_off</i>
Hier auschecken
</a>
% }
</div>
</div>
</div>
</div>
% }
% elsif ($user_status->{cancellation} and $station eq $user_status->{cancellation}{dep_name}) {
<div class="row">
<div class="col s12">
%= include '_cancelled_departure', journey => $user_status->{cancellation};
</div>
</div>
% }
% elsif ($user_status->{timestamp_delta} < 180) {
<div class="row">
<div class="col s12">
%= include '_checked_out', journey => $user_status;
</div>
</div>
% }
% elsif (not param('train') and (@{stash('connections_iris') // []} or @{stash('connections_hafas') // []}) ) {
% $have_connections = 1;
<div class="row">
<div class="col s12">
<p>Häufig genutzte Verbindungen – Fahrt auswählen zum Einchecken mit Zielwahl</p>
% if (@{stash('connections_iris') // []}) {
%= include '_connections', connections => stash('connections_iris'), checkin_from => $eva;
% }
% if (@{stash('connections_hafas') // []}) {
%= include '_connections_hafas', connections => stash('connections_hafas'), checkin_from => $eva;
% }
</div>
</div>
% }
<div class="row">
<div class="col s4 center-align">
% if ($dbris or $hafas or $motis) {
<a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({dbris => $dbris, hafas => $hafas, timestamp => $datetime->clone->subtract(hours => 1)->epoch}) %>"><i class="material-icons left" aria-hidden="true">chevron_left</i><span class="hide-on-small-only">früher</span></a>
% }
</div>
<div class="col s4 center-align">
% if ($now_in_range) {
<a class="btn-small" href="#now"><i class="material-icons left" aria-hidden="true">vertical_align_center</i><span class="hide-on-small-only">Jetzt</span></a>
% }
</div>
<div class="col s4 center-align">
% if ($dbris or $hafas or $motis) {
<a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({dbris => $dbris, hafas => $hafas, timestamp => $datetime->clone->add(hours => 1)->epoch}) %>"><span class="hide-on-small-only">später</span><i class="material-icons right" aria-hidden="true">chevron_right</i></a>
% }
</div>
</div>
<div class="row">
<div class="col s12">
<p>
% if ($have_connections) {
Alle Abfahrten –
% }
% if ($user_status->{checked_in} and not $can_check_out) {
Diese Station liegt nicht auf der Route deines <a href="/">aktuellen Checkins</a>.
Falls du aktuell nicht mit <b><%= $user_status->{train_type} %> <%= $user_status->{train_no} %></b> unterwegs bist, kannst du den Checkin rückgängig machen.
Falls es sich bei <b><%= $station %></b> um einen nicht in den Echtzeitdaten abgebildeten Zusatzhalt handelt, kannst du hier auchecken.
Da travelynx nicht weiß, welcher der beiden Fälle zutrifft, sind bis dahin keine neuen Checkins möglich.
% }
% elsif ($user_status->{checked_in} and not $user_status->{arr_eva}) {
Du bist bereits eingecheckt und hast noch kein Fahrtziel angegeben.
Bitte <a href="/">wähle zunächst ein Ziel</a>.
Neue Checkins sind erst nach Ankunft der aktuellen Fahrt möglich.
% }
% elsif ($user_status->{checked_in} and $user_status->{arrival_countdown} > 0) {
Deine aktuelle Fahrt ist <a href="/">noch unterwegs</a>.
Ein neuer Checkin ist erst nach Ankunft am ausgewählten Ziel möglich.
% }
% elsif (@{$results}) {
Fahrt auswählen zum Einchecken.
% }
% else {
% if ($dbris or $hafas) {
Keine Abfahrten im ausgewählten Zeitfenster
(<%= $datetime->strftime('%d.%m.%Y %H:%M') %> ± 30min).
% }
% else {
Keine Abfahrten gefunden. Ein Checkin ist frühestens 30 Minuten vor
und maximal 120 Minuten nach Abfahrt möglich.
% }
% }
</p>
% if (not $user_status->{checked_in} or ($can_check_out and $user_status->{arr_eva} and $user_status->{arrival_countdown} <= 0)) {
% if ($dbris) {
%= include '_departures_dbris', results => $results, dbris => $dbris;
% }
% elsif ($efa) {
%= include '_departures_efa', results => $results, efa => $efa;
% }
% elsif ($hafas) {
%= include '_departures_hafas', results => $results, hafas => $hafas;
% }
% elsif ($motis) {
%= include '_departures_motis', results => $results, motis => $motis;
% }
% else {
%= include '_departures_iris', results => $results;
% }
% }
</div>
</div>
<div class="row">
<div class="col s4 center-align">
% if ($dbris or $hafas) {
<a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({dbris => $dbris, hafas => $hafas, timestamp => $datetime->clone->subtract(hours => 1)->epoch}) %>"><i class="material-icons left" aria-hidden="true">chevron_left</i><span class="hide-on-small-only">früher</span></a>
% }
</div>
<div class="col s4 center-align">
</div>
<div class="col s4 center-align">
% if ($dbris or $hafas) {
<a class="btn-small" href="<%= url_for('sstation', station => param('station'))->query({dbris => $dbris, hafas => $hafas, timestamp => $datetime->clone->add(hours => 1)->epoch}) %>"><span class="hide-on-small-only">später</span><i class="material-icons right" aria-hidden="true">chevron_right</i></a>
% }
</div>
</div>
|