Skip to content

Commit

Permalink
feat: Elevator evergreen content (#2318)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaddox5 authored Nov 26, 2024
1 parent c98aa3e commit 6e25840
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
6 changes: 6 additions & 0 deletions assets/css/elevator_v2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
@import "v2/elevator/footer";
@import "v2/lcd_common/route_pill";

.evergreen-content-image__container,
.evergreen-content-image__image {
width: 100%;
height: 100%;
}

body {
margin: 0;
font-family: Inter;
Expand Down
12 changes: 9 additions & 3 deletions lib/screens/v2/candidate_generator/elevator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ defmodule Screens.V2.CandidateGenerator.Elevator do

alias Screens.V2.CandidateGenerator
alias Screens.V2.CandidateGenerator.Elevator.Closures, as: ElevatorClosures
alias Screens.V2.CandidateGenerator.Widgets.Evergreen
alias Screens.V2.Template.Builder
alias Screens.V2.WidgetInstance.{Footer, NormalHeader}
alias ScreensConfig.Screen
Expand All @@ -27,10 +28,15 @@ defmodule Screens.V2.CandidateGenerator.Elevator do
def candidate_instances(
config,
now \\ DateTime.utc_now(),
elevator_closure_instances_fn \\ &ElevatorClosures.elevator_status_instances/1
elevator_closure_instances_fn \\ &ElevatorClosures.elevator_status_instances/1,
evergreen_content_instances_fn \\ &Evergreen.evergreen_content_instances/2
) do
[header_instance(config, now), footer_instance(config)] ++
elevator_closure_instances_fn.(config)
Enum.concat([
header_instance(config, now),
footer_instance(config),
elevator_closure_instances_fn.(config),
evergreen_content_instances_fn.(config, now)
])
end

def audio_only_instances(_widgets, _config), do: []
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/v2/candidate_generator/widgets/evergreen.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ defmodule Screens.V2.CandidateGenerator.Widgets.Evergreen do
alias Screens.V2.WidgetInstance.EvergreenContent
alias ScreensConfig.Screen
alias ScreensConfig.V2.EvergreenContentItem
alias ScreensConfig.V2.{BusEink, BusShelter, Dup, GlEink, PreFare}
alias ScreensConfig.V2.{BusEink, BusShelter, Dup, Elevator, GlEink, PreFare}

def evergreen_content_instances(
%Screen{app_params: %app{evergreen_content: evergreen_content}} = config,
now \\ DateTime.utc_now()
)
when app in [BusEink, BusShelter, Dup, GlEink, PreFare] do
when app in [BusEink, BusShelter, Dup, Elevator, GlEink, PreFare] do
Enum.map(evergreen_content, &evergreen_content_instance(&1, config, now))
end

Expand Down

0 comments on commit 6e25840

Please sign in to comment.