From 046ad7edaf090715a37289494434081cd04a8c0c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 13 Dec 2013 11:29:58 +0100 Subject: start work on infoscreen template --- cgi/index.pl | 10 +- cgi/templates/infoscreen.html.ep | 247 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 254 insertions(+), 3 deletions(-) create mode 100644 cgi/templates/infoscreen.html.ep diff --git a/cgi/index.pl b/cgi/index.pl index d43e2b2..fd00b9f 100644 --- a/cgi/index.pl +++ b/cgi/index.pl @@ -1,6 +1,7 @@ #!/usr/bin/env perl use Mojolicious::Lite; use Cache::File; +use utf8; use DateTime; use DateTime::Format::Strptime; @@ -283,8 +284,9 @@ sub make_infoboard_lines { } sub render_html { - my $self = shift; - my $color = $self->param('color') || '255,208,0'; + my $self = shift; + my $color = $self->param('color') || '255,208,0'; + my $template = $self->param('template') || 'display'; my ( $raw_departures, $errstr ) = get_filtered_departures( city => $self->stash('city'), @@ -311,11 +313,13 @@ sub render_html { } $self->render( - 'display', + $template, title => "vrr-fakedisplay v${VERSION}", color => [ split( qr{,}, $color ) ], departures => \@departures, + raw => $raw_departures, scale => $self->param('scale') || '4.3', + version => $VERSION, ); return; diff --git a/cgi/templates/infoscreen.html.ep b/cgi/templates/infoscreen.html.ep new file mode 100644 index 0000000..068bb84 --- /dev/null +++ b/cgi/templates/infoscreen.html.ep @@ -0,0 +1,247 @@ + + + + <%= $title %> + +% if ($self->stash('refresh_interval')) { + +% } + + + + + +% if (my $error = stash 'error') { +
Received an error from the backend service:
+
+
+%= $error
+
+
+% } + +
+ +
+ +
+db-fakedisplay +v<%= $version %> +
+ + + -- cgit v1.2.3