Skip to content

Commit

Permalink
Merge pull request #3652 from alphagov/revert-3649-fix-containers
Browse files Browse the repository at this point in the history
Revert "Remove unnecessary padding on search results layout"
  • Loading branch information
andysellick authored Feb 3, 2025
2 parents 2d2c302 + 6dfbf59 commit 2c025bf
Show file tree
Hide file tree
Showing 5 changed files with 235 additions and 225 deletions.
154 changes: 78 additions & 76 deletions app/views/email_alert_subscriptions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,87 +8,89 @@
<%= render 'govuk_publishing_components/components/phase_banner', phase: "beta" %>
<% end %>

<%
ga4_data = {
event_name: "form_response",
type: "email subscription",
section: t("email_alert_subscriptions.new.question", locale: :en),
action: "continue",
tool_name: "Get emails from GOV.UK",
}.to_json
%>
<%= form_tag(
email_alert_subscriptions_path(subscriber_list_params: subscriber_list_params),
class: 'signup-choices',
data: {
module: "ga4-form-tracker",
ga4_form: ga4_data,
}) do %>
<% if @signup_presenter.can_modify_choices? %>
<%= render "govuk_publishing_components/components/heading", {
text: @signup_presenter.name,
heading_level: 1,
font_size: "xl",
margin_bottom: 8,
} %>
<div class="govuk-width-container">
<%
ga4_data = {
event_name: "form_response",
type: "email subscription",
section: t("email_alert_subscriptions.new.question", locale: :en),
action: "continue",
tool_name: "Get emails from GOV.UK",
}.to_json
%>
<%= form_tag(
email_alert_subscriptions_path(subscriber_list_params: subscriber_list_params),
class: 'signup-choices',
data: {
module: "ga4-form-tracker",
ga4_form: ga4_data,
}) do %>
<% if @signup_presenter.can_modify_choices? %>
<%= render "govuk_publishing_components/components/heading", {
text: @signup_presenter.name,
heading_level: 1,
font_size: "xl",
margin_bottom: 8,
} %>

<% if @error_message.present? %>
<%
ga4_data = {
event_name: "form_error",
type: "email subscription",
text: @error_message,
section: t("email_alert_subscriptions.new.question", locale: :en),
action: "error",
tool_name: "Get emails from GOV.UK"
}.to_json
%>
<%= content_tag(:div,
data: {
module: "ga4-auto-tracker",
ga4_auto: ga4_data
}) do %>
<%= render "govuk_publishing_components/components/error_summary", {
title: "There is a problem",
items: [
{
text: @error_message,
href: "#signup-choices-options",
}
]
} %>
<% if @error_message.present? %>
<%
ga4_data = {
event_name: "form_error",
type: "email subscription",
text: @error_message,
section: t("email_alert_subscriptions.new.question", locale: :en),
action: "error",
tool_name: "Get emails from GOV.UK"
}.to_json
%>
<%= content_tag(:div,
data: {
module: "ga4-auto-tracker",
ga4_auto: ga4_data
}) do %>
<%= render "govuk_publishing_components/components/error_summary", {
title: "There is a problem",
items: [
{
text: @error_message,
href: "#signup-choices-options",
}
]
} %>
<% end %>
<% end %>
<% end %>

<%= render "govuk_publishing_components/components/checkboxes", {
id: "signup-choices-options",
name: nil,
no_hint_text: true,
heading: t("email_alert_subscriptions.new.question"),
items: @signup_presenter.choices_formatted,
error: @error_message,
} %>
<%= render "govuk_publishing_components/components/checkboxes", {
id: "signup-choices-options",
name: nil,
no_hint_text: true,
heading: t("email_alert_subscriptions.new.question"),
items: @signup_presenter.choices_formatted,
error: @error_message,
} %>

<% else %>
<% else %>

<%= render "govuk_publishing_components/components/heading", {
text: t("email_alert_subscriptions.new.title"),
heading_level: 1,
font_size: "xl",
margin_bottom: 8,
} %>
<%= render "govuk_publishing_components/components/heading", {
text: t("email_alert_subscriptions.new.title"),
heading_level: 1,
font_size: "xl",
margin_bottom: 8,
} %>

<p class="govuk-body">
<%= t("email_alert_subscriptions.new.description") %>
</p>
<p class="govuk-body">
<%= t("email_alert_subscriptions.new.description") %>
</p>

<p class="govuk-body govuk-!-margin-bottom-8">
<strong class="govuk-!-font-weight-bold"><%= @signup_presenter.name %></strong>
</p>
<% end %>
<p class="govuk-body govuk-!-margin-bottom-8">
<strong class="govuk-!-font-weight-bold"><%= @signup_presenter.name %></strong>
</p>
<% end %>

<%= render "govuk_publishing_components/components/button", {
text: "Continue",
margin_bottom: true
} %>
<% end %>
<%= render "govuk_publishing_components/components/button", {
text: "Continue",
margin_bottom: true
} %>
<% end %>
</div>
40 changes: 21 additions & 19 deletions app/views/finders/_before_content.html.erb
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<% content_for :before_content do %>
<div class="app-before-content<%= " app-before-content--inverse" if is_inverse? %>">
<% if content_item.show_phase_banner? %>
<%= render 'govuk_publishing_components/components/phase_banner', {
phase: content_item.phase,
message: sanitize(content_item.phase_message),
inverse: is_inverse?
} %>
<% end %>
<div class="govuk-width-container">
<% if content_item.show_phase_banner? %>
<%= render 'govuk_publishing_components/components/phase_banner', {
phase: content_item.phase,
message: sanitize(content_item.phase_message),
inverse: is_inverse?
} %>
<% end %>

<% if @breadcrumbs.breadcrumbs %>
<%= render 'govuk_publishing_components/components/breadcrumbs', {
breadcrumbs: @breadcrumbs.breadcrumbs,
inverse: is_inverse?,
collapse_on_mobile: true
} %>
<% else %>
<%= render 'govuk_publishing_components/components/contextual_breadcrumbs', {
content_item: content_item.as_hash,
inverse: is_inverse?
} %>
<% end %>
<% if @breadcrumbs.breadcrumbs %>
<%= render 'govuk_publishing_components/components/breadcrumbs', {
breadcrumbs: @breadcrumbs.breadcrumbs,
inverse: is_inverse?,
collapse_on_mobile: true
} %>
<% else %>
<%= render 'govuk_publishing_components/components/contextual_breadcrumbs', {
content_item: content_item.as_hash,
inverse: is_inverse?
} %>
<% end %>
</div>
</div>
<% end %>
142 changes: 72 additions & 70 deletions app/views/finders/_show_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,78 +1,80 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<% if content_item.all_content_finder? %>
<%= render "govuk_publishing_components/components/heading", {
text: sanitize("Search <span class='govuk-visually-hidden'>all content</span>"),
heading_level: 1,
font_size: "xl",
margin_bottom: 4,
inverse: inverse,
} %>
<div id="keywords" class="app-patch--search-input-override" role="search" aria-label="Sitewide" data-ga4-change-category="update-keyword text">
<%= render "govuk_publishing_components/components/search", {
aria_controls: "js-search-results-info",
label_id: "finder-keyword-search",
name: "keywords",
type: 'search',
value: result_set_presenter.user_supplied_keywords,
on_govuk_blue: inverse,
disable_corrections: true,
<div class="govuk-width-container">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<% if content_item.all_content_finder? %>
<%= render "govuk_publishing_components/components/heading", {
text: sanitize("Search <span class='govuk-visually-hidden'>all content</span>"),
heading_level: 1,
font_size: "xl",
margin_bottom: 4,
inverse: inverse,
} %>
<div id="keywords" class="app-patch--search-input-override" role="search" aria-label="Sitewide" data-ga4-change-category="update-keyword text">
<%= render "govuk_publishing_components/components/search", {
aria_controls: "js-search-results-info",
label_id: "finder-keyword-search",
name: "keywords",
type: 'search',
value: result_set_presenter.user_supplied_keywords,
on_govuk_blue: inverse,
disable_corrections: true,
} %>
</div>
<div id="js-spelling-suggestions" class="spelling-suggestions">
<%= render 'spelling_suggestion' %>
</div>
<% elsif topic_finder?(filter_params) %>
<%= link_to topic_finder_parent(filter_params)['title'], topic_finder_parent(filter_params)['base_path'], class: 'govuk-link topic-finder__taxon-link' %>
<%= render "govuk_publishing_components/components/heading", {
text: content_item.title,
inverse: inverse,
heading_level: 1,
font_size: "xl",
margin_bottom: 8,
} %>
<% else %>
<%= render "govuk_publishing_components/components/heading", {
text: content_item.title,
context: title_context,
inverse: inverse,
heading_level: 1,
font_size: "xl",
margin_bottom: 8,
} %>
<% end %>

<% if page_metadata.any? %>
<% page_metadata.merge!({ inverse: inverse, inverse_compress: true, margin_bottom: 2 }) %>
<%= render 'govuk_publishing_components/components/metadata', page_metadata %>
<% end %>
</div>

<% if content_item.summary %>
<div class="govuk-grid-column-two-thirds">
<div class="metadata-summary ">
<%= render 'govuk_publishing_components/components/govspeak', { inverse: inverse } do %>
<%= sanitize(content_item.summary) %>
<% end %>
</div>
</div>
<div id="js-spelling-suggestions" class="spelling-suggestions">
<%= render 'spelling_suggestion' %>
</div>
<% elsif topic_finder?(filter_params) %>
<%= link_to topic_finder_parent(filter_params)['title'], topic_finder_parent(filter_params)['base_path'], class: 'govuk-link topic-finder__taxon-link' %>
<%= render "govuk_publishing_components/components/heading", {
text: content_item.title,
inverse: inverse,
heading_level: 1,
font_size: "xl",
margin_bottom: 8,
} %>
<% else %>
<%= render "govuk_publishing_components/components/heading", {
text: content_item.title,
context: title_context,
inverse: inverse,
heading_level: 1,
font_size: "xl",
margin_bottom: 8,
} %>
<% end %>

<% if page_metadata.any? %>
<% page_metadata.merge!({ inverse: inverse, inverse_compress: true, margin_bottom: 2 }) %>
<%= render 'govuk_publishing_components/components/metadata', page_metadata %>
<% if content_item.logo_path %>
<div class="finder-logo govuk-grid-column-one-third">
<%= image_tag content_item.logo_path, class: "finder-logo__image" %>
</div>
<% end %>
</div>

<% if content_item.summary %>
<div class="govuk-grid-column-two-thirds">
<div class="metadata-summary ">
<%= render 'govuk_publishing_components/components/govspeak', { inverse: inverse } do %>
<%= sanitize(content_item.summary) %>
<% end %>
<% if content_item.related.any? %>
<div class="related-links govuk-grid-column-one-third">
<ul class="js-finder-results">
<% content_item.related.each do |link| %>
<li class="related-links__item">
<%= link_to link['title'], link['web_url'], class: "related-links__link" %>
</li>
<% end %>
</ul>
</div>
</div>
<% end %>

<% if content_item.logo_path %>
<div class="finder-logo govuk-grid-column-one-third">
<%= image_tag content_item.logo_path, class: "finder-logo__image" %>
</div>
<% end %>

<% if content_item.related.any? %>
<div class="related-links govuk-grid-column-one-third">
<ul class="js-finder-results govuk-list">
<% content_item.related.each do |link| %>
<li class="related-links__item">
<%= link_to link['title'], link['web_url'], class: "related-links__link" %>
</li>
<% end %>
</ul>
</div>
<% end %>
<% end %>
</div>
</div>
Loading

0 comments on commit 2c025bf

Please sign in to comment.