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

Indicate carriages belonging to other trains in carriage formation preview

parent f0bbf6b8
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -759,13 +759,19 @@ sub render_train {
									or $wagon->is_powercar )
							  )
							{
								my $class;
								if ($first) {
									push( @{ $departure->{wr_preview} }, '' );
									push(
										@{ $departure->{wr_preview} },
										[ '', 'meta' ]
									);
									$first = 0;
									say "-";
								}
								my $entry;
								if ( $wagon->is_closed ) {
									$entry = 'X';
									$class = 'closed';
								}
								else {
									$entry = $wagon->number
@@ -776,7 +782,16 @@ sub render_train {
										:                         $wagon->type
									  );
								}
								push( @{ $departure->{wr_preview} }, $entry );
								if (
									$group->train_no ne $departure->{train_no} )
								{
									$class = 'otherno';
								}
								say $entry;
								push(
									@{ $departure->{wr_preview} },
									[ $entry, $class ]
								);
							}
						}
						$first = 1;
+8 −0
Original line number Diff line number Diff line
@@ -558,6 +558,14 @@ div.app {
			a {
				color: $fg;
			}

			.otherno {
				color: $fg2;
			}

			.meta {
				color: $fg1;
			}
		}

		.departure {
+7 −5
Original line number Diff line number Diff line
@@ -124,11 +124,13 @@
%     }
      <a href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>?e=<%= $departure->{wr_direction} // '' %>">
      %= $direction
      % if (defined $departure->{direction_num} and $departure->{direction_num} != $wr->direction) {
        %= join(q{ }, reverse @{$departure->{wr_preview} // []})
      % for my $entry ((defined $departure->{wr_direction_num} and $departure->{wr_direction_num} != $wr->direction) ? reverse @{$departure->{wr_preview} // []} : @{$departure->{wr_preview} // []}) {
        % if ($entry->[1]) {
          <span class="<%= $entry->[1] %>"><%= $entry->[0] %></span>
        % }
        % else {
        %= join(q{ }, @{$departure->{wr_preview} // []})
          %= $entry->[0]
        % }
      % }
      %= $direction
      </a>