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

Swap gem layout #2774

Merged
merged 9 commits into from
Jun 3, 2021
Merged
Show file tree
Hide file tree
Changes from 8 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
10 changes: 3 additions & 7 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
$govuk-compatibility-govuktemplate: true;
$govuk-compatibility-govuktemplate: false;
$govuk-use-legacy-palette: false;

// BASE Stylesheet

// Components from govuk_publishing_components gem
@import 'govuk_publishing_components/govuk_frontend_support';
@import 'govuk_publishing_components/component_support';
@import 'govuk_publishing_components/components/back-link';
@import 'govuk_publishing_components/components/breadcrumbs';
@import 'govuk_publishing_components/components/button';
Expand All @@ -15,6 +12,7 @@ $govuk-use-legacy-palette: false;
@import 'govuk_publishing_components/components/error-alert';
@import 'govuk_publishing_components/components/error-message';
@import 'govuk_publishing_components/components/feedback';
@import 'govuk_publishing_components/components/fieldset';
@import 'govuk_publishing_components/components/govspeak';
@import 'govuk_publishing_components/components/heading';
@import 'govuk_publishing_components/components/hint';
Expand All @@ -41,7 +39,7 @@ $govuk-use-legacy-palette: false;
@import 'govuk_publishing_components/components/title';
@import 'govuk_publishing_components/components/warning-text';

// components
// local app components
@import "components/calendar";
@import "components/metadata";
@import "components/subscribe";
Expand All @@ -50,7 +48,6 @@ $govuk-use-legacy-palette: false;
@import "styleguide/conditionals";

// Helper stylesheets (things on more than one page layout)
@import "helpers/overwrites";
@import "helpers/truncated-url";
@import "helpers/title-context-reset";

Expand All @@ -62,7 +59,6 @@ $govuk-use-legacy-palette: false;
@import "views/travel-advice";
@import "views/report-child-abuse";
@import "views/local-authority";
@import "views/simple-smart-answer";

// exceptional format overrides
@import "views/location_form";
Expand Down
16 changes: 0 additions & 16 deletions app/assets/stylesheets/helpers/_overwrites.scss

This file was deleted.

2 changes: 1 addition & 1 deletion app/assets/stylesheets/print.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$govuk-compatibility-govuktemplate: true;
$govuk-compatibility-govuktemplate: false;
$govuk-use-legacy-palette: false;

@import 'govuk_publishing_components/govuk_frontend_support';
Expand Down
31 changes: 2 additions & 29 deletions app/assets/stylesheets/views/_homepage.scss
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
// Remove search from the top bar as we have one in the content.

// stylelint-disable selector-no-qualifying-type, selector-max-id
body.homepage {
#global-header-bar {
display: none;
}

#wrapper,
#content {
margin: 0;
width: auto; // needed for IE overides
max-width: 100%;
}

.feedback-wrapper {
max-width: 960px;
margin: 0 auto;
padding: 0 govuk-spacing(3);

@include govuk-media-query($from: tablet) {
padding: 0 govuk-spacing(6);
}
}
}
// stylelint-enable selector-no-qualifying-type, selector-max-id

.home-top {
overflow: hidden;
background: $govuk-brand-colour;
Expand All @@ -42,7 +15,7 @@ body.homepage {

.home-top__intro--simpler {
font-weight: bold;
margin-bottom: 20px;
margin-bottom: govuk-spacing(4);
}

.home-top__links {
Expand Down Expand Up @@ -180,7 +153,7 @@ body.homepage {

.home-numbers__large {
// Manually setting font-size rather than using the mixins size
// because the layout doesnt really work otherwise
// because the layout doesn't really work otherwise
font-size: 53px;
line-height: (55 / 53);
font-weight: bold;
Expand Down
4 changes: 0 additions & 4 deletions app/assets/stylesheets/views/_simple-smart-answer.scss

This file was deleted.

4 changes: 3 additions & 1 deletion app/assets/stylesheets/views/_travel-advice.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
}

.country-filter-form__form-group {
margin: 0; // Because fieldset has 2px margins by default.
border: 0;
margin: 0;
padding: 0;
}

.subscriptions-wrapper {
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ApplicationController < ActionController::Base
rescue_from GdsApi::HTTPForbidden, with: :error_403
rescue_from RecordNotFound, with: :cacheable_404

slimmer_template "core_layout"
slimmer_template "gem_layout"

if ENV["BASIC_AUTH_USERNAME"]
http_basic_authenticate_with(
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/calendar_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class CalendarController < ApplicationController

rescue_from Calendar::CalendarNotFound, with: :simple_404

slimmer_template "core_layout"
slimmer_template "gem_layout"

def calendar
set_expiry 1.hour
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/help_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ class HelpController < ApplicationController

def index
fetch_and_setup_content_item("/help")
render locals: { full_width: true }
slimmer_template "gem_layout"
end

def tour
fetch_and_setup_content_item("/tour")
render locals: { full_width: true }
slimmer_template "gem_layout"
end

def cookie_settings
Expand Down
4 changes: 1 addition & 3 deletions app/controllers/homepage_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ class HomepageController < ApplicationController

def index
set_slimmer_headers(
template: "core_layout",
template: "gem_layout_full_width",
remove_search: true,
)

fetch_and_setup_content_item("/")

render locals: { full_width: true }
end
end
2 changes: 1 addition & 1 deletion app/controllers/roadmap_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ class RoadmapController < ApplicationController
include Cacheable

def index
render locals: { full_width: true }
slimmer_template "gem_layout"
end
end
4 changes: 3 additions & 1 deletion app/controllers/travel_advice_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ def index
@presenter = TravelAdviceIndexPresenter.new(@content_item)

respond_to do |format|
format.html { render locals: { full_width: true } }
format.html do
slimmer_template "gem_layout"
end
format.atom do
set_expiry(5.minutes)
headers["Access-Control-Allow-Origin"] = "*"
Expand Down
28 changes: 16 additions & 12 deletions app/views/application/_location_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="postcode-search-form"
data-module="track-submit"
data-track-category="postcodeSearch:<%= publication_format %>"
data-track-action="postcodeSearchStarted">
data-module="track-submit"
data-track-category="postcodeSearch:<%= publication_format %>"
data-track-action="postcodeSearchStarted">

<% if @location_error %>
<%
Expand All @@ -22,9 +22,9 @@
} %>
<% end %>

<form method="post" id="local-locator-form" class="location-form">
<fieldset>
<legend class="visuallyhidden"><%= t('formats.local_transaction.postcode_lookup') %></legend>
<form method="post" id="local-locator-form" class="location-form govuk-!-margin-bottom-9">
<fieldset class="govuk-fieldset">
<legend class=" govuk-fieldset__legend govuk-visually-hidden"><%= t('formats.local_transaction.postcode_lookup') %></legend>

<%= render partial: 'draft_fields' %>

Expand All @@ -40,14 +40,18 @@
autocomplete: "postal-code",
} %>

<%= render "govuk_publishing_components/components/button", text: "Find", margin_bottom: true %>
<%= render "govuk_publishing_components/components/button",
text: "Find",
margin_bottom: true
%>

<%= tag.p link_to(t('formats.local_transaction.find_postcode_royal_mail'),
"https://www.royalmail.com/find-a-postcode",
id: 'postcode-finder-link',
class: "govuk-link",
rel: "external"),
class: "govuk-body" %>
"https://www.royalmail.com/find-a-postcode",
id: 'postcode-finder-link',
class: "govuk-link",
rel: "external"),
class: "govuk-body"
%>
</fieldset>
</form>
</div>
4 changes: 2 additions & 2 deletions app/views/electoral/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
method: :get,
id: "local-locator-form",
class: "location-form" do |form| %>
<%= tag.fieldset do %>
<%= tag.legend t('formats.local_transaction.postcode_lookup'), class: "govuk-visually-hidden" %>
<%= tag.fieldset class: "govuk-fieldset" do %>
<%= tag.legend t('formats.local_transaction.postcode_lookup'), class: "govuk-fieldset__legend govuk-visually-hidden" %>
<%= render partial: 'draft_fields' %>

<%= render "govuk_publishing_components/components/input", {
Expand Down
10 changes: 5 additions & 5 deletions app/views/find_local_council/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<%= render layout: 'base_page' do %>
<p class="govuk-body"><%= t('formats.local_transaction.find_council_website') %></p>
<%= render partial: 'location_form',
locals: {
format: 'service',
publication_format: 'find_local_council',
postcode: @postcode,
} %>
locals: {
format: 'service',
publication_format: 'find_local_council',
postcode: @postcode,
} %>
<% end %>
Loading