journey: show distance

This commit is contained in:
Daniel Friesel 2019-03-20 18:20:23 +01:00
parent ef8b688eb1
commit 2366b193fe

View file

@ -32,7 +32,7 @@
<td>
<%= $journey->{type} %> <%= $journey->{no} %>
% if ($journey->{line}) {
(Linie <%= $journey->{type} %> <%= $journey->{line} %>)
(Linie <%= $journey->{line} %>)
% }
</td>
</tr>
@ -75,6 +75,17 @@
% }
</td>
</tr>
<tr>
<th scope="row">Entfernung</th>
<td>
% 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)
</td>
</tr>
<tr>
<th scope="row">Meldungen</th>
<td>