summaryrefslogtreecommitdiff
path: root/templates/_wagon.html.ep
diff options
context:
space:
mode:
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>