diff options
-rw-r--r-- | cgi/index.pl | 7 | ||||
-rw-r--r-- | cgi/templates/layouts/default.html.ep | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/cgi/index.pl b/cgi/index.pl index a525cf6..40ab878 100644 --- a/cgi/index.pl +++ b/cgi/index.pl @@ -6,7 +6,7 @@ use Travel::Status::DE::DeutscheBahn; use 5.014; use utf8; -our $VERSION = '0.03'; +our $VERSION = '0.04'; my $refresh_interval = 900; @@ -37,6 +37,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; $self->stash( departures => [] ); $self->stash( title => 'db-fakedisplay' ); @@ -89,10 +90,12 @@ sub handle_request { if ( $info eq '+0' ) { $info = undef; } + if ($hide_low_delay and $info) { + $info =~ s{ ^ (?: ca\. \s* )? \+ [ 1 2 3 4 ] $ }{}x; + } if ($info) { $info =~ s{ ^ (?: ca\. \s* )? \+ (\d+) }{Verspätung ca. $1 Min}x; - $info =~ s{ 1 \s Minute\Kn }{}x; } push( @departures, diff --git a/cgi/templates/layouts/default.html.ep b/cgi/templates/layouts/default.html.ep index 6e46cdc..02b2639 100644 --- a/cgi/templates/layouts/default.html.ep +++ b/cgi/templates/layouts/default.html.ep @@ -214,6 +214,9 @@ <%= text_field 'platforms' %> (optional) <br/> + <%= check_box 'hidelowdelay' => 1 %> + <span class="fielddesc fieldoptional">hide delay < 5 minutes</span> + <br/> <span class="fielddesc fieldoptional">display type</span> <%= select_field mode => [['combined' => 'multi'], ['platform' => 'single']] %> <%= submit_button 'Display' %> |