summaryrefslogtreecommitdiff
path: root/templates/layouts/default.html.ep
blob: f256db6531695160c0bd35b24abf86056a7dbc26 (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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!DOCTYPE html>
<html lang="de">
<head>
	<title><%= stash('title') // 'db-infoscreen' %></title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="keywords" content="Abfahrtsmonitor, Bahnhofstafel, Abfahrten, Abfahrtstafel, ICE, IC, RE, RB, S-Bahn">
	<meta name="description" content="Inoffizieller Abfahrtsmonitor für Bahnhöfe der DB">
	<link rel="icon" type="image/png" href="/static/icons/icon-16x16.png" sizes="16x16">
	<link rel="icon" type="image/png" href="/static/icons/icon-32x32.png" sizes="32x32">
	<link rel="icon" type="image/png" href="/static/icons/icon-96x96.png" sizes="96x96">
	<link rel="apple-touch-icon" href="/static/icons/icon-120x120.png">
	<link rel="apple-touch-icon" sizes="180x180" href="/static/icons/icon-180x180.png">
	<link rel="apple-touch-icon" sizes="152x152" href="/static/icons/icon-152x152.png">
	<link rel="apple-touch-icon" sizes="167x167" href="/static/icons/icon-167x167.png">
% if ($self->stash('refresh_interval')) {
	<meta http-equiv="refresh" content="<%= $self->stash('refresh_interval') %>"/>
% }

	% my $av = 'v12'; # asset version
	%= stylesheet "/static/${av}/default.css"
	%= stylesheet "/static/${av}/jquery-ui.min.css"
% my $force_mobile = param('force_mobile') // stash('force_mobile');
% if ($force_mobile) {
	%= stylesheet "/static/${av}/mobile.css"
% }
	%if (stash('load_marquee')) {
	%= javascript '/static/jquery-3.4.1.min.js'
	%= javascript "/static/${av}/jquery-ui.min.js"
	%= javascript "/static/${av}/dbf.min.js"
	%= javascript "/static/${av}/marquee.min.js"
	%= javascript begin
	$(function () {  $('marquee').marquee() });
	% end
	% } else {
	%= javascript '/static/jquery-3.4.1.min.js', defer => undef
	%= javascript "/static/${av}/jquery-ui.min.js", defer => undef
	%= javascript "/static/${av}/dbf.min.js", defer => undef
	% }
	% if (stash('with_geolocation')) {
	%= javascript "/static/${av}/geolocation.min.js", defer => undef
	% }
</head>
<body style="<%= (stash('hide_opts') ? 'margin: 0; padding: 0;' : q{}) %>
<%= (param('dark') ? 'background-color: #000000; color: #ffffff;' : q{}) %>">

<div class="container">
% if (my $error = stash 'error') {
<div class="error"><strong>Backend-Fehler:</strong>
<pre>
%= $error
</pre>
</div>
% }
% elsif (stash('stationlist')) {
<div class="error"><strong>Mehrdeutige Eingabe.</strong>
Bitte eine Station aus der Liste auswählen</div>
% }
</div>

<div class="content">
%= content
</div>

% if (not stash('hide_opts')) {
<div class="container">
<div class="input-field">


%= form_for _redirect => begin
<div>
  <div class="field">
    <div class="desc">Bahnhof / Haltestelle</div>
    <div>
% if (stash('stationlist')) {
      %= select_field station => stash('stationlist')
% }
% elsif (stash('station')) {
      %= text_field 'station', class => 'station', placeholder => 'Name oder DS100-Kürzel'
% }
% else {
      %= text_field 'station', class => 'station', placeholder => 'Name oder DS100-Kürzel', autofocus => 'autofocus'
% }
    </div>
  </div>
  <div class="field">
    %= submit_button 'Abfahrtsmonitor'
  </div>
  % if (not stash('show_intro')) {
    <div class="break"></div>
    <div class="field">
      <a class="button" href="<%= url_for('_auto')->to_abs->scheme('https') %>">Bahnhöfe im Umfeld suchen</a>
    </div>
  % }
  <div class="break"></div>
  <div class="moresettings-header moresettings-header-collapsed button button-light">Weitere Einstellungen</div>
  <div class="moresettings moresettings-collapsed">
    <div class="field">
      <div class="desc">
        Frontend
      </div>
      <div>
        %= select_field mode => [ ['App' => 'app'], ['Infoscreen' => 'infoscreen'], ['Bahnhofstafel' => 'multi'], ['Gleisanzeiger' => 'single'] ]
      </div>
    </div>
    <div class="field">
      <div class="desc">
        Backend
      </div>
      <div>
        %= select_field backend => [ ['IRIS' => 'iris'], ['HAFAS' => 'ris'] ]
      </div>
    </div>
    <div class="field">
      <div class="desc">
        Nur Züge über
      </div>
      <div>
        %= text_field 'via', placeholder => 'Bahnhof 1, Bhf2, ... (oder regulärer Ausdruck)', class => 'station'
      </div>
    </div>
    <div class="field">
      <div class="desc">
        Gleise
      </div>
      <div>
        %= text_field 'platforms', placeholder => '1, 2, 5, ...'
      </div>
    </div>
    <div class="field">
      <div class="desc">
        %= check_box 'hidelowdelay' => 1, id => 'id_hidelowdelay'
        <label for="id_hidelowdelay">
          Nur Verspätungen &gt;5 Min. anzeigen
        </label>
      </div>
    </div>
    <div class="field">
      <div class="desc">
        %= check_box 'dark' => 1, id => 'id_dark'
        <label for="id_dark">
          Dunkles Layout (experimentell)
        </label>
      </div>
    </div>
    <div class="field">
      <div class="desc">
        %= check_box 'hide_opts' => 1, id => 'id_hide_opts'
        <label for="id_hide_opts">
          Formular verstecken (für Infoscreens)
        </label>
      </div>
    </div>
    <div class="break"></div>
    <span class="optional">Nur für IRIS-Backend:</span>
    <div class="field">
      <div class="desc">
        Ankunfts- oder Abfahrtszeit anzeigen?
      </div>
      <div>
        %= select_field admode => [['Abfahrt bevorzugen' => 'deparr'], ['Nur Abfahrt' => 'dep'], ['Nur Ankunft' => 'arr']]
      </div>
    </div>
    <div class="field">
      <div class="desc">
        %= check_box 'detailed' => 1, id => 'id_detailed'
        <label for="id_detailed">
          Mehr Details (Zugnummern und Ankunftszeiten) anzeigen
        </label>
      </div>
    </div>
    <div class="field">
      <div class="desc">
        %= check_box 'show_realtime' => 1, id => 'id_show_realtime'
        <label for="id_show_realtime">
          Echtzeitangaben statt Fahrplandaten anzeigen
        </label>
      </div>
    </div>
    <div class="field">
      <div class="desc">
        %= check_box 'no_related' => 1, id => 'id_no_related'
        <label for="id_no_related">
        Betriebliche Bahnhofstrennungen berücksichtigen (z.B. "Hbf (Fern+Regio)" vs. "Hbf (S)")
        </label>
      </div>
    </div>
    <div class="field">
      <div class="desc">
        %= check_box 'save_defaults' => 1, id => 'id_save_defaults'
        <label for="id_save_defaults">
        Ausgewählte Optionen als Default speichern
        </label>
      </div>
    </div>
    <div class="field">
      %= submit_button 'Anzeigen'
    </div>
  </div> <!-- moresettings -->
</div>
% end

</div> <!-- input-field -->

<div class="notes">
  <div class="developers-header developers-header-collapsed button button-light">API- und Entwickler-Hinweise</div>
  <div class="developers developers-collapsed">
    <ul>
      <li>Diese Seite kann gerne als iframe in eigene Infoscreens o.ä. eingebunden werden.
	Für eine kleine Ansicht (z.B. iframe in einer normalen Website) bitte das
	"App"-Frontend verwenden. Für eine große Ansicht
	(z.B. als alleinstehender Infoscreen) gibt es das "Infoscreen"-Frontend.</li>
      <li>Die Parameter <span style="font-family: monospace;">mode=json&amp;version=3</span>
	(alternativ auch <span style="font-family:
	monospace;">https://dbf.finalrewind.org/Bahnhofsname.json?version=3</span>)
	bieten ein JSON-IRIS-Interface. Die route-Elemente können zusätzlich
	die Felder "isAdditional" oder "isCancelled" enthalten, der Rest sollte
	selbsterklärend sein. Im Fehlerfall fehlt das "departures"-Element,
	stattdessen wird ein "error"-Element mit Fehlermeldung zurückgegeben.
	Bitte nur eine Anfrage pro Station und Minute
	– eine höhere Auflösung haben die Backenddaten ohnehin nicht.</li>
      <li>Mit <span style="font-family: monospace;">limit</span> kann die Anzahl der
	angezeigten / im JSON enthaltenen Abfahrten eingeschränkt werden, z.B.
	<span style="font-family: monospace;">limit=10</span> für die ersten zehn.</li>
      <li>Dieser Dienst ist Open Source-Software (Links siehe unten) und kann auch
	auf eigenen Servern installiert werden. Automatisierte Crawler, die mehrere
	Dutzend Stationen pro Minute abfragen, bitte nur auf eigenen Instanzen
	betreiben.</li>
    </ul>
  </div> <!-- developers -->
</div> <!-- notes -->

<div class="notes">
<span class="notes">Siehe auch:</span>
<ul>
<li><a href="https://reiseauskunft.bahn.de/bin/bhftafel.exe/dn">DB Abfahrtsmonitor</a>
   (<a href="https://mobile.bahn.de/bin/mobil/bhftafel.exe/dox">mobil</a>)</li>
<li>Für Nahverkehr: <a href="https://vrrf.finalrewind.org/">vrr-infoscreen</a></li>
</ul>
</div> <!-- notes -->

</div> <!-- container -->

<div class="container">
<div class="about">
<a href="https://finalrewind.org/projects/db-fakedisplay/">db-infoscreen</a>
v<%= stash('version') // '???' %><br/>
Backends:<br/>
<a href="https://finalrewind.org/projects/Travel-Status-DE-DBWagenreihung/">Travel::Status::DE::DBWagenreihung</a>
v<%= $Travel::Status::DE::DBWagenreihung::VERSION %><br/>
<a href="https://finalrewind.org/projects/Travel-Status-DE-DeutscheBahn/">Travel::Status::DE::HAFAS</a>
v<%= $Travel::Status::DE::HAFAS::VERSION %><br/>
<a href="https://finalrewind.org/projects/Travel-Status-DE-IRIS/">Travel::Status::DE::IRIS</a>
v<%= $Travel::Status::DE::IRIS::VERSION %><br/>
<a href="http://data.deutschebahn.com/dataset/data-haltestellen">Haltestellendaten</a>
© DB Station&amp;Service AG,
Europaplatz 1,
10557 Berlin, lizensiert unter CC-BY 4.0<br/>
<a href="_datenschutz" rel="nofollow">Datenschutzerklärung</a>
·
<a href="_impressum" rel="nofollow">Impressum</a><br/>
</div> <!-- about -->
</div> <!-- container -->
% }

</body>
</html>