From f692717e7148365813d3f65b7b350e6090159293 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 28 Apr 2015 11:59:54 +0200 Subject: add replacement infos to clean display --- index.pl | 4 ++++ public/default.css | 16 ++++++++++++++++ templates/clean.html.ep | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/index.pl b/index.pl index f76991c..f779291 100644 --- a/index.pl +++ b/index.pl @@ -440,6 +440,10 @@ sub handle_request { delay => $delay, additional_stops => [ $result->additional_stops ], canceled_stops => [ $result->canceled_stops ], + replaced_by => $result->can('replaced_by') + ? [ map { $_->type . q{ } . $_->train_no } $result->replaced_by ] : [], + replacement_for => $result->can('replacement_for') + ? [ map { $_->type . q{ } . $_->train_no } $result->replacement_for ] : [], } ); } diff --git a/public/default.css b/public/default.css index 0f98d63..6d59b03 100644 --- a/public/default.css +++ b/public/default.css @@ -42,6 +42,22 @@ div.displayclean li .line { left:2px; } +div.displayclean li .lineinfo { + color:#000000; + font-size: 2em; + position:absolute; + bottom:2px; + left:2px; +} + +div.displayclean li .lineinfo .replacement { + color: #006600; +} + +div.displayclean li .lineinfo .replaced { + color: #660000; +} + div.displayclean li .tram { background-color: #CC0000; } diff --git a/templates/clean.html.ep b/templates/clean.html.ep index 3514b87..3e4ad86 100644 --- a/templates/clean.html.ep +++ b/templates/clean.html.ep @@ -25,6 +25,16 @@ %= $departure->{train} +% if (@{$departure->{replaced_by}} or @{$departure->{replacement_for}}) { + +% for my $replacement (@{$departure->{replaced_by}}) { +→ <%= $replacement %> +% } +% for my $replacement (@{$departure->{replacement_for}}) { +↑ <%= $replacement %> +% } + +% } % if ($departure->{moreinfo} and @{$departure->{moreinfo}}) {