From fd7afd8f42c029bdaf9d11118f53500805ddad6b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 18 Feb 2021 18:34:33 +0100 Subject: wagon image: do not mis-label unknown (e.g. EC) trains as IC Fixes wrong wagon images being displayed for swiss (and probably other) EC trains. --- templates/_wagon.html.ep | 4 ++-- templates/wagenreihung.html.ep | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/_wagon.html.ep b/templates/_wagon.html.ep index 6c02827..94ef56a 100644 --- a/templates/_wagon.html.ep +++ b/templates/_wagon.html.ep @@ -51,7 +51,7 @@
% if ($exit_dir ne 'right') { -% if (my $img = wagon_image($wagon->train_subtype // 'IC', $wagon->type, $wagon->uic_id)) { +% if (my $img = wagon_image($wagon->train_subtype // $type // '?', $wagon->type, $wagon->uic_id)) { <%= $wagon->type %> % } % else { @@ -71,7 +71,7 @@ <%= substr($uic_id, 0, 2) %><%= substr($uic_id, 2, 2) %><%= substr($uic_id, 4, 2) %><%= substr($uic_id, 6, 2) %><%= substr($uic_id, 8, 3) %><%= substr($uic_id, 11) %> % } % if ($exit_dir eq 'right') { -% if (my $img = wagon_image($wagon->train_subtype // 'IC', $wagon->type, $wagon->uic_id)) { +% if (my $img = wagon_image($wagon->train_subtype // $type // '?', $wagon->type, $wagon->uic_id)) { <%= $wagon->type %> % } % else { diff --git a/templates/wagenreihung.html.ep b/templates/wagenreihung.html.ep index 0686063..9fe132d 100644 --- a/templates/wagenreihung.html.ep +++ b/templates/wagenreihung.html.ep @@ -50,7 +50,7 @@ % } % } % for my $wagon ($wr->wagons) { -%= include '_wagon', direction => $wr->direction, wagon => $wagon, wref => $wref, exit_dir => stash('exit_dir'); +%= include '_wagon', direction => $wr->direction, wagon => $wagon, type => $wr->train_type, wref => $wref, exit_dir => stash('exit_dir'); % }