Commit cd4e1246 authored by Daniel Friesel's avatar Daniel Friesel
Browse files

show planned IC/ICE type in detail view

parent 27bb2b67
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -68,8 +68,8 @@ sub startup {
				scalar read_file('share/ice_type.json') );
			my $ret;
			while ( my ( $k, $v ) = each %{$ice_type_map} ) {
				if ( $v->{short} ) {
					$ret->{$k} = $v->{short};
				if ( $v->{type} ) {
					$ret->{$k} = [ $v->{type}, $v->{short} ];
				}
			}
			return $ret;
+2 −1
Original line number Diff line number Diff line
@@ -1258,6 +1258,7 @@ sub handle_request {
				'_train_details',
				departure => $departure,
				linetype  => $linetype,
				icetype => $self->app->ice_type_map->{ $departure->{train_no} },
				dt_now  => DateTime->now( time_zone => 'Europe/Berlin' ),
			);
		}
+7 −2
Original line number Diff line number Diff line
@@ -73,9 +73,14 @@
%       }
%     }
      </div> <!-- timeinfo -->
%     if ($departure->{wr_link}) {
%     if ($departure->{wr_link} or ($icetype and $icetype->[1])) {
        <div class="verbose">
%         if ($departure->{wr_link}) {
            <a href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>">Wagenreihung</a>
%         }
%         if ($icetype and $icetype->[1]) {
            (Plan: <%= $icetype->[0] %>)<br/>
%         }
        </div>
%     }
%     if ($departure->{trip_id}) {
+2 −2
Original line number Diff line number Diff line
@@ -83,8 +83,8 @@
%=    $departure->{train_line}
%   }
%   elsif ($departure->{train_no}) {
%     if (exists $ice_type->{$departure->{train_no}}) {
        <span class="trainsubtype"><%= $ice_type->{$departure->{train_no}} %></span>
%     if (exists $ice_type->{$departure->{train_no}} and $ice_type->{$departure->{train_no}}[1]) {
        <span class="trainsubtype"><%= $ice_type->{$departure->{train_no}}[1] %></span>
%     }
      <span class="trainno"><%= $departure->{train_no} %></span>
%   }