summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-08-03 15:09:15 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-08-03 15:09:15 +0200
commit0439aa8b0247bbbd5590526bb679f749940bb6df (patch)
tree15e1e99c2cc17a3e0fec895156bc38119a7943e2 /templates
parenta48352ada44a7a5dde9817383434759c9b5a6497 (diff)
use the same direction for wagon order and direction indicator1.8.6
Diffstat (limited to 'templates')
-rw-r--r--templates/_checked_in.html.ep14
1 files changed, 11 insertions, 3 deletions
diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep
index 2e5569a..4e056da 100644
--- a/templates/_checked_in.html.ep
+++ b/templates/_checked_in.html.ep
@@ -54,14 +54,22 @@
% }
% if (my $wr = $journey->{wagonorder}) {
<br/>
+ % my @wagons = $wr->wagons;
+ % my $direction = $wr->direction == 100 ? '→' : '←';
+ % if ($journey->{dep_direction}) {
+ % $direction = $journey->{dep_direction} eq 'l' ? '◀' : '▶';
+ % if (($journey->{dep_direction} eq 'l' ? 0 : 100) != $wr->direction) {
+ % @wagons = reverse @wagons;
+ % }
+ % }
<a href="https://marudor.de/<%= $journey->{dep_name} %>?selectedDetail=<%= $journey->{train_id} %>">
- %= $wr->direction == 100 ? '→' : '←';
- % for my $wagon ($wr->wagons) {
+ %= $direction
+ % for my $wagon (@wagons) {
% if (not ($wagon->is_locomotive or $wagon->is_powercar)) {
%= $wagon->number || $wagon->type
% }
% }
- %= $wr->direction == 100 ? '→' : '←';
+ %= $direction
</a>
% }
</div>