-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4360 from DFE-Digital/2027-update-apply-deadline-…
…banner-in-publish [2027] Update apply deadline banner in publish
- Loading branch information
Showing
6 changed files
with
65 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
en: | ||
apply_deadline_banner: | ||
heading: The deadline for applying to courses starting in %{cycle_year_range} is %{apply_deadline} | ||
text: Courses may fill up before then. Check course availability with the provider. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# frozen_string_literal: true | ||
|
||
module Find | ||
class DeadlineBannerComponentPreview < ViewComponent::Preview | ||
def show_apply_deadline_banner | ||
render( | ||
Find::DeadlineBannerComponent.new( | ||
flash_empty: true, | ||
cycle_timetable: ShowApplyDeadlineBannerCycleTimetable | ||
) | ||
) | ||
end | ||
|
||
def show_cycle_closed_banner | ||
render( | ||
Find::DeadlineBannerComponent.new( | ||
flash_empty: true, | ||
cycle_timetable: ShowCycleClosedBannerTimetable | ||
) | ||
) | ||
end | ||
end | ||
|
||
class ShowApplyDeadlineBannerCycleTimetable < CycleTimetable | ||
def self.show_apply_deadline_banner? | ||
true | ||
end | ||
|
||
def self.show_cycle_closed_banner? | ||
false | ||
end | ||
end | ||
|
||
class ShowCycleClosedBannerTimetable < CycleTimetable | ||
def self.show_apply_deadline_banner? | ||
false | ||
end | ||
|
||
def self.show_cycle_closed_banner? | ||
true | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters