summaryrefslogtreecommitdiff
path: root/templates/_wagon.html.ep
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-12-25 17:27:57 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-12-25 17:27:57 +0100
commit0f9dde3810a3b86e0769e6013a19ccf0faeba0a3 (patch)
treecd2c4a5f2b9914f1e6d335f00038c12ebe66d209 /templates/_wagon.html.ep
parent7d29c0f25f4d7e4e47ea726bcdac1985da866126 (diff)
add wagon images for IC and ICE 1/2/4
IC2, ICE 3 and ICE T will follow soon.
Diffstat (limited to 'templates/_wagon.html.ep')
-rw-r--r--templates/_wagon.html.ep11
1 files changed, 8 insertions, 3 deletions
diff --git a/templates/_wagon.html.ep b/templates/_wagon.html.ep
index 95b1c2e..a9221bd 100644
--- a/templates/_wagon.html.ep
+++ b/templates/_wagon.html.ep
@@ -50,9 +50,14 @@
</div>
<div class="details" style="
top: <%= $wagon->{position}{start_percent} %>%; bottom: <%= 100 - $wagon->{position}{end_percent} %>%;">
- <span class="type">
-%= $wagon->type
- </span>
+% if (my $img = wagon_image($type, $wagon->type, $wagon->uic_id)) {
+ <a class="type" href="/w/<%= $img %>?n=<%= $wagon->number // '' %>&amp;s=<%= $wagon->section %>&amp;r=<%= $wref %>"><%= $wagon->type %></a>
+% }
+% else {
+ <span class="type">
+%= $wagon->type
+ </span>
+% }
% my $uic_id = $wagon->uic_id;
% if (length($uic_id) != 12) {
<span class="uicunknown"><%= $uic_id %></span>