diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-03-20 18:20:23 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-03-20 18:20:23 +0100 |
commit | 2366b193fef9f0118d08071f564a446733dcfb33 (patch) | |
tree | 165aec850a45a7ad3d5a2f8734d79c499e051c17 /templates/journey.html.ep | |
parent | ef8b688eb19abf5b93a81b710316a93a349baaa3 (diff) |
journey: show distance
Diffstat (limited to 'templates/journey.html.ep')
-rw-r--r-- | templates/journey.html.ep | 13 |
1 files changed, 12 insertions, 1 deletions
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 @@ <td> <%= $journey->{type} %> <%= $journey->{no} %> % if ($journey->{line}) { - (Linie <%= $journey->{type} %> <%= $journey->{line} %>) + (Linie <%= $journey->{line} %>) % } </td> </tr> @@ -76,6 +76,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> % for my $message (@{$journey->{messages} // []}) { |