summaryrefslogtreecommitdiff
path: root/templates/wagenreihung.html.ep
blob: b14c2dc634fbf28f25d593c21b31a36ca6b1bdad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
% if ($wr->errstr) {
  <div class="container">
    <div class="error">
      <strong>Fehler bei der Abfrage der Wagenreihung:</strong>
      <%= $wr->errstr %>
    </div>
  </div>
% }
% else {
  <div class="container">
    <div style="text-align: center;">
%=    join( ' / ', $wr->origins )
      →
%=    join( ' / ', map { $_->{name} } $wr->destinations )
    </div>
    <%= $wr->station_name %> Gleis <%= $wr->platform %><br/>
    % if ($wr->train_type =~ m{^IC|EC}) {
      Zugtyp: <%= $wr->train_subtype // 'IC?' %>
    % }
  </div>
  </div>
  <div class="container">
    <div class="wagonorder">
%     if (not $wr->has_bad_wagons) {
%       for my $section ($wr->sections) {
          <div class="section" style="
          top: <%= $section->{start_percent} %>%; bottom: <%= 100 - $section->{end_percent} %>%;">
%=          $section->{name}
          </div>
%       }
%     }
%     for my $wagon ($wr->wagons) {
%       my $bg = '';
%       if ($wagon->is_first_class) {
%         $bg = 'background-color: #ffff99;';
%       }
%       if ($wagon->is_locomotive or $wagon->is_powercar) {
%         $bg = 'background-color: #cccccc;';
%       }
        <div class="direction" style="
        top: <%= $wagon->{position}{start_percent} %>%; bottom: <%= 100 - $wagon->{position}{end_percent} %>%;">
%         if ($wr->has_bad_wagons) {
%         }
%         elsif ($wr->direction == 100) {
            ↓
%         }
%         else {
            ↑
%         }
        </div>
        <div class="wagon" style="
        top: <%= $wagon->{position}{start_percent} %>%; bottom: <%= 100 - $wagon->{position}{end_percent} %>%; <%= $bg %>">
%         if ($wagon->is_locomotive or $wagon->is_powercar) {
%         }
%         else {
%=          $wagon->number // '?'
%           if ($wagon->has_accessibility) {
              <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) {
              <i class="tiny material-icons">volume_off</i>
%           }
%           if ($wagon->has_phone_area) {
              <i class="material-icons">smartphone</i>
%           }
%           if ($wagon->has_family_area) {
              <i class="material-icons">people</i>
%           }
%           if ($wagon->has_bahn_comfort) {
              <i class="material-icons">star</i>
%           }
%         }
        </div>
        <div class="details" style="
        top: <%= $wagon->{position}{start_percent} %>%; bottom: <%= 100 - $wagon->{position}{end_percent} %>%;">
%         if ($wagon->is_first_class) {
            <span class="firstclass">1</span>
%         }
%         elsif ($wagon->is_second_class) {
            <span class="secondclass">2</span>
%         }
%         else {
            <span class="noclass"></span>
%         }
          <span class="type">
%=          $wagon->type
          </span>
%         my $uic_id = $wagon->uic_id;
%         if (length($uic_id) != 12) {
            <span style="color: #666666;"><%= $uic_id %></span>
%         }
%         elsif ($wr->train_type eq 'ICE') {
            <span style="margin-right: 0.2em; color: #999999;"><%= substr($uic_id, 0, 2) %></span><span style="margin-right: 0.2em; color: #999999;"><%= substr($uic_id, 2, 2) %></span><span style="margin-right: 0.2em; color: #999999;"><%= substr($uic_id, 4, 1) %></span><span style="margin-right: 0.2em; font-weight: bold;"><%= substr($uic_id, 5, 3) %></span><span><%= substr($uic_id, 8, 3) %></span><span style="color: #999999;">-<%= substr($uic_id, 11) %></span>
%         }
%         else {
            <span style="margin-right: 0.2em; color: #999999;"><%= substr($uic_id, 0, 2) %></span><span style="margin-right: 0.2em; color: #999999;"><%= substr($uic_id, 2, 2) %></span><span style="font-weight: bold;"><%= substr($uic_id, 4, 2) %></span>-<span style="margin-right: 0.2em; font-weight: bold;"><%= substr($uic_id, 6, 2) %></span><span><%= substr($uic_id, 8, 3) %></span><span style="color: #999999;">-<%= substr($uic_id, 11) %></span>
%         }
        </div>
%     }
      </div>
<!--  <div>
      Legende: ♿ Behindertengerechte Ausstattung / 🍴 Bistro/Restaurant / 🚪 Abteile vorhanden
    </div>
-->
    <div>
      Angaben ohne Gewähr – Echtzeitdaten sind möglicherweise nicht berücksichtigt.
    </div>

  </div>
% }