Unverified Commit 662693f2 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

add english version of landing page and main menu

parent ece34fe0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ requires 'List::UtilsBy';
requires 'LWP::UserAgent';
requires 'LWP::Protocol::https';
requires 'Mojolicious';
requires 'Mojolicious::Plugin::I18N';
requires 'Travel::Status::DE::DBWagenreihung', '0.06';
requires 'Travel::Status::DE::HAFAS', '4.00';
requires 'Travel::Status::DE::IRIS';
+6 −0
Original line number Diff line number Diff line
@@ -38,6 +38,12 @@ sub startup {
	chomp $self->config->{version};
	$self->defaults( version => $self->config->{version} // 'UNKNOWN' );

	$self->plugin(
		I18N => {
			default => 'de',
		},
	);

	# Generally, the reverse proxy handles compression.
	# Also, Mojolicious compression breaks legacy callback-based JSON endpoints
	# for some clients.
+22 −10
Original line number Diff line number Diff line
% if (stash 'show_intro') {
<div class="container">
% if (languages() =~ m{^en}) {
  <p>
    DBF is an unofficial departure monitor for regional and long-distance trains within Germany, aiming to combine multiple data sources in a useful manner.
    It also has limited support for local transit and traffic outside of Germany.
  </p>
  <p>
    This site is operated by a private entity in a not-for-profit manner.
    There are no uptime or reliability guarantees whatsoever.
  </p>
% }
% else {
  <p>
    DBF ist ein inoffizieller Abfahrtsmonitor für den Regional- und Fernverkehr mit dem Ziel, Daten aus verschiedenen Quellen übersichtlich zusammenzutragen.
    Der Fokus liegt auf Zügen im Netz der Deutschen Bahn; eingeschränkte Unterstützung für Nahverkehr und Züge in anderen Netzen lässt sich optional zuschalten.
  </p>
  <p>
  Diese Seite ist ein kostenfreies, privat betriebenes Projekt ohne
  Verfügbarkeitsgarantie. Alle Angaben ohne Gewähr.
    Diese Seite ist ein kostenfreies, privat betriebenes Projekt ohne Verfügbarkeitsgarantie.
    Alle Angaben ohne Gewähr.
  </p>
% }
<p class="geolink">
<a class="button" href="<%= url_for('_autostop')->to_abs->scheme('https') %>">Stationen in der Umgebung suchen</a>
<a class="button" href="<%= url_for('_autostop')->to_abs->scheme('https') %>"><%= l 'Stationen in der Umgebung suchen' %></a>
</p>
<p>
Oder hier angeben:
%= l 'Oder hier angeben:'
</p>
</div>
% }
+68 −47
Original line number Diff line number Diff line
@@ -111,8 +111,8 @@
</div>
% }
% elsif (stash('stationlist')) {
<div class="error"><strong>Mehrdeutige Eingabe.</strong>
Bitte eine Station aus der Liste auswählen</div>
<div class="error"><strong><%= l 'Mehrdeutige Eingabe' %>.</strong>
<%= l 'Bitte eine Station aus der Liste auswählen' %></div>
% }
</div>

@@ -128,35 +128,35 @@ Bitte eine Station aus der Liste auswählen</div>
%= form_for _redirect => begin
<div>
  <div class="field">
    <div class="desc">Zug / Station</div>
    <div class="desc"><%= l 'Zug / Station' %></div>
    <div>
% if (stash('stationlist')) {
      %= select_field input => stash('stationlist')
% }
% elsif (stash('input')) {
      %= text_field 'input', class => 'station', placeholder => 'Zug, Stationsname oder Ril100-Kürzel', id => 'stationinput'
      %= text_field 'input', class => 'station', placeholder => l 'Zug, Stationsname oder Ril100-Kürzel', id => 'stationinput'
% }
% else {
      %= text_field 'input', class => 'station', placeholder => 'Zug, Stationsname oder Ril100-Kürzel', id => 'stationinput', autofocus => 'autofocus'
      %= text_field 'input', class => 'station', placeholder => l 'Zug, Stationsname oder Ril100-Kürzel', id => 'stationinput', autofocus => 'autofocus'
% }
    </div>
  </div>
  <div class="field">
    %= submit_button 'Abfahrtsmonitor'
    %= submit_button l('Abfahrstafel')
  </div>
  % if (stash('input')) {
    <div class="geolink">
      <a class="button" href="<%= url_for('_autostop')->to_abs->scheme('https') %>">Stationen in der Umgebung suchen</a>
      <a class="button" href="<%= url_for('_autostop')->to_abs->scheme('https') %>"><%= l 'Stationen in der Umgebung suchen' %></a>
    </div>
  % }
  <div class="break"></div>
  <div class="moresettings-header moresettings-header-collapsed button button-light">Weitere Einstellungen</div>
  <div class="moresettings-header moresettings-header-collapsed button button-light"><%= l 'Weitere Einstellungen' %></div>
  <div class="moresettings moresettings-collapsed">
    <div class="field">
      <div class="desc">
        %= check_box 'rt' => 1, id => 'id_show_realtime'
        <label for="id_show_realtime">
          Zeiten inkl. Verspätung angeben
          %= l 'Zeiten inkl. Verspätung angeben'
        </label>
      </div>
    </div>
@@ -164,7 +164,7 @@ Bitte eine Station aus der Liste auswählen</div>
      <div class="desc">
        %= check_box 'hidelowdelay' => 1, id => 'id_hidelowdelay'
        <label for="id_hidelowdelay">
          Verspätungen erst ab 5 Minuten anzeigen
          %= l 'Verspätungen erst ab 5 Minuten anzeigen'
        </label>
      </div>
    </div>
@@ -172,7 +172,7 @@ Bitte eine Station aus der Liste auswählen</div>
      <div class="desc">
        %= check_box 'detailed' => 1, id => 'id_detailed'
        <label for="id_detailed">
          Mehr Details (u.a. Zugnummern und Zugbildungsplan)
          %= l 'Mehr Details'
        </label>
      </div>
    </div>
@@ -180,7 +180,7 @@ Bitte eine Station aus der Liste auswählen</div>
      <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)")
          %= l 'Betriebliche Bahnhofstrennungen berücksichtigen (z.B. "Hbf (Fern+Regio)" vs. "Hbf (S)")'
        </label>
      </div>
    </div>
@@ -188,7 +188,7 @@ Bitte eine Station aus der Liste auswählen</div>
      <div class="desc">
        %= check_box 'past' => 1, id => 'past'
        <label for="past">
        Bereits abgefahrene Züge anzeigen
          %= l 'Bereits abgefahrene Züge anzeigen'
        </label>
      </div>
    </div>
@@ -196,21 +196,21 @@ Bitte eine Station aus der Liste auswählen</div>
      <div class="desc">
        %= check_box 'hide_opts' => 1, id => 'id_hide_opts'
        <label for="id_hide_opts">
          Formular verstecken (für Infoscreens)
          %= l 'Formular verstecken'
        </label>
      </div>
    </div>
    <div class="field">
      <div class="desc">
        Nur Züge über
        %= l 'Nur Züge über'
      </div>
      <div>
        %= text_field 'via', placeholder => 'Bahnhof 1, Bhf2, ... (oder regulärer Ausdruck)', class => 'station'
        %= text_field 'via', placeholder => l('Bahnhof 1, Bhf2, ... (oder regulärer Ausdruck)'), class => 'station'
      </div>
    </div>
    <div class="field">
      <div class="desc">
        Gleise
        %= l 'Gleise'
      </div>
      <div>
        %= text_field 'platforms', placeholder => '1, 2, 5, ...'
@@ -218,10 +218,10 @@ Bitte eine Station aus der Liste auswählen</div>
    </div>
    <div class="field">
      <div class="desc">
        Ankunfts- oder Abfahrtszeit anzeigen?
        %= l 'Ankunfts- oder Abfahrtszeit anzeigen?'
      </div>
      <div>
        %= select_field admode => [['Abfahrt bevorzugen' => 'deparr'], ['Nur Abfahrt' => 'dep'], ['Nur Ankunft' => 'arr']]
        %= select_field admode => [[l('Abfahrt bevorzugen') => 'deparr'], [l('Nur Abfahrt') => 'dep'], [l('Nur Ankunft') => 'arr']]
      </div>
    </div>
    <div class="field">
@@ -233,7 +233,7 @@ Bitte eine Station aus der Liste auswählen</div>
      </div>
    </div>
    <div class="field">
      %= submit_button 'Anzeigen'
      %= submit_button l('Anzeigen')
    </div>
  </div> <!-- moresettings -->
</div>
@@ -242,9 +242,29 @@ Bitte eine Station aus der Liste auswählen</div>
</div> <!-- input-field -->

<div class="notes">
  <div class="developers-header developers-header-collapsed button button-light">API- und Entwickler-Hinweise</div>
  <div class="developers-header developers-header-collapsed button button-light">API</div>
  <div class="developers developers-collapsed">
    <ul>
      % if (languages() =~ m{^en}) {
        <li>You're welcome to embed DBF departure boards as iframes or use them
          in full-screen browser setups. The App frontend works best for
          small screens, whereas the legacy Infoscreen mode is better suited
          for large displays.</li>
        <li>A JSON IRIS API is avaliable via
          <span style="font-family: monospace;">mode=json&amp;version=3</span>
          (or just <span style="font-family: monospace;">https://dbf.finalrewind.org/Station.json?version=3</span>).
          Route elements may contain "isAdditional" and "isCancelled"; the rest
          should be self-explanatory. Please do not send more than 30 requests
          per minute and only one request per station per minute.</li>
        <li>There is no JSON API for train details yet.</li>
        <li>The optional <span style="font-family: monospace;">limit</span>
          parameter limits the number of returnd departures; e.g.
          <span style="font-family: monospace;">limit=10</span> will result in no more than ten.</li>
        <li>DBF is available as Open Source software
          (<a href="https://github.com/derf/db-fakedisplay/blob/master/README.md">installation instructions</a>).
          Please use your own installation for automated crawlers that request dozens of stations per minute.</li>
      % }
      % else {
        <li>DBF-Abfahrtstafeln können gerne als iframe eingebunden oder in
          fest installierten Vollbild-Browserfenstern verwendet werden.
          Für eine kleine Ansicht (z.B. iframe in einer normalen Website)
@@ -268,6 +288,7 @@ Bitte eine Station aus der Liste auswählen</div>
          <a href="https://github.com/derf/db-fakedisplay/blob/master/README.md">installiert</a>
          werden. Automatisierte Crawler, die mehrere Dutzend Stationen pro Minute
          abfragen, bitte nur auf eigenen Instanzen betreiben.</li>
      % }
    </ul>
  </div> <!-- developers -->
</div> <!-- notes -->
@@ -276,11 +297,11 @@ Bitte eine Station aus der Liste auswählen</div>

<div class="container">
<div class="about">
<a href="_about">Über DBF</a>
<a href="_about"><%= l 'Über DBF' %></a>
·
<a href="_datenschutz" rel="nofollow">Datenschutz</a>
<a href="_datenschutz" rel="nofollow"><%= l 'Datenschutz' %></a>
·
<a href="_impressum" rel="nofollow">Impressum</a><br/>
<a href="_impressum" rel="nofollow"><%= l 'Impressum' %></a><br/>
Version <%= stash('version') // '???' %>
</div> <!-- about -->
</div> <!-- container -->