Skip to content
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 User Research banner to the GOV.UK homepage #3785

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/assets/stylesheets/views/_homepage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,10 @@
padding-right: govuk-spacing(4);
}
}

.homepage-section--user-research {
.gem-c-intervention {
margin-top: govuk-spacing(6);
margin-bottom: govuk-spacing(4);
}
}
10 changes: 10 additions & 0 deletions app/views/homepage/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
<%= render "homepage/links_and_search", locals: { index_section: 1, index_section_count: index_section_count } %>

<div class="govuk-width-container">
<div class="govuk-grid-row">
<div class="govuk-grid-column-full homepage-section--user-research">
<%= render "govuk_publishing_components/components/intervention", {
suggestion_text: t("homepage.index.user_research_banner_suggestion_text"),
suggestion_link_text: t("homepage.index.user_research_banner_link_text"),
suggestion_link_url: t("homepage.index.user_research_banner_link_href"),
new_tab: true,
} %>
</div>
</div>
<div class="govuk-grid-row">
<div class="govuk-grid-column-full govuk-grid-column-two-thirds-from-desktop">
<%= render "homepage/services_and_information", locals: { index_section: 2, index_section_count: index_section_count } %>
Expand Down
3 changes: 3 additions & 0 deletions config/locales/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,9 @@ cy:
tax_account:
uk_bank_holidays:
universal_credit:
user_research_banner_suggestion_text:
user_research_banner_link_text:
user_research_banner_link_href:
most_active:
'no': Na
or:
Expand Down
3 changes: 3 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,9 @@ en:
tax_account: Sign in to your personal tax account
uk_bank_holidays: UK bank holidays
universal_credit: Sign in to your Universal Credit account
user_research_banner_suggestion_text: Help improve GOV.UK
user_research_banner_link_text: Take part in user research (opens in a new tab)
user_research_banner_link_href: https://surveys.publishing.service.gov.uk/s/GOVStudy1/
# If adding or removing items remember to update the `columns()` mixin in
# the homepage-most-active-list class in _homepage.scss.
most_active:
Expand Down
5 changes: 5 additions & 0 deletions test/integration/homepage_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ class HomepageTest < ActionDispatch::IntegrationTest
visit "/"
assert_equal 200, page.status_code
assert_equal "Welcome to GOV.UK", page.title
assert page.has_content?(I18n.t("homepage.index.user_research_banner_suggestion_text", locale: :en))
assert page.has_link?(
I18n.t("homepage.index.user_research_banner_link_text", locale: :en),
href: I18n.t("homepage.index.user_research_banner_link_href", locale: :en),
)
end

context "when visiting a Welsh content item first" do
Expand Down