From 0cf1c5d658bd816a673cb35e08b7e03050150b24 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 12 Aug 2012 20:52:09 +0200 Subject: move non-display part to layout --- cgi/index.pl | 67 ++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 31 deletions(-) (limited to 'cgi/index.pl') diff --git a/cgi/index.pl b/cgi/index.pl index bd36ec1..0f3af77 100644 --- a/cgi/index.pl +++ b/cgi/index.pl @@ -88,6 +88,8 @@ get '/_redirect' => sub { } }; +app->defaults( layout => 'default' ); + get '/' => \&handle_request; get '/:station' => \&handle_request; get '/:station/:via' => \&handle_request; @@ -106,7 +108,7 @@ app->start(); __DATA__ -@@ multi.html.ep +@@ layouts/default.html.ep @@ -217,6 +219,39 @@ __DATA__ +<%= content %> + +
+ +<% if (my $error = stash 'error') { %> +

+ Error: <%= $error %>
+

+<% } %> + +<%= form_for _redirect => begin %> +

+ Station name + <%= text_field 'station' %> +
+ only display routes via + <%= text_field 'via' %> + (optional) + <%= submit_button 'Display' %> +

+<% end %> + +
+ +
+db-fakedisplay +v<%= $version %> +
+ + + + +@@ multi.html.ep % if (@{$departures}) {
@@ -272,36 +307,6 @@ LC display in the station itself. % } -
- -<% if (my $error = stash 'error') { %> -

- Error: <%= $error %>
-

-<% } %> - -<%= form_for _redirect => begin %> -

- Station name - <%= text_field 'station' %> -
- only display routes via - <%= text_field 'via' %> - (optional) - <%= submit_button 'Display' %> -

-<% end %> - -
- -
-db-fakedisplay -v<%= $version %> -
- - - - @@ not_found.html.ep -- cgit v1.2.3