diff options
author | Daniel Friesel <derf@finalrewind.org> | 2015-04-28 11:59:54 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2015-04-28 11:59:54 +0200 |
commit | f692717e7148365813d3f65b7b350e6090159293 (patch) | |
tree | 53f7aa851187efc6fe37af1f8b22bf255a6c8b50 | |
parent | 2813f25668ba9844d00d3f40181f839ecebf38e4 (diff) |
add replacement infos to clean display0.06
-rw-r--r-- | index.pl | 4 | ||||
-rw-r--r-- | public/default.css | 16 | ||||
-rw-r--r-- | templates/clean.html.ep | 10 |
3 files changed, 30 insertions, 0 deletions
@@ -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 @@ <span class="line <%= $linetype %> <%= $extraclasses %>"> %= $departure->{train} </span> +% if (@{$departure->{replaced_by}} or @{$departure->{replacement_for}}) { +<span class="lineinfo"> +% for my $replacement (@{$departure->{replaced_by}}) { +<span class="replaced">→ <%= $replacement %></span> +% } +% for my $replacement (@{$departure->{replacement_for}}) { +<span class="replacement">↑ <%= $replacement %></span> +% } +</span> +% } % if ($departure->{moreinfo} and @{$departure->{moreinfo}}) { <span class="moreinfo"> <ul> |