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

train details: add date switcher

parent 503bdc30
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -817,6 +817,7 @@ sub render_train {

			$departure->{trip_id}  = $journey->id;
			$departure->{operator} = $journey->operator;
			$departure->{date}     = $route->[0]{sched_dep} // $route->[0]{dep};

			# Use HAFAS route as source of truth; ignore IRIS data
			$departure->{route_pre_diff}  = [];
@@ -1132,6 +1133,7 @@ sub train_details {
			my ( $route, $journey ) = @_;

			$res->{trip_id} = $journey->id;
			$res->{date}    = $route->[0]{sched_dep} // $route->[0]{dep};

			if ( not $res->{train_type} ) {
				my $train_type = $res->{train_type} = $journey->type   // q{};
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ our %Lexicon = (
	'Hohe Auslastung erwartet'      => 'High occupancy expected',
	'Sehr hohe Auslastung erwartet' => 'Very high occupancy expected',
	'Meldungen'                     => 'Messages',
	'Fahrtverlauf'                  => 'Route',
	'Fahrtverlauf am'               => 'Route on',
	'Betrieb'                       => 'Operator',
	'Karte'                         => 'Map',
	'Wagen'                         => 'Composition',
+4 −1
Original line number Diff line number Diff line
@@ -203,7 +203,10 @@
      </ul>
%   }
%   if ($departure->{route_pre_diff} and $departure->{route_post_diff}) {
%=    l 'Fahrtverlauf'
%=    l 'Fahrtverlauf am'
      <a href="<%= url_for('train', train => stash('train'))->query({detailed => param('detailed'), past => param('past'), rt => param('rt'), hafas => param('hafas'), date => $departure->{date}->clone->subtract(days => 1)->strftime('%d.%m.%Y'), highlight => param('highlight') // stash('station')}) %>">◀</a>
%=    $departure->{date}->strftime('%d.%m.%Y')
      <a href="<%= url_for('train', train => stash('train'))->query({detailed => param('detailed'), past => param('past'), rt => param('rt'), hafas => param('hafas'), date => $departure->{date}->clone->add(days => 1)->strftime('%d.%m.%Y'), highlight => param('highlight') // stash('station')}) %>">▶</a>
      <ul class="mroute">
%       for my $stop (@{$departure->{route_pre_diff}}) {
          <li class="<%= $stop->{isPast} ? 'past-stop' : 'future-stop' %>">