summaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2012-08-12 20:52:09 +0200
committerDaniel Friesel <derf@finalrewind.org>2012-08-12 20:52:09 +0200
commit0cf1c5d658bd816a673cb35e08b7e03050150b24 (patch)
tree1e15fd23e12188b36dd2014e5a8839ebdeb93a0d /cgi
parent354f1c62ead5512d568aae133aebdaa3bd1cfe98 (diff)
move non-display part to layout
Diffstat (limited to 'cgi')
-rw-r--r--cgi/index.pl67
1 files changed, 36 insertions, 31 deletions
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
@@ -217,6 +219,39 @@ __DATA__
</head>
<body>
+<%= content %>
+
+<div class="input-field">
+
+<% if (my $error = stash 'error') { %>
+<p>
+ Error: <%= $error %><br/>
+</p>
+<% } %>
+
+<%= form_for _redirect => begin %>
+<p>
+ <span class="fielddesc">Station name</span>
+ <%= text_field 'station' %>
+ <br/>
+ <span class="fielddesc fieldoptional">only display routes via</span>
+ <%= text_field 'via' %>
+ (optional)
+ <%= submit_button 'Display' %>
+</p>
+<% end %>
+
+</div>
+
+<div class="about">
+<a href="http://finalrewind.org/projects/db-fakedisplay/">db-fakedisplay</a>
+v<%= $version %>
+</div>
+
+</body>
+</html>
+
+@@ multi.html.ep
% if (@{$departures}) {
<div class="outer">
@@ -272,36 +307,6 @@ LC display in the station itself.
% }
-<div class="input-field">
-
-<% if (my $error = stash 'error') { %>
-<p>
- Error: <%= $error %><br/>
-</p>
-<% } %>
-
-<%= form_for _redirect => begin %>
-<p>
- <span class="fielddesc">Station name</span>
- <%= text_field 'station' %>
- <br/>
- <span class="fielddesc fieldoptional">only display routes via</span>
- <%= text_field 'via' %>
- (optional)
- <%= submit_button 'Display' %>
-</p>
-<% end %>
-
-</div>
-
-<div class="about">
-<a href="http://finalrewind.org/projects/db-fakedisplay/">db-fakedisplay</a>
-v<%= $version %>
-</div>
-
-</body>
-</html>
-
@@ not_found.html.ep
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">