From 690b941af328c79cd3e78fb6a43560969d3ee574 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 25 Oct 2020 13:55:21 +0100 Subject: map infobox: only show platform line if the platform is known --- templates/_map_infobox.html.ep | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'templates') diff --git a/templates/_map_infobox.html.ep b/templates/_map_infobox.html.ep index f1da392..42e121d 100644 --- a/templates/_map_infobox.html.ep +++ b/templates/_map_infobox.html.ep @@ -15,7 +15,9 @@ data-poly="<%= stash('ajax_polyline') %>"
% if ($next->{type} eq 'present' and $next->{station}{dep} and $next->{station}{arr}) { Aufenthalt in <%= $next->{station}{name} %> - an Gleis <%= $next->{station}{platform} %> + % if ($next->{station}{platform}) { + an Gleis <%= $next->{station}{platform} %> + % } bis <%= $next->{station}{dep}->strftime('%H:%M') %> % if ($next->{station}{dep_delay}) { %= sprintf('(%+d)', $next->{station}{dep_delay}) @@ -23,7 +25,9 @@ data-poly="<%= stash('ajax_polyline') %>" % } % elsif ($next->{type} eq 'present' and $next->{station}{dep}) { Abfahrt in <%= $next->{station}{name} %> - von Gleis <%= $next->{station}{platform} %> + % if ($next->{station}{platform}) { + von Gleis <%= $next->{station}{platform} %> + % } um <%= $next->{station}{dep}->strftime('%H:%M') %> % if ($next->{station}{dep_delay}) { %= sprintf('(%+d)', $next->{station}{dep_delay}) @@ -32,7 +36,9 @@ data-poly="<%= stash('ajax_polyline') %>" % elsif ($next->{type} eq 'present' and $next->{station}{arr}) { Endstation erreicht um <%= $next->{station}{arr}->strftime('%H:%M') %> - auf Gleis <%= $next->{station}{platform} %> + % if ($next->{station}{platform}) { + auf Gleis <%= $next->{station}{platform} %> + % } % if ($next->{station}{arr_delay}) { %= sprintf('(%+d)', $next->{station}{arr_delay}) % } @@ -40,7 +46,9 @@ data-poly="<%= stash('ajax_polyline') %>" % elsif ($next->{type} eq 'present' and $next->{station}{arr}) { Zug steht in <%= $next->{station}{arr}->strftime('%H:%M') %> - auf Gleis <%= $next->{station}{platform} %> + % if ($next->{station}{platform}) { + auf Gleis <%= $next->{station}{platform} %> + % } % } % elsif ($next->{type} eq 'next' and $next->{station}{arr}) { Nächster Halt: @@ -49,12 +57,16 @@ data-poly="<%= stash('ajax_polyline') %>" % if ($next->{station}{arr_delay}) { %= sprintf('(%+d)', $next->{station}{arr_delay}) % } - auf Gleis <%= $next->{station}{platform} %> + % if ($next->{station}{platform}) { + auf Gleis <%= $next->{station}{platform} %> + % } % } % elsif ($next->{type} eq 'next') { Nächster Halt: <%= $next->{station}{name} %> - auf Gleis <%= $next->{station}{platform} %> + % if ($next->{station}{platform}) { + auf Gleis <%= $next->{station}{platform} %> + % } % }
% } -- cgit v1.2.3