From 2366b193fef9f0118d08071f564a446733dcfb33 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 20 Mar 2019 18:20:23 +0100 Subject: journey: show distance --- templates/journey.html.ep | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/templates/journey.html.ep b/templates/journey.html.ep index e00fdc2..a9c0c0b 100644 --- a/templates/journey.html.ep +++ b/templates/journey.html.ep @@ -32,7 +32,7 @@ <%= $journey->{type} %> <%= $journey->{no} %> % if ($journey->{line}) { - (Linie <%= $journey->{type} %> <%= $journey->{line} %>) + (Linie <%= $journey->{line} %>) % } @@ -75,6 +75,17 @@ % } + + Entfernung + + % my $distance = get_travel_distance($journey->{from_name}, $journey->{to_name}, $journey->{route}); + % my $beeline = get_travel_distance($journey->{from_name}, $journey->{to_name}, [$journey->{from_name}, $journey->{to_name}]); + % if ($distance > 0.1) { + ca. <%= sprintf('%.f', $distance) %> km + % } + (Luftlinie: <%= sprintf('%.f', $beeline) %> km) + + Meldungen -- cgit v1.2.3