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

replace DBWagenreihung group_index hack with new group accessor

parent ee546af2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@
        </span>
%     }
%   }
%   if ($multi and defined $wagon->group_index and (not defined $prev_gi or $wagon->group_index != $prev_gi)) {
%   if ($multi and $first) {
      <br/>
      <span class="groupno">
%       if (scalar $wr->train_nos > 1) {
@@ -96,8 +96,8 @@
          → <%= $wr->{data}{istformation}{allFahrzeuggruppe}[$wagon->group_index]{zielbetriebsstellename} %>
%       }
      </span>
      % if (scalar $wr->train_descriptions > 1 and ($wr->train_descriptions)[$wagon->group_index]{short}) {
        <span class="grouptype"><%= ($wr->train_descriptions)[$wagon->group_index]{short} %></span>
      % if ($multi and ($wr->groups)[$wagon->group_index]->desc_short) {
        <span class="grouptype"><%= ($wr->groups)[$wagon->group_index]->desc_short %></span>
%     }
%   }
  </div>
+11 −17
Original line number Diff line number Diff line
@@ -7,14 +7,6 @@
  </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/>
@@ -30,10 +22,12 @@
          </div>
%       }
%     }
%     my $gi;
%     for my $wagon ($wr->wagons) {
%=      include '_wagon', wr => $wr, wagon => $wagon, prev_gi => $gi, multi => $has_multi_desc + (scalar $wr->destinations) - 1 + (scalar $wr->train_nos) - 1, wref => $wref, exit_dir => stash('exit_dir');
%       $gi = $wagon->group_index;
%     for my $group ($wr->groups) {
%       my $first = 1;
%       for my $wagon ($group->wagons) {
%=        include '_wagon', wr => $wr, wagon => $wagon, first => $first, multi => (scalar $wr->destinations) - 1 + (scalar $wr->train_nos) - 1, wref => $wref, exit_dir => stash('exit_dir');
%         $first = 0;
%       }
%     }
      </div>
      <div style="text-align: center;">
@@ -41,12 +35,12 @@

%=      join( ' / ', map { $_->{name} } $wr->destinations )
      </div>
    % for my $desc ($wr->train_descriptions) {
      % if ($desc->{text}) {
    % for my $group ($wr->groups) {
      % if ($group->description) {
        <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}}) %>
          %= $group->description
          % if (scalar $wr->groups > 1 and $group->has_sections) {
            in Abschnitt <%= join(q{}, sort $group->sections) %>
          % }
        </div>
      % }