summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-05-01 12:29:30 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-05-01 12:29:30 +0200
commitf0bbf6b8ab0b9ad5c8f8503792cdc807731280ab (patch)
tree4575b873cae5a8a0b1fc45d805511700328a127e
parentc3e12fffc9a14efc1a5a1e7ce9ad0fc865be582c (diff)
$departure->{direction} is also used by HAFAS, move wr to wr_direction
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm6
-rw-r--r--templates/_train_details.html.ep12
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm
index 2aac171..4d8406e 100644
--- a/lib/DBInfoscreen/Controller/Stationboard.pm
+++ b/lib/DBInfoscreen/Controller/Stationboard.pm
@@ -856,11 +856,11 @@ sub render_train {
}
if ($direction) {
- $departure->{direction} = $direction;
- $departure->{direction_num} = $direction eq 'l' ? 0 : 100;
+ $departure->{wr_direction} = $direction;
+ $departure->{wr_direction_num} = $direction eq 'l' ? 0 : 100;
}
elsif ( $platform_info->{direction} ) {
- $departure->{direction} = 'a' . $platform_info->{direction};
+ $departure->{wr_direction} = 'a' . $platform_info->{direction};
}
return;
diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep
index 1b7bfce..0f02483 100644
--- a/templates/_train_details.html.ep
+++ b/templates/_train_details.html.ep
@@ -68,10 +68,10 @@
% else {
% my $left = '';
% my $right = '';
-% if ($departure->{direction} and $departure->{direction} eq 'l') {
+% if ($departure->{wr_direction} and $departure->{wr_direction} eq 'l') {
% $left = '◀ ';
% }
-% elsif ($departure->{direction} and $departure->{direction} eq 'r') {
+% elsif ($departure->{wr_direction} and $departure->{wr_direction} eq 'r') {
% $right = ' ▶';
% }
% if ($departure->{scheduled_platform} and $departure->{platform}
@@ -119,10 +119,10 @@
% if (my $wr = $departure->{wr}) {
<div class="wagonorder-preview">
% my $direction = defined $wr->direction ? $wr->direction == 100 ? '→' : '←' : q{};
-% if ($departure->{direction}) {
-% $direction = $departure->{direction} eq 'l' ? '◀' : '▶';
+% if ($departure->{wr_direction}) {
+% $direction = $departure->{wr_direction} eq 'l' ? '◀' : '▶';
% }
- <a href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>?e=<%= $departure->{direction} // '' %>">
+ <a href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>?e=<%= $departure->{wr_direction} // '' %>">
%= $direction
% if (defined $departure->{direction_num} and $departure->{direction_num} != $wr->direction) {
%= join(q{ }, reverse @{$departure->{wr_preview} // []})
@@ -144,7 +144,7 @@
% }
% }
% 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> <%= $departure->{wr_text} || 'Wagen' %>
+ <a class="smallbutton" href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>?e=<%= $departure->{wr_direction} // '' %>"><i class="material-icons" aria-hidden="true">train</i> <%= $departure->{wr_text} || 'Wagen' %>
</a>
% }
% if ($departure->{train_type} and $departure->{train_no}) {