From 5bca4819dd35226886e85adf6e6c3cebdf1fb00a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 20 Aug 2014 18:49:36 +0200 Subject: move application from cgi directory to project root --- templates/display.html.ep | 23 ++++++ templates/infoscreen.html.ep | 71 ++++++++++++++++++ templates/main.html.ep | 169 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 263 insertions(+) create mode 100644 templates/display.html.ep create mode 100644 templates/infoscreen.html.ep create mode 100644 templates/main.html.ep (limited to 'templates') diff --git a/templates/display.html.ep b/templates/display.html.ep new file mode 100644 index 0000000..e65fdc9 --- /dev/null +++ b/templates/display.html.ep @@ -0,0 +1,23 @@ + + + + <%= $title %> + + %= stylesheet '/display.css' + %= javascript '/jquery-2.1.1.min.js' + + + +
+% for my $d (@{$departures}) { +
+
<%= $d->[0] %>
+
<%= $d->[1] %>
+
<%= $d->[2] %>
+
+% } +
+ + + diff --git a/templates/infoscreen.html.ep b/templates/infoscreen.html.ep new file mode 100644 index 0000000..47c435c --- /dev/null +++ b/templates/infoscreen.html.ep @@ -0,0 +1,71 @@ + + + + <%= $title %> + +% if ($self->stash('refresh_interval')) { + +% } + + %= stylesheet '/infoscreen.css' + %= javascript '/jquery-2.1.1.min.js' + + + +% if (my $error = stash 'error') { +
Received an error from the backend service:
+
+
+%= $error
+
+
+% } + +
+ +
+ +
+db-fakedisplay +v<%= $version %> +
+ + + diff --git a/templates/main.html.ep b/templates/main.html.ep new file mode 100644 index 0000000..8f42291 --- /dev/null +++ b/templates/main.html.ep @@ -0,0 +1,169 @@ + + + + <%= $title %> + + %= stylesheet '/main.css' + %= javascript '/jquery-2.1.1.min.js' + %= javascript '/image.js' + + + +% if ($city and $stop) { +% if ($errstr) { +
Received an error from the backend service:
+
+
+%= $errstr
+
+
+% } +% elsif ($frontend eq 'png') { + +% } +% elsif ($frontend eq 'html') { + +% } +% elsif ($frontend eq 'infoscreen') { +

+Infoscreen for +<%= $city %> <%= $stop %> +

+Preview:
+ +% } +% elsif ($frontend eq 'json') { +

+JSON data for +<%= $city %> <%= $stop %> +

+

+Data is cached for 1 minute: JSON format: +

+ +% } +% } # ($city and $stop) +% else { + +

+VRR-Fakedisplay shows the next departures at a public transit stop, just like +the Lumino LED displays used at some stops. +

+ +

+It works best for the VRR (Verkehrsverbund Rhein-Ruhr), but also supports most +other German transit networks. +

+ +% } + +
+ +% if (my $error = stash 'error') { +

+ Error: <%= $error %>
+

+% } + +%= form_for _redirect => begin +
+
+
City → Stop
+
+ %= text_field 'city' + %= text_field 'stop' + %= submit_button 'Display' +
+
+
+ optional: +
+
+ display height [1..10]
+
+ %= text_field 'no_lines' +
+
+
+
min. offset [minutes]
+
+ %= text_field 'offset' +
+
+
+
+ match line prefixes¹
+
+ %= text_field 'line' +
+
+
+
match platform¹
+
+ %= text_field 'platform' +
+
+
+
backend
+
+ %= select_field backend => [['EFA (VRR)' => 'vrr'], ['HAFAS (DB)' => 'db']] +
+
+
+
frontend
+
+ %= select_field frontend => [['Image (PNG)' => 'png'], ['HTML' => 'html'], ['Infoscreen' => 'infoscreen'], ['JSON' => 'json']] +
+
+
+% end + +

+¹ separate values with commas, e.g. NE,U,10 +

+
+ +
+notes: + +
+ +
+vrr-fakedisplay +v<%= $version %> +
+ + + -- cgit v1.2.3