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

show load/occupancy for EFA departures and trips, if available

parent 68fcdf3d
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -446,6 +446,32 @@ sub startup {
		}
	);

	$self->helper(
		'efa_load_icon' => sub {
			my ( $self, $occupancy ) = @_;

			my @symbols
			  = (
				qw(help_outline person_outline people priority_high not_interested)
			  );

			if ( $occupancy eq 'MANY_SEATS' ) {
				$occupancy = 1;
			}
			elsif ( $occupancy eq 'FEW_SEATS' ) {
				$occupancy = 2;
			}
			elsif ( $occupancy eq 'STANDING_ONLY' ) {
				$occupancy = 3;
			}
			elsif ( $occupancy eq 'FULL' ) {
				$occupancy = 4;
			}

			return $symbols[$occupancy] // 'help_outline';
		}
	);

	$self->helper(
		'load_icon' => sub {
			my ( $self, $load ) = @_;
+3 −0
Original line number Diff line number Diff line
@@ -47,6 +47,9 @@
						<%= $checkin->{followee_name} %> → <%= $checkin->{arr_name} // '???' %>
					</span>
				% }
				% if ($result->occupancy) {
					<i class="material-icons tiny" aria-hidden="true"><%= efa_load_icon($result->occupancy) %></i>
				% }
			% }
		</span>
	</li>
+4 −0
Original line number Diff line number Diff line
@@ -5,3 +5,7 @@
	% }
	<i class="material-icons tiny" aria-hidden="true"><%= $second %></i>
% }
% elsif ($station->[2]{efa_load}) {
	% my ($icon) = efa_load_icon($station->[2]{efa_load});
	<i class="material-icons tiny" aria-hidden="true"><%= $icon %></i>
% }