From 88da26860bdbfea46b29ef83becb814edb92d10a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 5 Dec 2014 22:17:17 +0100 Subject: clean template: show route in moreinfo when it is overwritten by info --- templates/clean.html.ep | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'templates') diff --git a/templates/clean.html.ep b/templates/clean.html.ep index 86a3d03..215f098 100644 --- a/templates/clean.html.ep +++ b/templates/clean.html.ep @@ -5,6 +5,13 @@ % my $i = 0; % for my $departure (@{$departures}) { % $i++; +% my $route_str = q{}; +% my $via_max = @{$departure->{via}}; +% my $via_cur = 0; +% for my $stop (@{$departure->{via}}) { +% $via_cur++; +% $route_str .= $stop . ($via_cur < $via_max ? ' - ' : q{}); +% }
  • % my $linetype = q{}; @@ -17,6 +24,9 @@ % if ($departure->{moreinfo} and @{$departure->{moreinfo}}) {
      +% if ($route_str) { +
    • Via: <%= $route_str %>
    • +% } % for my $pair (@{$departure->{moreinfo}}) {
    • % if ($pair->[0]->isa('DateTime')) { @@ -41,12 +51,7 @@ % } % else { -% my $via_max = @{$departure->{via}}; -% my $via_cur = 0; -% for my $stop (@{$departure->{via}}) { -% $via_cur++; -<%= $stop %><% if ($via_cur < $via_max) { %> - <% } %> -% } +%= $route_str % } % my $extraclasses = q{}; -- cgit v1.2.3