diff options
Diffstat (limited to 'templates/_wagon.html.ep')
-rw-r--r-- | templates/_wagon.html.ep | 52 |
1 files changed, 33 insertions, 19 deletions
diff --git a/templates/_wagon.html.ep b/templates/_wagon.html.ep index 94ef56a..dccecc0 100644 --- a/templates/_wagon.html.ep +++ b/templates/_wagon.html.ep @@ -1,36 +1,36 @@ % my $bg = ''; % my $extra_class = ''; -% if ($wagon->is_first_class) { +% if ($wagon->has_first_class) { % $extra_class .= ' firstclass'; % } % if ($wagon->is_locomotive or $wagon->is_powercar) { % $extra_class .= ' powercar'; % } -% if ($wagon->train_no ne $train_no) { +% if ($wagon->is_closed) { +% $extra_class .= ' closed'; +% } +% if ($group->train_no ne $train_no) { % $extra_class .= ' nondestwagon'; % } <div class="wagon <%= $extra_class %>" style=" - top: <%= $wagon->{position}{start_percent} %>%; bottom: <%= 100 - $wagon->{position}{end_percent} %>%; <%= $bg %>"> + top: <%= $wagon->start_percent %>%; bottom: <%= 100 - $wagon->end_percent %>%; <%= $bg %>"> % if ($wagon->is_locomotive or $wagon->is_powercar) { % } +% elsif ($wagon->is_closed) { + X +% } % else { -%= $wagon->number // '?' -% if ($wagon->has_accessibility) { +%= $wagon->number // q{} +% if ($wagon->has_wheelchair_space) { <i class="material-icons" style="font-size: 20px;">accessible</i> % } % if ($wagon->has_bistro) { <i class="material-icons">restaurant</i> % } -% if ($wagon->has_compartments) { - <!--<i class="material-icons">folder</i>--> -% } -% if ($wagon->has_quiet_area) { +% if ($wagon->has_quiet_zone) { <i class="tiny material-icons">volume_off</i> % } -% if ($wagon->has_phone_area) { - <i class="material-icons">smartphone</i> -% } -% if ($wagon->has_family_area) { +% if ($wagon->has_family_zone) { <i class="material-icons">people</i> % } % if ($wagon->has_bahn_comfort) { @@ -38,9 +38,9 @@ % } % } <div class="direction"> -% if (not defined $direction) { +% if (not defined $wr->direction) { % } -% elsif ($direction == 100) { +% elsif ($wr->direction == 100) { <i class="material-icons">arrow_downward</i> % } % else { @@ -49,9 +49,9 @@ </div> </div> <div class="details" style=" - top: <%= $wagon->{position}{start_percent} %>%; bottom: <%= 100 - $wagon->{position}{end_percent} %>%;"> + top: <%= $wagon->start_percent %>%; bottom: <%= 100 - $wagon->end_percent %>%;"> % if ($exit_dir ne 'right') { -% if (my $img = wagon_image($wagon->train_subtype // $type // '?', $wagon->type, $wagon->uic_id)) { +% if (my $img = wagon_image($wr->train_type // '?', $wagon->type, $wagon->uic_id)) { <a class="type" href="/w/<%= $img %>?n=<%= $wagon->number // '' %>&s=<%= $wagon->section %>&r=<%= $wref %>"><%= $wagon->type %></a> % } % else { @@ -61,7 +61,7 @@ % } % } % my $uic_id = $wagon->uic_id; -% if (length($uic_id) != 12) { +% if (length($uic_id) != 12 and length($uic_id) != 14) { <span class="uicunknown"><%= $uic_id %></span> % } % elsif (substr($uic_id, 0, 2) >= 90) { @@ -71,7 +71,7 @@ <span class="uicexchange"><%= substr($uic_id, 0, 2) %></span><span class="uiccountry"><%= substr($uic_id, 2, 2) %></span><span class="uic56"><%= substr($uic_id, 4, 2) %></span><span class="uic78"><%= substr($uic_id, 6, 2) %></span><span class="uicno"><%= substr($uic_id, 8, 3) %></span><span class="uiccheck"><%= substr($uic_id, 11) %></span> % } % if ($exit_dir eq 'right') { -% if (my $img = wagon_image($wagon->train_subtype // $type // '?', $wagon->type, $wagon->uic_id)) { +% if (my $img = wagon_image($wr->train_type // '?', $wagon->type, $wagon->uic_id)) { <a class="type" href="/w/<%= $img %>?n=<%= $wagon->number // '' %>&s=<%= $wagon->section %>&r=<%= $wref %>"><%= $wagon->type %></a> % } % else { @@ -80,4 +80,18 @@ </span> % } % } +% if ($multi and $first) { + <br/> + <span class="groupno"> +% if (scalar $wr->train_numbers > 1) { + <%= $group->train_type %> <%= $group->train_no %> +% } +% if (scalar $wr->destinations > 1) { + → <%= $group->destination %> +% } + </span> + % if ($multi and $group->desc_short) { + <span class="grouptype"><%= $group->desc_short %></span> +% } +% } </div> |