summaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2013-11-09 14:34:07 +0100
committerDaniel Friesel <derf@finalrewind.org>2013-11-09 14:34:07 +0100
commitc6ce3e596322017e38c70a6cd823e63cef2609c4 (patch)
tree73532221c907e0bd5eddee6e71d7ec6befa6e2d7 /cgi
parent43a01bc21db61bc975c2c0327a82ac62810df491 (diff)
add hide_opts option
Diffstat (limited to 'cgi')
-rw-r--r--cgi/index.pl10
-rw-r--r--cgi/templates/layouts/default.html.ep2
2 files changed, 10 insertions, 2 deletions
diff --git a/cgi/index.pl b/cgi/index.pl
index b2ded48..48583fc 100644
--- a/cgi/index.pl
+++ b/cgi/index.pl
@@ -40,6 +40,7 @@ sub handle_request {
my @platforms = split( /,/, $self->param('platforms') // q{} );
my $template = $self->param('mode') // 'multi';
my $hide_low_delay = $self->param('hidelowdelay') // 0;
+ my $hide_opts = $self->param('hide_opts') // 0;
$self->stash( departures => [] );
$self->stash( title => 'db-fakedisplay' );
@@ -50,7 +51,7 @@ sub handle_request {
}
if ( not $station ) {
- $self->render($template);
+ $self->render( $template, hide_opts => 0 );
return;
}
@@ -58,7 +59,11 @@ sub handle_request {
my @results = get_results_for($station);
if ( not @results ) {
- $self->render( 'multi', error => "Got no results for '$station'" );
+ $self->render(
+ 'multi',
+ error => "Got no results for '$station'",
+ hide_opts => 0
+ );
return;
}
@@ -117,6 +122,7 @@ sub handle_request {
version => $VERSION,
title => "departures for ${station}",
refresh_interval => $refresh_interval + 3,
+ hide_opts => $hide_opts,
);
}
diff --git a/cgi/templates/layouts/default.html.ep b/cgi/templates/layouts/default.html.ep
index 14bdbaa..2d64df2 100644
--- a/cgi/templates/layouts/default.html.ep
+++ b/cgi/templates/layouts/default.html.ep
@@ -229,6 +229,7 @@
%= content
+% if (not $hide_opts) {
<div class="input-field">
@@ -291,6 +292,7 @@
<a href="http://finalrewind.org/projects/db-fakedisplay/">db-fakedisplay</a>
v<%= $version %>
</div>
+% }
</body>
</html>