Skip to content

Commit

Permalink
Exclude the 'govuk-main-wrapper' class from certain pages as it intro…
Browse files Browse the repository at this point in the history
…duces too much extra spacing
  • Loading branch information
JamesCGDS committed Feb 18, 2025
1 parent 22d123c commit a79eb3a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/presenters/content_item_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ def show_default_breadcrumbs?
true
end

def exclude_main_wrapper?
false
end

private

def voting_is_open?
Expand Down
4 changes: 4 additions & 0 deletions app/presenters/html_publication_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def full_path(request)
request.base_url + request.path
end

def exclude_main_wrapper?
true
end

private

def public_timestamp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ def sponsoring_organisations
worldwide_organisation&.sponsoring_organisations
end

def exclude_main_wrapper?
true
end

private

def show_contents_list?
Expand Down
4 changes: 4 additions & 0 deletions app/presenters/worldwide_office_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def sponsoring_organisations
worldwide_organisation&.sponsoring_organisations
end

def exclude_main_wrapper?
true
end

private

def show_contents_list?
Expand Down
4 changes: 4 additions & 0 deletions app/presenters/worldwide_organisation_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ def sponsoring_organisations
content_item.dig("links", "sponsoring_organisations") || []
end

def exclude_main_wrapper?
true
end

private

def office(office, contact)
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<%= yield :header %>

<main role="main" id="content" class="<%= @content_item.schema_name.dasherize %> govuk-main-wrapper" lang="<%= I18n.locale %>">
<main role="main" id="content" class="<%= @content_item.schema_name.dasherize %> <%= 'govuk-main-wrapper' unless @content_item.exclude_main_wrapper? %>" lang="<%= I18n.locale %>">
<span id="Top"></span>
<%= yield :main %>
</main>
Expand Down

0 comments on commit a79eb3a

Please sign in to comment.