summaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2012-10-08 20:53:28 +0200
committerDaniel Friesel <derf@finalrewind.org>2012-10-08 20:53:28 +0200
commit23f2b872698cd2584dbf9ca4fda3878f2c87eaec (patch)
treeb503d523e6f0754c232a51ded93ab4123d5fea6c /cgi
parent5017a5727cf210abc3c52873543a866b1afdfdfe (diff)
Show "no departures" instead of empty screen0.06
Diffstat (limited to 'cgi')
-rw-r--r--cgi/index.pl9
1 files changed, 8 insertions, 1 deletions
diff --git a/cgi/index.pl b/cgi/index.pl
index edb112d..27d0fb1 100644
--- a/cgi/index.pl
+++ b/cgi/index.pl
@@ -11,7 +11,7 @@ use Travel::Status::DE::VRR;
no warnings 'uninitialized';
-our $VERSION = '0.05';
+our $VERSION = '0.06';
my %default = (
backend => 'vrr',
@@ -152,6 +152,7 @@ sub render_image {
my ( @grep_line, @grep_platform );
my $offset = 0;
+ my $displayed_lines = 0;
my ( $results, $errstr ) = get_results( $backend, $city, $stop );
@@ -258,6 +259,7 @@ sub render_image {
$png->draw_at( 0, $line );
$png->draw_at( 25, $destination );
+ $displayed_lines++;
if ( length($etr) > 2 ) {
$png->draw_at( 145, $etr );
@@ -275,6 +277,11 @@ sub render_image {
$png->new_line();
}
+ if ($displayed_lines == 0) {
+ $png->new_line();
+ $png->new_line();
+ $png->draw_at(50, 'no departures');
+ }
$self->render( data => $png->png );
}