summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-08-20 18:49:06 +0200
committerDaniel Friesel <derf@finalrewind.org>2014-08-20 18:49:06 +0200
commit8dfc0c027758929345f428c3a24f1b9221f9c81e (patch)
treeafff867c9f544743b3b613e7c0e66a9b20c10126 /templates
parentfd26aad769b97b432c254f251b7037d9a3c7db61 (diff)
move application from cgi directory to the project root
Diffstat (limited to 'templates')
-rw-r--r--templates/clean.html.ep85
-rw-r--r--templates/layouts/default.html.ep140
-rw-r--r--templates/multi.html.ep56
-rw-r--r--templates/not_found.html.ep13
-rw-r--r--templates/single.html.ep54
5 files changed, 348 insertions, 0 deletions
diff --git a/templates/clean.html.ep b/templates/clean.html.ep
new file mode 100644
index 0000000..ae1167c
--- /dev/null
+++ b/templates/clean.html.ep
@@ -0,0 +1,85 @@
+% if (@{$departures}) {
+
+<div class="displayclean">
+<ul>
+% my $i = 0;
+% for my $departure (@{$departures}) {
+% $i++;
+
+<li>
+<span class="line">
+%= $departure->{train}
+</span>
+% if ($departure->{moreinfo} and @{$departure->{moreinfo}}) {
+<span class="moreinfo">
+<ul>
+% for my $pair (@{$departure->{moreinfo}}) {
+<li>
+% if ($pair->[0]->isa('DateTime')) {
+%= $pair->[0]->strftime('%H:%M')
+% }
+% else {
+%= $pair->[0]
+% }
+:
+<span class="reason">
+%= $pair->[1]
+</span>
+</li>
+% }
+</ul>
+</span>
+% }
+% if ($departure->{info} and length $departure->{info}) {
+<span class="info">
+%= $departure->{info}
+</span>
+% }
+% else {
+<span class="route">
+% my $via_max = @{$departure->{via}};
+% my $via_cur = 0;
+% for my $stop (@{$departure->{via}}) {
+% $via_cur++;
+<%= $stop %><% if ($via_cur < $via_max) { %> - <% } %>
+% }
+</span>
+% }
+<span class="dest">
+%= $departure->{destination}
+</span>
+<span class="countdown">
+% if ($departure->{delay}) {
+<span class="delay">(+<%= $departure->{delay} %>)</span>
+% }
+<span class="platform">
+%= $departure->{platform}
+</span>
+</span>
+<span class="time">
+%= $departure->{time}
+</span>
+</li>
+
+<!--
+% if ($departure->{info}) {
+<div class="info">
+%= $departure->{info}
+</div>
+% }
+-->
+
+% }
+
+</ul>
+</div> <!-- displayclean -->
+
+% }
+% else {
+
+<p>
+DB-Fakedisplay displays the next departures at a DB station, just like the big
+LC display in the station itself.
+</p>
+
+% }
diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep
new file mode 100644
index 0000000..8600b8f
--- /dev/null
+++ b/templates/layouts/default.html.ep
@@ -0,0 +1,140 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title><%= $title %></title>
+ <meta charset="utf-8">
+% if ($self->stash('refresh_interval')) {
+ <meta http-equiv="refresh" content="<%= $self->stash('refresh_interval') %>"/>
+% }
+
+
+ %= stylesheet '/default.css'
+ %= javascript '/jquery-1.10.2.min.js'
+ %= javascript '/marquee.js'
+ %= javascript begin
+ $(function () { $('marquee').marquee() });
+ % end
+</head>
+<body style="<%= ($hide_opts ? 'margin: 0; padding: 0;' : q{}) %>">
+
+% if (my $error = stash 'error') {
+<div class="error">Received an error from the backend service:</div>
+<div>
+<pre>
+%= $error
+</pre>
+</div>
+% }
+
+%= content
+
+% if (not $hide_opts) {
+<div class="input-field">
+
+
+%= form_for _redirect => begin
+<div>
+ <div class="field">
+ <div class="desc">Station name</div>
+ <div>
+% if (stash('stationlist')) {
+ %= select_field station => stash('stationlist')
+% }
+% else {
+ %= text_field 'station'
+% }
+ %= submit_button 'Display'
+ </div>
+ </div>
+ <div class="break"></div>
+ <span class="optional">optional:</span>
+ <div class="field">
+ <div class="desc">
+ only display routes via
+ </div>
+ <div>
+ %= text_field 'via'
+ </div>
+ </div>
+ <div class="field">
+ <div class="desc">
+ on platforms
+ </div>
+ <div>
+ %= text_field 'platforms'
+ </div>
+ </div>
+ <div class="field">
+ <div class="desc">
+ hide delay &lt; 5 minutes
+ </div>
+ <div>
+ %= check_box 'hidelowdelay' => 1
+ </div>
+ </div>
+ <div class="field">
+ <div class="desc">
+ display type
+ </div>
+ <div>
+ %= select_field mode => [['combined' => 'multi'], ['platform' => 'single'], ['non-DB' => 'clean']]
+ </div>
+ </div>
+ <div class="field">
+ <div class="desc">
+ backend
+ </div>
+ <div>
+ %= select_field backend => [['RIS' => 'ris'], ['IRIS' => 'iris']]
+ </div>
+ </div>
+ <div class="field">
+ <div class="desc">
+ hide input fields
+ </div>
+ <div>
+ %= check_box 'hide_opts' => 1
+ </div>
+ </div>
+</div>
+% end
+
+</div> <!-- input-field -->
+
+<div class="notes">
+<span class="notes">notes:</span>
+<ul>
+<li>Umlauts do not work reliably. Try either ä → ae or ä → a</li>
+</ul>
+</div> <!-- notes -->
+
+<div class="notes">
+<span class="notes">examples:</span>
+<ul>
+<li><a href="/Essen%20Hbf">Essen HBf</a> (RIS, combined table)</li>
+<li><a href="/Dortmund/Bochum%7CHamm">Dortmund HBf</a> (RIS, combined table,
+only routes via Bochum or Hamm)</li>
+<li><a href="/Dortmund%20Uni?mode=clean&backend=iris">Dortmund Universit&auml;t</a> (IRIS, mobile view)</li>
+<li><a href="/KD?mode=single&backend=iris">D&uuml;sseldorf HBf</a> (IRIS, platform view)</li>
+</ul>
+</div>
+
+<div class="notes">
+<span class="notes">see also:</span>
+<ul>
+<li><a href="http://reiseauskunft.bahn.de/bin/bhftafel.exe/dn">DeutscheBahn RIS</a></li>
+<li><a href="https://iris.noncd.db.de/wbt/js/index.html?typ=ab&amd;style=qrab&amp;bhf=EE&amp;SecLang=&amp;Zeilen=40&amp;footer=0&amp;disrupt=1"
+>DeutscheBahn IRIS</a> (see <a href="http://www.db-netz.de/file/2361656/data/betriebsstellen.pdf">betriebsstellen.pdf</a>)</li>
+<li><a href="http://www.frubi.net/iris/?station=Essen%20HBf">frubi.net arrival/departure monitor</a></li>
+<li><a href="http://vrrf.finalrewind.org/">vrr-fakedisplay</a></li>
+</ul>
+</div> <!-- notes -->
+
+<div class="about">
+<a href="http://finalrewind.org/projects/db-fakedisplay/">db-fakedisplay</a>
+v<%= $version %>
+</div>
+% }
+
+</body>
+</html>
diff --git a/templates/multi.html.ep b/templates/multi.html.ep
new file mode 100644
index 0000000..26f3433
--- /dev/null
+++ b/templates/multi.html.ep
@@ -0,0 +1,56 @@
+% if (@{$departures}) {
+
+<div class="displaymulti">
+% my $i = 0;
+% for my $departure (@{$departures}) {
+% $i++;
+
+<div class="display <% if (($i % 2) == 0) { %> separator<% } %>">
+<div class="platform">
+%= $departure->{platform}
+</div>
+
+<div class="time">
+%= $departure->{time}
+</div>
+
+<div class="train">
+%= $departure->{train}
+</div>
+
+<div class="via">
+% my $via_max = @{$departure->{via}};
+% my $via_cur = 0;
+% for my $stop (@{$departure->{via}}) {
+% $via_cur++;
+<span><%= $stop %><% if ($via_cur < $via_max) { %> - <% } %></span>
+% }
+</div>
+
+<div class="destination">
+%= $departure->{destination}
+</div>
+
+% if ($departure->{info}) {
+<div class="info">
+<marquee behavior="scroll" scrollamount="1" direction="left">
+%= $departure->{info}
+</marquee>
+</div>
+% }
+
+</div> <!-- display -->
+
+% }
+
+</div> <!-- displaymulti -->
+
+% }
+% else {
+
+<p>
+DB-Fakedisplay displays the next departures at a DB station, just like the big
+LC display in the station itself.
+</p>
+
+% }
diff --git a/templates/not_found.html.ep b/templates/not_found.html.ep
new file mode 100644
index 0000000..ca1fb5f
--- /dev/null
+++ b/templates/not_found.html.ep
@@ -0,0 +1,13 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <title>page not found</title>
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
+</head>
+<body>
+<div>
+page not found
+</div>
+</body>
+</html>
diff --git a/templates/single.html.ep b/templates/single.html.ep
new file mode 100644
index 0000000..7376eb4
--- /dev/null
+++ b/templates/single.html.ep
@@ -0,0 +1,54 @@
+% if (@{$departures}) {
+
+<div class="displaysingle">
+% my $i = 0;
+% for my $departure (@{$departures}) {
+% $i++;
+<div class="display">
+<div class="platform">
+%= $departure->{platform}
+</div>
+<div class="time">
+%= $departure->{time}
+</div>
+<div class="train">
+%= $departure->{train}
+</div>
+<div class="via">
+% my $via_max = @{$departure->{via}};
+% my $via_cur = 0;
+% for my $stop (@{$departure->{via}}) {
+% $via_cur++;
+<span><%= $stop %><% if ($via_cur < $via_max) { %> - <% } %></span>
+% }
+</div>
+<div class="destination">
+%= $departure->{destination}
+</div>
+% if ($departure->{info}) {
+<div class="info">
+<marquee behaviour="scroll" scrollamount="1" direction="left">
+%= $departure->{info}
+</marquee>
+</div>
+% }
+</div> <!-- display -->
+% }
+
+</div> <!-- displaysingle -->
+
+% }
+% else {
+
+<div class="display">
+<div class="no_data">
+Bitte Ansage beachten
+</div>
+</div>
+
+<p>
+DB-Fakedisplay displays the next departures at a DB station, just like the big
+LC display in the station itself.
+</p>
+
+% }