From 867d3514e483231d51e5b0a409674cccf9b9e180 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 15 Aug 2011 23:13:05 +0200 Subject: cgi: Minor HTML/Style improvements --- cgi/index.pl | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/cgi/index.pl b/cgi/index.pl index 23f08f3..424f07c 100644 --- a/cgi/index.pl +++ b/cgi/index.pl @@ -30,6 +30,9 @@ sub get_results_for { get '/' => sub { my $self = shift; my $station = $self->param('station'); + + $self->stash( 'version', $VERSION ); + if ( not $station ) { return $self->render; } @@ -47,6 +50,8 @@ get '/:station' => sub { ); my @results = get_results_for($station); + $self->stash( 'version', $VERSION ); + if ( not @results ) { $self->render( 'index', error => "Got no results for '$station'", ); return; @@ -74,7 +79,7 @@ get '/:station' => sub { }; get '/multi/:station' => sub { - my $self = shift; + my $self = shift; my $station = $self->stash('station'); $self->redirect_to("/${station}"); }; @@ -90,6 +95,22 @@ __DATA__ DB Fakedisplay +
@@ -102,11 +123,23 @@ LC display in the station itself. Error: <%= $error %>
<% } %> <%= form_for index => begin %> +

Station name:
<%= text_field 'station' %>
<%= submit_button 'Display' %> +

<% end %> +

+(For example: "Koeln Hbf" or "Essen West") +

+ +

+This is db-fakedisplay +v<%= $version %> +

+
-- cgit v1.2.3