summaryrefslogtreecommitdiff
path: root/templates/_train_details.html.ep
blob: 5bff90fef0137bb571f790a323775a594c06744f (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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
    <div class="mheader">
    <div>
%   if ($departure->{train_no} or $departure->{train_line}) {
      <span class="train-line <%= $linetype %>"><%= $departure->{train_type} %>
      <%= $departure->{train_line} // $departure->{train_no} %></span>
      <span class="train-no"><%= $departure->{train_line} ? $departure->{train_no} : q{} %></span>
%   }
%   else {
      <span class="train-line"><%= $departure->{train} // q{???} %></span>
%   }
    </div>
    <div>
%   if ($departure->{origin}) {
      <span class="train-origin"><%= $departure->{origin} %></span>
      →
%   }
    <span class="train-dest"><%= $departure->{destination} // q{???} %></span>
    </div>
%   if ($departure->{is_cancelled}) {
      <div class="minfo">Fahrt fällt aus</div>
%   }
%   elsif (defined $departure->{delay} and $departure->{delay} > 0) {
      <div class="minfo">+<%= $departure->{delay} %>
%     if ($departure->{departure_is_cancelled}) {
        (endet hier)
%     }
      </div>
%   }
%   if (@{$departure->{replaced_by}}) {
%     for my $replacement (@{$departure->{replaced_by}}) {
        <span class="replaced">Ersatzzug: <%= $replacement %></span>
%     }
%   }
%   if (@{$departure->{replacement_for}}) {
%     for my $replacement (@{$departure->{replacement_for}}) {
        <span class="replacement">Ersatzzug für <%= $replacement %></span>
%     }
%   }
    </div> <!-- mheader -->
    <div class="mfooter">
    <div class="platforminfo">
%   if ($departure->{scheduled_platform} or $departure->{platform}) {
      Gleis <%= $departure->{scheduled_platform} // $departure->{platform} %>
%   }
%   if ($departure->{scheduled_platform} and $departure->{platform}
%       and $departure->{scheduled_platform} ne $departure->{platform}) {
      (heute Gleis <%= $departure->{platform} %>)
%   }
%   elsif ($departure->{changed_platform}) {
      (Gleiswechsel)
%   }
    </div> <!-- platforminfo -->
%   if (not $departure->{is_cancelled}) {
      <div class="timeinfo">
%     if ($departure->{sched_arrival}) {
        Ankunft: <%= $departure->{sched_arrival} %>
%       if ($departure->{arrival} and $departure->{arrival} ne $departure->{sched_arrival}) {
          (heute <%= $departure->{arrival} %>)
%       }
        <br/>
%     }
%     if ($departure->{sched_departure}) {
        Abfahrt: <%= $departure->{sched_departure} %>
%       if ($departure->{departure} and $departure->{departure} ne $departure->{sched_departure}) {
          (heute <%= $departure->{departure} %>)
%       }
        <br/>
%     }
%     if (not ($departure->{sched_arrival} or $departure->{sched_departure})) {
        Abfahrt: <%= $departure->{time} %>
%       if ($departure->{delay}) {
          (heute +<%= $departure->{delay} %>)
%       }
%     }
      </div> <!-- timeinfo -->
%     if (($linetype eq 'fern' or $linetype eq 'ext') and $departure->{wr_link}) {
        <div class="verbose">
          <a href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>">Wagenreihung</a>
        </div>
%     }

%   }
%   if ($departure->{moreinfo} and @{$departure->{moreinfo}}) {
      Meldungen:
      <ul>
%     for my $pair (@{$departure->{moreinfo}}) {
        <li>
%       if ($pair->[0]->isa('DateTime')) {
%         if ($pair->[0]->day != $dt_now->day) {
%           $pair->[0]->set_locale('de_DE');
%=          $pair->[0]->strftime('%a %H:%M')
%         }
%         else {
%=          $pair->[0]->strftime('%H:%M')
%         }
%       }
%       else {
%=        $pair->[0]
%       }
        <span class="reason">
%=      $pair->[1]
        </span>
        </li>
%     }
%     if ($departure->{route_info}) {
        <li><%= $departure->{route_info} %></li>
%     }
      </ul>
%   }
%   if ($departure->{route_pre_diff} and $departure->{route_post_diff}) {
%     if (@{$departure->{route_pre_diff}}) {
        Von:
        <ul class="mroute">
%         for my $stop (@{$departure->{route_pre_diff}}) {
            <li>
            <a href="/<%= $stop->{name} %>#<%= $departure->{train_type} . $departure->{train_no} %>" class="
%           if ($stop->{isAdditional}) {
              additional-stop
%           }
%           elsif ($stop->{isCancelled}) {
              cancelled-stop
%           }
%           elsif ($self->is_important($stop->{name})) {
              important-stop
%           }
%           else {
              generic-stop
%           }
%           if ($stop->{rt_dep}) {
              "><%= $stop->{sched_dep}->strftime('%H:%M') %> (heute <%= $stop->{rt_dep}->strftime('%H:%M') %>) <%= $stop->{name} %></a>
%           }
%           else {
              "><%= $stop->{sched_dep} ? $stop->{sched_dep}->strftime('%H:%M') : q{} %> <%= $stop->{name} %></a>
%           }
            </li>
%         }
        </ul> <!-- mroute -->
%     }
%     if (@{$departure->{route_post_diff}}) {
        Nach:
        <ul class="mroute">
%         for my $stop (@{$departure->{route_post_diff}}) {
            <li>
            <a href="/<%= $stop->{name} %>#<%= $departure->{train_type} . $departure->{train_no} %>" class="
%           if ($stop->{isAdditional}) {
              additional-stop
%           }
%           elsif ($stop->{isCancelled}) {
              cancelled-stop
%           }
%           elsif ($self->is_important($stop->{name})) {
              important-stop
%           }
%           else {
              generic-stop
%           }
%           if ($stop->{rt_arr}) {
              "><%= $stop->{sched_arr}->strftime('%H:%M') %> (heute <%= $stop->{rt_arr}->strftime('%H:%M') %>) <%= $stop->{name} %></a>
%           }
%           else {
              "><%= $stop->{sched_arr} ? $stop->{sched_arr}->strftime('%H:%M') : q{} %> <%= $stop->{name} %></a>
%           }
            </li>
%         }
        </ul> <!-- mroute -->
%     }
%   }
    </div> <!-- mfooter -->