From 4dec7f383e0967c04f71bc2c373cb712a662361e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 10 Nov 2011 20:54:18 +0100 Subject: cgi: Fix lines / no_lines --- cgi/index.pl | 11 ++++++----- 1 file 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' %>
(optional) number of lines (1 .. 10): - <%= text_field 'lines' %> + <%= text_field 'no_lines' %>

<% end %> -- cgit v1.2.3