summaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-11-10 20:54:18 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-11-10 20:54:18 +0100
commit4dec7f383e0967c04f71bc2c373cb712a662361e (patch)
tree21fcc380cb392896e34ac2ec87a3509d28063983 /cgi
parent6f9b1c88bff082773e3c318a49f41103dadeb9ae (diff)
cgi: Fix lines / no_lines
Diffstat (limited to 'cgi')
-rw-r--r--cgi/index.pl11
1 files changed, 6 insertions, 5 deletions
diff --git a/cgi/index.pl b/cgi/index.pl
index c503cf3..66134e1 100644
--- a/cgi/index.pl
+++ b/cgi/index.pl
@@ -41,7 +41,7 @@ sub handle_request {
my $city = $self->stash('city');
my $stop = $self->stash('stop');
- my $no_lines = $self->param('lines');
+ my $no_lines = $self->param('no_lines');
if ($no_lines < 1 or $no_lines > 10) {
$no_lines = default_no_lines();
@@ -90,7 +90,7 @@ sub render_image {
my $dt_now = DateTime->now( time_zone => 'Europe/Berlin' );
my $color = $self->param('color') || '255,208,0';
- my $no_lines = $self->param('lines');
+ my $no_lines = $self->param('no_lines');
my ( @grep_line, @grep_platform );
@@ -197,8 +197,9 @@ get '/_redirect' => sub {
$params->remove('city');
$params->remove('stop');
- if ($params->param('lines') == default_no_lines()) {
- $params->remove('lines');
+ if (not $params->param('no_lines') or $params->param('no_lines') ==
+ default_no_lines()) {
+ $params->remove('no_lines');
}
my $params_s = $params->to_string;
@@ -274,7 +275,7 @@ local transit networks as well.
<%= submit_button 'Display' %>
<div class="break"></div>
(optional) number of lines (1 .. 10):
- <%= text_field 'lines' %>
+ <%= text_field 'no_lines' %>
<br/>
</p>
<% end %>