Loading cgi/index.pl +34 −1 Original line number Diff line number Diff line Loading @@ -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; } Loading @@ -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; Loading Loading @@ -90,6 +95,22 @@ __DATA__ <head> <title>DB Fakedisplay</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <style type="text/css"> body { font-family: Sans-Serif; } p.about { color: #666666; } p.about a { color: #000066; text-decoration: none; } </style> </head> <body> <div> Loading @@ -102,11 +123,23 @@ LC display in the station itself. Error: <%= $error %><br/> <% } %> <%= form_for index => begin %> <p> Station name:<br/> <%= text_field 'station' %><br/> <%= submit_button 'Display' %> </p> <% end %> <p> (For example: "Koeln Hbf" or "Essen West") </p> <p class="about"> This is <a href="http://finalrewind.org/projects/db-fakedisplay/">db-fakedisplay</a> v<%= $version %> </p> </div> </body> </html> Loading
cgi/index.pl +34 −1 Original line number Diff line number Diff line Loading @@ -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; } Loading @@ -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; Loading Loading @@ -90,6 +95,22 @@ __DATA__ <head> <title>DB Fakedisplay</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <style type="text/css"> body { font-family: Sans-Serif; } p.about { color: #666666; } p.about a { color: #000066; text-decoration: none; } </style> </head> <body> <div> Loading @@ -102,11 +123,23 @@ LC display in the station itself. Error: <%= $error %><br/> <% } %> <%= form_for index => begin %> <p> Station name:<br/> <%= text_field 'station' %><br/> <%= submit_button 'Display' %> </p> <% end %> <p> (For example: "Koeln Hbf" or "Essen West") </p> <p class="about"> This is <a href="http://finalrewind.org/projects/db-fakedisplay/">db-fakedisplay</a> v<%= $version %> </p> </div> </body> </html>