Unverified Commit d84bfa2c authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

wagenreihung: show train type and direction next to wagons

parent b549bb47
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -44,9 +44,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 {
@@ -57,7 +57,7 @@
  <div class="details" style="
  top: <%= $wagon->{position}{start_percent} %>%; bottom: <%= 100 - $wagon->{position}{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($wagon->train_subtype // $wr->train_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 {
@@ -77,7 +77,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($wagon->train_subtype // $wr->train_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 {
@@ -85,5 +85,8 @@
%=        $wagon->type
        </span>
%     }
%   }
%   if ($multi and defined $wagon->group_index and (not defined $prev_gi or $wagon->group_index != $prev_gi)) {
      <br/><span class="grouptype"><%= ($wr->train_descriptions)[$wagon->group_index]{short} %> → <%= $wr->{data}{istformation}{allFahrzeuggruppe}[$wagon->group_index]{zielbetriebsstellename} %></span>
%   }
  </div>
+19 −21
Original line number Diff line number Diff line
@@ -17,27 +17,8 @@
  % }
  <div class="container">
    <div style="text-align: center;">
%=    join( ' / ', map { $_->{name} } $wr->origins )

%=    join( ' / ', map { $_->{name} } $wr->destinations )
    </div>
    % if ($has_multi_dest) {
      <div style="text-align: center;">
        % for my $destination ($wr->destinations) {
          Nach <%= $destination->{name} %> in Abschnitt <%= join(q{}, sort @{$destination->{sections} // []}) %><br/>
       % }
      </div>
    % }
      <%= $wr->station->{name} %> Gleis <%= $wr->platform %><br/>
    % for my $desc ($wr->train_descriptions) {
      % if ($desc->{text}) {
        %= $desc->{text}
        % if ($has_multi_desc and length(join(q{}, sort @{$desc->{sections}}))) {
          in Abschnitt <%= join(q{}, sort @{$desc->{sections}}) %>
        % }
        <br/>
      % }
    % }
    </div>
  </div>
  <div class="container">
    <div class="wagonorder exit-<%= stash('exit_dir') // 'unknown'%>">
@@ -49,10 +30,27 @@
          </div>
%       }
%     }
%     my $gi;
%     for my $wagon ($wr->wagons) {
%=      include '_wagon', direction => $wr->direction, wagon => $wagon, type => $wr->train_type, wref => $wref, exit_dir => stash('exit_dir');
%=      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>