blob: 4084b55ce092d0703123074f894f42309ad58729 (
plain)
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
<div class="mheader">
<div>
% if ($departure->{train_no} or $departure->{train_line}) {
<span class="train-line <%= $linetype %>"><%= $departure->{train_type} %>
<%= $departure->{train_line} // $departure->{train_no} %></span>
<span class="train-no"><%= $departure->{train_line} ? $departure->{train_no} : q{} %></span>
% }
% else {
<span class="train-line"><%= $departure->{train} // q{???} %></span>
% }
</div>
<div>
% if ($departure->{origin}) {
<span class="train-origin"><%= $departure->{origin} %></span>
→
% }
<span class="train-dest"><%= $departure->{destination} // q{???} %></span>
</div>
<!--
% if ($departure->{is_cancelled}) {
<div class="minfo">Fahrt fällt aus</div>
% }
% elsif (defined $departure->{delay} and $departure->{delay} > 0) {
<div class="minfo">+<%= $departure->{delay} %>
% if ($departure->{departure_is_cancelled}) {
(endet hier)
% }
</div>
% }
% if (@{$departure->{replaced_by}}) {
% for my $replacement (@{$departure->{replaced_by}}) {
<span class="replaced">Ersatzzug: <%= $replacement %></span>
% }
% }
% if (@{$departure->{replacement_for}}) {
% for my $replacement (@{$departure->{replacement_for}}) {
<span class="replacement">Ersatzzug für <%= $replacement %></span>
% }
% }
-->
</div> <!-- mheader -->
<div class="mfooter">
<div class="dataline">
<div>
<div class="arrival">
% if ($departure->{is_cancelled} and $departure->{sched_arrival}) {
<span class="minfo">An: ––:––</span><br/>Plan: <%= $departure->{sched_arrival} %>
% }
% elsif ($departure->{arrival_is_cancelled}) {
<span class="minfo">Beginnt hier</span><br/>Plan: <%= $departure->{sched_arrival} %>
% }
% elsif ($departure->{arrival}) {
% if ($departure->{arrival} ne $departure->{sched_arrival}) {
An: <span class="minfo"><%= $departure->{arrival} %></span>
<br/>Plan: <%= $departure->{sched_arrival} %>
% }
% else {
An: <%= $departure->{arrival} %>
% }
% }
</div>
</div>
<div>
<div class="platform">
% if ($departure->{arrival_is_cancelled} and $departure->{departure_is_cancelled}) {
<span class="minfo">Fahrt fällt aus</span>
% }
% else {
% my $left = '';
% my $right = '';
% if ($departure->{direction} and $departure->{direction} eq 'l') {
% $left = '◀ ';
% }
% elsif ($departure->{direction} and $departure->{direction} eq 'r') {
% $right = ' ▶';
% }
% if ($departure->{scheduled_platform} and $departure->{platform}
% and $departure->{scheduled_platform} ne $departure->{platform}) {
<span class="minfo"><%= $left %>Gleis <%= $departure->{platform} %><%= $right %></span>
% }
% elsif ($departure->{scheduled_platform} or $departure->{platform}) {
<%= $left %>Gleis <%= $departure->{platform} // $departure->{scheduled_platform} %><%= $right %>
% }
% }
</div>
</div>
<div>
<div class="departure">
% if ($departure->{is_cancelled} and $departure->{sched_departure}) {
<span class="minfo">Ab: ––:––</span><br/>Plan: <%= $departure->{sched_departure} %>
% }
% elsif ($departure->{departure_is_cancelled}) {
<span class="minfo">Endet hier</span><br/>Plan: <%= $departure->{sched_departure} %>
% }
% elsif ($departure->{departure}) {
% if ($departure->{departure} ne $departure->{sched_departure}) {
Ab: <span class="minfo"><%= $departure->{departure} %></span>
<br/>Plan: <%= $departure->{sched_departure} %>
% }
% else {
Ab: <%= $departure->{departure} %>
% }
% }
</div>
</div>
</div> <!-- dataline -->
<div class="verbose">
% if ($departure->{trip_id}) {
<a class="smallbutton" href="/map/<%= $departure->{trip_id} %>/<%= $departure->{train_line} // 0 %>?from=<%= $station_name %>"><i class="material-icons" aria-hidden="true">map</i> Karte</a>
% }
% if ($departure->{wr_link}) {
<a class="smallbutton" href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>"><i class="material-icons" aria-hidden="true">train</i> Wagenreihung
</a>
% }
% elsif ($icetype and $icetype->[1] and $departure->{train_type} ne 'Bus') {
<span class="disabledbutton"><i class="material-icons" aria-hidden="true">train</i> Plan: <%= $icetype->[0] %></span>
% }
% for my $link (@{$departure->{links}}) {
<a class="smallbutton" href="<%= $link->[1] %>"><i class="material-icons" aria-hidden="true">warning</i> <%= $link->[0] %></a>
% }
</div>
% if ($departure->{moreinfo} and @{$departure->{moreinfo}}) {
Meldungen:
<ul>
% for my $pair (@{$departure->{moreinfo}}) {
<li>
% if ($pair->[0]->isa('DateTime')) {
% if ($pair->[0]->day != $dt_now->day) {
% $pair->[0]->set_locale('de_DE');
%= $pair->[0]->strftime('%a %H:%M')
% }
% else {
%= $pair->[0]->strftime('%H:%M')
% }
% }
% else {
%= $pair->[0]
% if (length($pair->[0]) > 25) {
<br/>
% }
% }
<span class="reason">
%= $pair->[1]
</span>
</li>
% }
% if ($departure->{route_info}) {
<li><%= $departure->{route_info} %></li>
% }
</ul>
% }
% if ($departure->{route_pre_diff} and $departure->{route_post_diff}) {
Fahrtverlauf:
<ul class="mroute">
% for my $stop (@{$departure->{route_pre_diff}}) {
<li>
<a href="/<%= $stop->{name} %>#<%= $departure->{train_type} . $departure->{train_no} %>" class="
% if ($stop->{isAdditional}) {
additional-stop
% }
% elsif ($stop->{isCancelled}) {
cancelled-stop
% }
% elsif ($self->is_important($stop->{name})) {
important-stop
% }
% else {
generic-stop
% }
% if ($stop->{rt_dep}) {
"><%= $stop->{sched_dep}->strftime('%H:%M') %> (heute <%= $stop->{rt_dep}->strftime('%H:%M') %>) <%= $stop->{name} %></a>
% }
% else {
"><%= $stop->{sched_dep} ? $stop->{sched_dep}->strftime('%H:%M') : q{} %> <%= $stop->{name} %></a>
% }
</li>
% }
<li class="<%= $departure->{is_cancelled} ? 'cancelled-stop' : q{} %>"><%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %>
% if ($departure->{sched_departure}) {
% if ($departure->{departure} ne $departure->{sched_departure}) {
(heute <%= $departure->{departure} %>)
% }
% }
% elsif ($departure->{arrival}) {
% if ($departure->{arrival} ne $departure->{sched_arrival}) {
(heute <%= $departure->{arrival} %>)
% }
% }
<strong><%= $station_name %></strong>
</li>
% for my $stop (@{$departure->{route_post_diff}}) {
<li>
<a href="/<%= $stop->{name} %>#<%= $departure->{train_type} . $departure->{train_no} %>" class="
% if ($stop->{isAdditional}) {
additional-stop
% }
% elsif ($stop->{isCancelled}) {
cancelled-stop
% }
% elsif ($self->is_important($stop->{name})) {
important-stop
% }
% else {
generic-stop
% }
% if ($stop->{rt_arr}) {
"><%= $stop->{sched_arr}->strftime('%H:%M') %> (heute <%= $stop->{rt_arr}->strftime('%H:%M') %>) <%= $stop->{name} %></a>
% }
% else {
"><%= $stop->{sched_arr} ? $stop->{sched_arr}->strftime('%H:%M') : q{} %> <%= $stop->{name} %></a>
% }
</li>
% }
</ul> <!-- mroute -->
% }
% if (param('ajax')) {
<div style="margin-top: 1em;">
<a class="smallbutton" href="/z/<%= $departure->{train_type} %>%20<%= $departure->{train_no} %>/<%= $station_name %>"><i class="material-icons" aria-hidden="true">share</i> Link</a>
</div>
% }
</div> <!-- mfooter -->
|