summaryrefslogtreecommitdiff
path: root/templates/journey.html.ep
diff options
context:
space:
mode:
authorDerf Null <derf@finalrewind.org>2023-05-01 10:06:30 +0200
committerDerf Null <derf@finalrewind.org>2023-05-01 10:06:30 +0200
commite4a07dc06cca76aae0a8174c564469527a4dd818 (patch)
tree88cf71c6992a3eed5745201e6dca4e22d396aabb /templates/journey.html.ep
parentc8624786456b5a1dcd9adecde34a819400b876ae (diff)
journey: show times of intermediate stops, if available
Diffstat (limited to 'templates/journey.html.ep')
-rw-r--r--templates/journey.html.ep24
1 files changed, 23 insertions, 1 deletions
diff --git a/templates/journey.html.ep b/templates/journey.html.ep
index 696329f..f85efeb 100644
--- a/templates/journey.html.ep
+++ b/templates/journey.html.ep
@@ -208,6 +208,7 @@
<tr>
<th scope="row">Route</th>
<td>
+ % my $before = 1;
% my $within = 0;
% my $at_startstop = 0;
% for my $station (@{$journey->{route}}) {
@@ -220,8 +221,16 @@
% else {
% $at_startstop = 0;
% }
+ <span style="color: #808080;">
+ % if ($before and $station->[2]{sched_dep}) {
+ %= $station->[2]{sched_dep}->strftime('%H:%M')
+ % }
+ % elsif (not $before and $station->[2]{sched_arr}) {
+ %= $station->[2]{sched_arr}->strftime('%H:%M')
+ % }
+ </span>
% if ($at_startstop or $within) {
- <%= $station->[0] %>
+ %= $station->[0]
% }
% else {
<span style="color: #808080;"><%= $station->[0] %></span>
@@ -229,6 +238,19 @@
% if ($journey->{edited} & 0x0010) {
% }
+ % if ($within or $at_startstop) {
+ <span style="color: #808080;">
+ % if ($before and $station->[2]{rt_dep} and $station->[2]{dep_delay}) {
+ %= sprintf('%+d → %s', $station->[2]{dep_delay}, $station->[2]{rt_dep}->strftime('%H:%M'))
+ % }
+ % elsif (not $before and $station->[2]{rt_arr} and $station->[2]{arr_delay}) {
+ %= sprintf('%+d → %s', $station->[2]{arr_delay}, $station->[2]{rt_arr}->strftime('%H:%M'))
+ % }
+ </span>
+ % }
+ % if ($station->[0] eq $journey->{from_name}) {
+ % $before = 0;
+ % }
<br/>
% }
</td>