Commit 18e06ad1 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

departure view: use IRIS to decide whether realtime is missing

parent f195abb2
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -475,6 +475,16 @@ sub render_train {
		)
	];

	if ( not $result->has_realtime ) {
		my $now = DateTime->now( time_zone => 'Europe/Berlin' );
		if ( $result->start < $now ) {
			$departure->{missing_realtime} = 1;
		}
		else {
			$departure->{no_realtime_yet} = 1;
		}
	}

	my $linetype = 'bahn';
	my @classes  = $result->classes;
	if ( @classes == 0 ) {
@@ -680,7 +690,8 @@ sub render_train {
			}
			if ($route_ts) {
				if ( $route_ts->{ $result->station }{rt_bogus} ) {
					$departure->{missing_realtime} = 1;

					#$departure->{missing_realtime} = 1;
				}
				for my $elem (
					@{ $departure->{route_pre_diff} },
+4 −4
Original line number Diff line number Diff line
@@ -133,10 +133,10 @@
        <a class="smallbutton" href="<%= $link->[1] %>"><i class="material-icons" aria-hidden="true">warning</i> <%= $link->[0] %></a>
%     }
%     if ($departure->{missing_realtime}) {
        <span class="disabledbutton" title="Nur Fahrplandaten verfügbar. Ob die Zugfahrt tatsächlich stattfindet, ist noch nicht bekannt."><i class="material-icons" aria-hidden="true">gps_off</i> Echtzeitdaten fehlen</span>
        <span class="disabledbutton" title="Nur Fahrplandaten verfügbar. Ob die Zugfahrt tatsächlich stattfindet, ist nicht bekannt."><i class="material-icons" aria-hidden="true">gps_off</i> Echtzeitdaten fehlen</span>
%     }
%     elsif ($departure->{partially_missing_realtime}) {
        <span class="disabledbutton"><i class="material-icons" aria-hidden="true">gps_off</i> Echtzeitdaten unvollständig</span>
%     elsif ($departure->{no_realtime_yet}) {
        <span class="disabledbutton" title="Nur Fahrplandaten verfügbar. Ob die Zugfahrt tatsächlich stattfindet, ist noch nicht bekannt."><i class="material-icons" aria-hidden="true">gps_off</i> Noch keine Echtzeitdaten verfügbar</span>
%     }
    </div>

@@ -225,7 +225,7 @@
                (heute <%= $departure->{arrival} %>)
%             }
%           }
%           if ($departure->{missing_realtime}) {
%           if ($departure->{missing_realtime} or $departure->{no_realtime_yet}) {
              <i class="material-icons" aria-label="Echtzeitdaten fehlen">gps_off</i>
%           }
            <strong><%= stash('station_name') %></strong>