summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2024-03-06 18:24:32 +0100
committerBirte Kristina Friesel <birte.friesel@uos.de>2024-03-06 18:24:32 +0100
commit420de7ee4d85463029d659527cae0351894273bd (patch)
tree73825feda1024fbb8dd4bcf80e5afd5b0384c3e2
parent70b8717c3025f09550cf144e838ee0313346ef72 (diff)
train_details: $departure->{date} is undef if HAFAS request failed4.21.1
-rw-r--r--templates/_train_details.html.ep16
1 files changed, 9 insertions, 7 deletions
diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep
index 4943ba2..12aab91 100644
--- a/templates/_train_details.html.ep
+++ b/templates/_train_details.html.ep
@@ -224,13 +224,15 @@
</ul>
% }
% if ($departure->{route_pre_diff} and $departure->{route_post_diff}) {
-%= l 'Fahrtverlauf am'
-% if (stash('train') !~ m{[|]}) {
- <a href="<%= url_for('train', train => stash('train'))->query({detailed => param('detailed'), past => param('past'), rt => param('rt'), hafas => param('hafas'), date => $departure->{date}->clone->subtract(days => 1)->strftime('%d.%m.%Y'), highlight => param('highlight') // stash('station')}) %>">◀</a>
-% }
-%= $departure->{date}->strftime('%d.%m.%Y')
-% if (stash('train') !~ m{[|]}) {
- <a href="<%= url_for('train', train => stash('train'))->query({detailed => param('detailed'), past => param('past'), rt => param('rt'), hafas => param('hafas'), date => $departure->{date}->clone->add(days => 1)->strftime('%d.%m.%Y'), highlight => param('highlight') // stash('station')}) %>">▶</a>
+% if ($departure->{date}) {
+%= l 'Fahrtverlauf am'
+% if (stash('train') !~ m{[|]}) {
+ <a href="<%= url_for('train', train => stash('train'))->query({detailed => param('detailed'), past => param('past'), rt => param('rt'), hafas => param('hafas'), date => $departure->{date}->clone->subtract(days => 1)->strftime('%d.%m.%Y'), highlight => param('highlight') // stash('station')}) %>">◀</a>
+% }
+%= $departure->{date}->strftime('%d.%m.%Y')
+% if (stash('train') !~ m{[|]}) {
+ <a href="<%= url_for('train', train => stash('train'))->query({detailed => param('detailed'), past => param('past'), rt => param('rt'), hafas => param('hafas'), date => $departure->{date}->clone->add(days => 1)->strftime('%d.%m.%Y'), highlight => param('highlight') // stash('station')}) %>">▶</a>
+% }
% }
<ul class="mroute">
% for my $stop (@{$departure->{route_pre_diff}}) {