diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-03-21 08:19:33 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-03-21 08:19:33 +0100 |
commit | 234486663dbe1712c10888121d9bf38c4cbd2cc8 (patch) | |
tree | d2527e55d2e67670c39af6aa912825fb9cfe4750 /templates | |
parent | d4f528767cc904320c26b30abf8bb5d83548514b (diff) |
add preliminary support for station-independent train details
Diffstat (limited to 'templates')
-rw-r--r-- | templates/_train_details.html.ep | 31 | ||||
-rw-r--r-- | templates/train_details.html.ep | 2 |
2 files changed, 20 insertions, 13 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=" diff --git a/templates/train_details.html.ep b/templates/train_details.html.ep index 08058a9..7d5ea90 100644 --- a/templates/train_details.html.ep +++ b/templates/train_details.html.ep @@ -1,4 +1,4 @@ -<div class="app" data-station="<%= $station_name %>"> +<div class="app" data-station="<%= stash('station_name') // q{} %>"> <div class="moreinfo" data-static="1"> %= include '_train_details' </div> |