-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new campaign bespoke landing page #7137
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
383acd1
Add new campaign bespoke landing page
ddippolito 71be97a
Update vacancies controller campaign action
ddippolito 6bd0eac
Parametirise subject in campaign page
ddippolito ac6a06c
Add images for campaign
ddippolito f3d2f85
Add Campaign page and configuration
ddippolito e4aef0f
Add more configuration utm codes
ddippolito 43a55d7
Add documentation for landing pages
ddippolito fb127dd
Update landing page documentation
ddippolito File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
74 changes: 74 additions & 0 deletions
74
app/assets/stylesheets/layouts/vacancies/campaign_landing_page.scss
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,74 @@ | ||
.vacancies_campaign_landing_page { | ||
@import '../shared/search-results'; | ||
|
||
.custom-banner-background { | ||
background-color: govuk-colour('light-grey'); | ||
width: 100vw; | ||
position: relative; | ||
margin-left: calc(-50vw + 50%); | ||
margin-right: calc(-50vw + 50%); | ||
padding: govuk-spacing(4) 0; | ||
margin-bottom: 30px; | ||
} | ||
|
||
.custom-banner { | ||
padding: govuk-spacing(4) 0; | ||
} | ||
|
||
.search-results-controls { | ||
|
||
@include govuk-media-query($from: tablet) { | ||
margin-bottom: govuk-spacing(4); | ||
|
||
.autocomplete, .govuk-form-group { | ||
margin-bottom: 20px; | ||
} | ||
|
||
.location-search__radius { | ||
.govuk-select[name='radius'] { | ||
width: min-content; | ||
min-width: 0; | ||
} | ||
} | ||
|
||
.autocomplete__menu { | ||
@include govuk-media-query($from: desktop) { | ||
position: absolute; | ||
} | ||
} | ||
|
||
&__submit { | ||
.govuk-button { | ||
margin-bottom: 0; | ||
} | ||
} | ||
|
||
.govuk-hint { | ||
display: none; | ||
} | ||
} | ||
|
||
@include govuk-media-query($until: tablet) { | ||
&__submit { | ||
.govuk-button { | ||
margin-bottom: govuk-spacing(3); | ||
} | ||
} | ||
} | ||
|
||
.location-search__radius { | ||
margin-top: govuk-spacing(6); | ||
flex-basis: 200px; | ||
|
||
@include govuk-media-query($until: tablet) { | ||
.govuk-select[name='radius'] { | ||
width: 100%; | ||
} | ||
} | ||
|
||
@include govuk-media-query($from: tablet) { | ||
margin-top: 0; | ||
} | ||
} | ||
} | ||
} |
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,24 @@ | ||
class CampaignPage | ||
attr_reader :utm_content_code, :criteria, :banner_image | ||
|
||
def self.exists?(utm_content) | ||
Rails.application.config.campaign_pages.key?(utm_content.to_sym) | ||
end | ||
|
||
def self.[](utm_content_code) | ||
raise "No such campaign page: '#{utm_content_code}'" unless exists?(utm_content_code) | ||
|
||
criteria = Rails.application.config.campaign_pages[utm_content_code.to_sym].except(:banner_image) | ||
new(utm_content_code, criteria) | ||
end | ||
|
||
def initialize(utm_content_code, criteria) | ||
@utm_content_code = utm_content_code.to_s | ||
@banner_image = Rails.application.config.campaign_pages[utm_content_code.to_sym][:banner_image] | ||
@criteria = criteria | ||
end | ||
|
||
def banner_title(name, subject = nil) | ||
I18n.t("campaign_pages.#{utm_content_code}.banner_title", name: name, subject: subject) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
- content_for :skip_links do | ||
= govuk_skip_link(href: "#search-results", text: t("jobs.skip_link_list")) | ||
|
||
- content_for :breadcrumbs do | ||
= govuk_breadcrumbs breadcrumbs: organisation_landing_page_breadcrumbs(@vacancies_search.organisation_slug) if @vacancies_search.organisation_slug.present? | ||
|
||
= render "vacancies/search/page_title_and_description", landing_page: @landing_page | ||
|
||
h1 class="govuk-heading-l" role="heading" aria-level="1" | ||
= t("jobs.search_result_heading", count: number_with_delimiter(@vacancies_search.total_count)) | ||
|
||
- any_vacancies = @vacancies_search.total_count.positive? | ||
- if @vacancies_search.active_criteria? && any_vacancies | ||
p = t("subscriptions.link.help_text_html", link: govuk_link_to(t("subscriptions.link.text"), new_subscription_path(search_criteria: @vacancies_search.active_criteria, coordinates_present: @vacancies_search.point_coordinates.present?))) | ||
|
||
= form_for @form, as: "", url: jobs_path, method: :get, html: { data: { controller: "form" }, role: "search" } do |f| | ||
.custom-banner-background | ||
.govuk-width-container | ||
.custom-banner | ||
.govuk-grid-row | ||
.govuk-grid-column-one-third-at-desktop | ||
h1.govuk-heading-l class="govuk-!-margin-bottom-4" = @campaign_page.banner_title(@jobseeker_name, @subject) | ||
= render "vacancies/search/fields_and_button", f: f, form: @form, show_keyword: false | ||
|
||
.govuk-grid-column-two-thirds-at-desktop | ||
img src=image_path(@campaign_page.banner_image) class="govuk-!-margin-top-2" width="90%" height="90%" alt="Primary school classroom with children" | ||
|
||
.govuk-grid-row | ||
.govuk-grid-column-one-third-at-desktop class="govuk-!-margin-bottom-3" | ||
= render "vacancies/search/filters", f: f, form: @form, vacancies_search: @vacancies_search | ||
/ When the user refines their search, this helps us figure out if they've changed the | ||
/ keyword(s), or just adjusted the filters | ||
= f.hidden_field :previous_keyword, value: @vacancies_search.keyword | ||
= f.hidden_field :organisation_slug, value: @vacancies_search.organisation_slug | ||
|
||
.govuk-grid-column-two-thirds-at-desktop | ||
= render "vacancies/search/open_filters_button", form: @form | ||
|
||
#search-results | ||
- if any_vacancies | ||
div class="sort-container" | ||
div class="left" | ||
- sort_by_value = @vacancies_search.sort.options.find { |option| option.by == @vacancies_search.sort.by }.display_name.downcase | ||
- sorted_by_string = t("jobs.sort_by.jobs_page_label", sort_by_value: sort_by_value) | ||
h2 class="govuk-heading-m govuk-!-margin-bottom-3 govuk-!-margin-top-1" = sorted_by_string | ||
div class="right" | ||
= render "vacancies/search/sort", form: @form, vacancies_search: @vacancies_search, vacancies: @vacancies, display: "inline-dropdown" | ||
- if @vacancies_search.location | ||
p = "Jobs in or near #{@vacancies_search.location}" | ||
.govuk-grid-row | ||
.govuk-grid-column-full | ||
hr class="govuk-section-break govuk-section-break--s govuk-section-break--visible govuk-!-margin-bottom-3" | ||
|
||
= render "vacancies/search/results", vacancies: @vacancies | ||
- elsif @vacancies_search.organisation_slug | ||
= render "vacancies/search/no_results_organisation", organisation_name: @vacancies_search.organisation.name | ||
- elsif @vacancies_search.active_criteria? | ||
= render "vacancies/search/no_results_suggestions", vacancies_search: @vacancies_search | ||
- else | ||
= render "vacancies/search/no_results" | ||
= govuk_pagination(pagy: @pagy) | ||
- if any_vacancies | ||
= render "vacancies/search/stats" |
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
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,134 @@ | ||
shared: | ||
whentoapplybespoke+PRIMARY: | ||
banner_image: "campaigns/primary_teacher.jpg" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👏 |
||
teaching_job_roles: | ||
- teacher | ||
phases: | ||
- primary | ||
radius: | ||
- 15 | ||
whentoapplybespoke+SECONDARY: | ||
banner_image: "campaigns/secondary_teacher.jpg" | ||
teaching_job_roles: | ||
- teacher | ||
phases: | ||
- secondary | ||
radius: | ||
- 15 | ||
ectrolesbespoke: | ||
banner_image: "campaigns/ect_teacher.jpg" | ||
ect_suitable: true | ||
teaching_job_roles: | ||
- teacher | ||
radius: | ||
- 15 | ||
mathsbespoke: | ||
banner_image: "campaigns/subjects.jpg" | ||
teaching_job_roles: | ||
- teacher | ||
radius: | ||
- 15 | ||
dancedramamusicbespoke: | ||
banner_image: "campaigns/subjects.jpg" | ||
teaching_job_roles: | ||
- teacher | ||
radius: | ||
- 15 | ||
dancedramamusicbespoke: | ||
banner_image: "campaigns/subjects.jpg" | ||
teaching_job_roles: | ||
- teacher | ||
radius: | ||
- 15 | ||
computingbespoke: | ||
banner_image: "campaigns/subjects.jpg" | ||
teaching_job_roles: | ||
- teacher | ||
radius: | ||
- 15 | ||
chemistrybespoke: | ||
banner_image: "campaigns/subjects.jpg" | ||
teaching_job_roles: | ||
- teacher | ||
radius: | ||
- 15 | ||
businessandeconomicsbespoke: | ||
banner_image: "campaigns/subjects.jpg" | ||
teaching_job_roles: | ||
- teacher | ||
radius: | ||
- 15 | ||
re: | ||
banner_image: "campaigns/subjects.jpg" | ||
teaching_job_roles: | ||
- teacher | ||
radius: | ||
- 15 | ||
biologybespoke: | ||
banner_image: "campaigns/subjects.jpg" | ||
teaching_job_roles: | ||
- teacher | ||
radius: | ||
- 15 | ||
englishbespoke: | ||
banner_image: "campaigns/subjects.jpg" | ||
teaching_job_roles: | ||
- teacher | ||
radius: | ||
- 15 | ||
psychologybespoke: | ||
banner_image: "campaigns/subjects.jpg" | ||
teaching_job_roles: | ||
- teacher | ||
radius: | ||
- 15 | ||
parttimebespoke+PRIMARY: | ||
banner_image: "campaigns/primary_part_time.jpg" | ||
teaching_job_roles: | ||
- teacher | ||
working_patterns: | ||
- part_time | ||
- job_share | ||
radius: | ||
- 15 | ||
parttimebespoke+SECONDARY: | ||
banner_image: "campaigns/secondary_part_time.jpg" | ||
teaching_job_roles: | ||
- teacher | ||
phases: | ||
- secondary | ||
working_patterns: | ||
- part_time | ||
- job_share | ||
radius: | ||
- 15 | ||
stilltimebespoke+PRIMARY: | ||
banner_image: "campaigns/primary_not_too_late.jpg" | ||
teaching_job_roles: | ||
- teacher | ||
phases: | ||
- primary | ||
radius: | ||
- 15 | ||
stilltimebespoke+SECONDARY: | ||
banner_image: "campaigns/secondary_not_too_late.jpg" | ||
teaching_job_roles: | ||
- teacher | ||
phases: | ||
- secondary | ||
radius: | ||
- 15 | ||
|
||
#################################################################################################### | ||
# The data below is only used in automated tests, make sure you add your campaign pages to the | ||
# `shared` section above! | ||
#################################################################################################### | ||
test: | ||
FAKE1+CAMPAIGN: | ||
banner_image: "campaigns/secondary_not_too_late.jpg" | ||
working_patterns: | ||
- part_time | ||
subjects: | ||
- Potions | ||
- Sorcery | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we gracefully handle this so users don't get a service error when the param value is wrong?I would expect a user to get a
404
page or get redirected to the generic vacancies page.Oh this seems unreachable due to the route constraint bellow.
Forget my original comment then, this is a good enough safeguard!