summaryrefslogtreecommitdiff
path: root/templates/journey.html.ep
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-03-20 18:20:23 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-03-20 18:20:23 +0100
commit2366b193fef9f0118d08071f564a446733dcfb33 (patch)
tree165aec850a45a7ad3d5a2f8734d79c499e051c17 /templates/journey.html.ep
parentef8b688eb19abf5b93a81b710316a93a349baaa3 (diff)
journey: show distance
Diffstat (limited to 'templates/journey.html.ep')
-rw-r--r--templates/journey.html.ep13
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} // []}) {