summaryrefslogtreecommitdiff
path: root/templates/wagenreihung.html.ep
blob: 820a4843ab3572d29e2772b5bab3c5e2729cc094 (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
% if (not $wr or $wr->errstr) {
  <div class="container">
    <div class="error">
      <strong>Fehler bei der Abfrage der Wagenreihung:</strong>
      <%= $wr ? $wr->errstr : $wr_error %>
    </div>
  </div>
% }
% else {
  % my $has_multi_dest = 0;
  % my $has_multi_desc = 0;
  % if (scalar $wr->destinations > 1) {
    % $has_multi_dest = 1;
  % }
  % if (scalar $wr->train_descriptions > 1) {
    % $has_multi_desc = 1;
  % }
  <div class="container">
    <div style="text-align: center;">
      <%= $wr->station->{name} %> Gleis <%= $wr->platform %><br/>
    </div>
  </div>
  <div class="container">
    <div class="wagonorder exit-<%= stash('exit_dir') // 'unknown'%>">
%     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>
%       }
%     }
%     my $gi;
%     for my $wagon ($wr->wagons) {
%=      include '_wagon', wr => $wr, wagon => $wagon, prev_gi => $gi, multi => $has_multi_desc + $has_multi_dest, wref => $wref, exit_dir => stash('exit_dir');
%       $gi = $wagon->group_index;
%     }
      </div>
      <div style="text-align: center;">
%=      join( ' / ', map { $_->{name} } $wr->origins )
        →
%=      join( ' / ', map { $_->{name} } $wr->destinations )
      </div>
    % for my $desc ($wr->train_descriptions) {
      % if ($desc->{text}) {
        <div style="text-align: center;">
          %= $desc->{text}
          % if ($has_multi_desc and length(join(q{}, sort @{$desc->{sections}}))) {
            in Abschnitt <%= join(q{}, sort @{$desc->{sections}}) %>
          % }
        </div>
      % }
    % }
<!--  <div>
      Legende: ♿ Behindertengerechte Ausstattung / 🍴 Bistro/Restaurant / 🚪 Abteile vorhanden
    </div>
-->
    <p class="copyright">
      Quelle: DB Wagenreihungs-API. Angaben ohne Gewähr.
    </p>

  </div>
% }