summaryrefslogtreecommitdiff
path: root/templates/_train_details.html.ep
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-03-21 08:19:33 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-03-21 08:19:33 +0100
commit234486663dbe1712c10888121d9bf38c4cbd2cc8 (patch)
treed2527e55d2e67670c39af6aa912825fb9cfe4750 /templates/_train_details.html.ep
parentd4f528767cc904320c26b30abf8bb5d83548514b (diff)
add preliminary support for station-independent train details
Diffstat (limited to 'templates/_train_details.html.ep')
-rw-r--r--templates/_train_details.html.ep31
1 files changed, 19 insertions, 12 deletions
diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep
index 0aa3bba..9aa39ac 100644
--- a/templates/_train_details.html.ep
+++ b/templates/_train_details.html.ep
@@ -112,7 +112,12 @@
</div> <!-- dataline -->
<div class="verbose">
% if ($departure->{trip_id}) {
- <a class="smallbutton" href="/map/<%= $departure->{trip_id} %>/<%= $departure->{train_line} // 0 %>?from=<%= $station_name %>"><i class="material-icons" aria-hidden="true">map</i> Karte</a>
+% if (stash('station_name')) {
+ <a class="smallbutton" href="/map/<%= $departure->{trip_id} %>/<%= $departure->{train_line} // 0 %>?from=<%= stash('station_name') %>"><i class="material-icons" aria-hidden="true">map</i> Karte</a>
+% }
+% else {
+ <a class="smallbutton" href="/map/<%= $departure->{trip_id} %>/<%= $departure->{train_line} // 0 %>"><i class="material-icons" aria-hidden="true">map</i> Karte</a>
+% }
% }
% if ($departure->{wr_link}) {
<a class="smallbutton" href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>?e=<%= $departure->{direction} // '' %>"><i class="material-icons" aria-hidden="true">train</i> Wagenreihung
@@ -192,19 +197,21 @@
% }
</li>
% }
- <li class="<%= $departure->{is_cancelled} ? 'cancelled-stop' : q{} %>"><%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %>
-% if ($departure->{sched_departure}) {
-% if ($departure->{departure} ne $departure->{sched_departure}) {
- (heute <%= $departure->{departure} %>)
+% if (stash('station_name')) {
+ <li class="<%= $departure->{is_cancelled} ? 'cancelled-stop' : q{} %>"><%= $departure->{sched_departure} // $departure->{sched_arrival} // q{} %>
+% if ($departure->{sched_departure}) {
+% if ($departure->{departure} ne $departure->{sched_departure}) {
+ (heute <%= $departure->{departure} %>)
+% }
% }
-% }
-% elsif ($departure->{arrival}) {
-% if ($departure->{arrival} ne $departure->{sched_arrival}) {
- (heute <%= $departure->{arrival} %>)
+% elsif ($departure->{arrival}) {
+% if ($departure->{arrival} ne $departure->{sched_arrival}) {
+ (heute <%= $departure->{arrival} %>)
+% }
% }
-% }
- <strong><%= $station_name %></strong>
- </li>
+ <strong><%= stash('station_name') %></strong>
+ </li>
+% }
% for my $stop (@{$departure->{route_post_diff}}) {
<li>
<a href="<%= url_for('station', station => $stop->{name})->query({detailed => param('detailed')}) %>" class="