summaryrefslogtreecommitdiff
path: root/cgi/templates
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2013-02-09 23:42:41 +0100
committerDaniel Friesel <derf@finalrewind.org>2013-02-09 23:42:41 +0100
commit04bc3f1518027c28700edfb4e83528dde1cff1e4 (patch)
tree93dade20c1a2c7f51fd035b0a4fe04a1b99500ad /cgi/templates
parent23f2b872698cd2584dbf9ca4fda3878f2c87eaec (diff)
move main.html.ep to templates directory, remove now unneeded not_found.html.ep
Diffstat (limited to 'cgi/templates')
-rw-r--r--cgi/templates/main.html.ep153
1 files changed, 153 insertions, 0 deletions
diff --git a/cgi/templates/main.html.ep b/cgi/templates/main.html.ep
new file mode 100644
index 0000000..6686ff6
--- /dev/null
+++ b/cgi/templates/main.html.ep
@@ -0,0 +1,153 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title><%= $title %></title>
+ <meta charset="utf-8">
+ <style type="text/css">
+
+ body {
+ font-family: Sans-Serif;
+ }
+
+ div.about {
+ margin-top: 2em;
+ color: #666666;
+ }
+
+ div.about a {
+ color: #000066;
+ text-decoration: none;
+ }
+
+ span.optional {
+ color: #666666;
+ }
+
+ div.break {
+ height: 1em;
+ }
+
+ div.field {
+ width: 100%;
+ clear: both;
+ }
+
+ div.field div.desc {
+ float: left;
+ width: 14em;
+ text-align: right;
+ padding-right: 0.5em;
+ }
+
+ input, select {
+ border: 1px solid black;
+ }
+
+ div.notes {
+ margin-top: 4em;
+ }
+
+ div.notes ul {
+ margin-top: 1em;
+ }
+
+ </style>
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
+</head>
+<body>
+
+% if ($city and $stop) {
+<img src="../<%= $city %>/<%= $stop %>.png?<%= $params %>" alt=""
+id="display" height="<%= $height * 4 %>" width="<%= $width * 4 %>"/>
+% }
+% else {
+
+<p>
+VRR-Fakedisplay shows the next departures at a public transit stop, just like
+the Lumino LED displays used at some stops.
+</p>
+
+<p>
+It works best for the VRR (Verkehrsverbund Rhein-Ruhr), but also supports most
+other German transit networks.
+</p>
+
+% }
+
+<div class="input-field">
+
+<% if (my $error = stash 'error') { %>
+<p>
+ Error: <%= $error %><br/>
+</p>
+<% } %>
+
+<%= form_for _redirect => begin %>
+<div>
+ <div class="field">
+ <div class="desc">City &rarr; Stop</div>
+ <div>
+ <%= text_field 'city' %>
+ <%= text_field 'stop' %>
+ <%= submit_button 'Display' %>
+ </div>
+ </div>
+ <div class="break"></div>
+ <span class="optional">optional:</span>
+ <div class="field">
+ <div class="desc" title="number of lines">
+ display height [1..10]</div>
+ <div> <%= text_field 'no_lines' %></div>
+ </div>
+ <div class="field">
+ <div class="desc">min. offset [minutes]</div>
+ <div><%= text_field 'offset' %></div>
+ </div>
+ <div class="field">
+ <div class="desc" title="comma-separated list, example: NE,U,10">
+ match line prefix</div>
+ <div><%= text_field 'line' %></div>
+ </div>
+ <div class="field">
+ <div class="desc" title="comma-separated list. Buggy.">match platform</div>
+ <div><%= text_field 'platform' %></div>
+ </div>
+ <div class="field">
+ <div class="desc">backend</div>
+ <div><%= select_field backend => [['EFA (VRR)' => 'vrr'], ['HAFAS (DB)' => 'db']] %></div>
+ </div>
+</div>
+<% end %>
+
+</div> <!-- input-field -->
+
+<div class="notes">
+<span class="optional">notes:</span>
+<ul>
+<li>The EFA backend does not support Umlauts</li>
+<li>For D&uuml;sseldorf, the DB backend usually gives better results</li>
+<li>If you write the city correctly (like "Essen", not "essen"), vrr-fake can
+shorten destination names</li>
+<li><a href="/Essen/Martinstr?no_lines=8">Example</a>
+</li>
+</ul>
+</div> <!-- notes -->
+
+<div class="about">
+<a href="http://finalrewind.org/projects/vrr-fakedisplay/">vrr-fakedisplay</a>
+v<%= $version %>
+</div>
+
+</body>
+
+<script type="text/javascript">
+function reloadDisplay() {
+ d = new Date();
+ $("#display").attr("src", "../<%= $city %>/<%= $stop %>.png?<%= $params %>&r="+d.getTime())
+ setTimeout('reloadDisplay()', 60000);
+}
+
+setTimeout('reloadDisplay()', 60000);
+</script>
+
+</html>