diff options
-rw-r--r-- | lib/DBInfoscreen/Controller/Stationboard.pm | 13 | ||||
-rw-r--r-- | templates/_train_details.html.ep | 8 |
2 files changed, 16 insertions, 5 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index b71d6d8..0d5a96a 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -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} }, diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index eea449d..ab96c38 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -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> |