Unverified Commit 17563a92 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

distinguish between 'on time' and 'no realtime data available' in rt=1

parent e04f4cde
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -273,6 +273,25 @@ sub startup {
		}
	);

	$self->helper(
		'get_rt_time_class' => sub {
			my ( $self, $train ) = @_;
			if (    $train->{has_realtime}
				and not $train->{is_bit_delayed}
				and not $train->{is_delayed} )
			{
				return 'on-time';
			}
			if ( $train->{is_bit_delayed} ) {
				return 'a-bit-delayed';
			}
			if ( $train->{is_delayed} ) {
				return 'delayed';
			}
			return q{};
		}
	);

	my $r = $self->routes;

	$r->get('/_redirect')->to('stationboard#redirect_to_station');
+14 −6
Original line number Diff line number Diff line
@@ -1878,8 +1878,12 @@ sub handle_result {
						station        => $result->station,
						moreinfo       => $moreinfo,
						delay          => $delay,
						is_bit_delayed =>
						  ( $delay and $delay > 0 and $delay < 5 ? 1 : 0 ),
						is_delayed       => ( $delay and $delay >= 5 ? 1 : 0 ),
						arrival_delay    => $result->arrival_delay,
						departure_delay  => $result->departure_delay,
						has_realtime     => $result->has_realtime,
						missing_realtime => (
							not $result->has_realtime
							  and $result->start < $now ? 1 : 0
@@ -1939,6 +1943,10 @@ sub handle_result {
						station            => $result->station,
						moreinfo           => $moreinfo,
						delay              => $delay,
						is_bit_delayed     =>
						  ( $delay and $delay > 0 and $delay < 5 ? 1 : 0 ),
						is_delayed      => ( $delay and $delay >= 5 ? 1 : 0 ),
						has_realtime    => defined $delay ? 1 : 0,
						replaced_by     => [],
						replacement_for => [],
						route_pre       => $admode eq 'arr'
+10 −0
Original line number Diff line number Diff line
@@ -418,6 +418,16 @@ div.app {
					background-color: transparent;
				}

				&.a-bit-delayed {
					color: $smalldelay-color;
					background-color: transparent;
				}

				&.on-time {
					color: $ontime-color;
					background-color: transparent;
				}

				.no-realtime {
					background-color: transparent;
					padding-right: 1ex;
+2 −0
Original line number Diff line number Diff line
@@ -32,9 +32,11 @@ $route-color: #dddddd;

$info-color: #ff7777;
$delay-color: #ff7777;
$smalldelay-color: #dd9999;
$undelay-color: #77ff77;
$delaynorm-color: #dd9999;
$undelaynorm-color: #99dd99;
$ontime-color: #aaeeaa;

$additional-stop-color: #77ff77;
$cancelled-stop-color: #ff7777;
+2 −0
Original line number Diff line number Diff line
@@ -32,9 +32,11 @@ $route-color: #444444;

$info-color: #ff0000;
$delay-color: #ff0000;
$smalldelay-color: #bb3333;
$undelay-color: #006600;
$delaynorm-color: #bb3333;
$undelaynorm-color: #338833;
$ontime-color: #227722;

$additional-stop-color: #009900;
$cancelled-stop-color: #cc0000;
Loading