Skip to content

Commit

Permalink
Add public layout component based layout template
Browse files Browse the repository at this point in the history
Uses the public layout component[1] to add a constrained width and a full width
layout template.

Dependent on Slimmer having compatibility added [2].

[1]: https://components.publishing.service.gov.uk/component-guide/layout_for_public
[2]: alphagov/slimmer#265
  • Loading branch information
injms committed Mar 30, 2021
1 parent 374d0f7 commit 1d94589
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/controllers/root_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class RootController < ApplicationController
503
504
campaign
gem_layout
gem_layout_full_width
scheduled_maintenance
print
proposition_menu
Expand Down
2 changes: 1 addition & 1 deletion app/views/root/_error_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= stylesheet_link_tag "error-page-print", media: "print" %>
<% end %>

<% if @emergency_banner then
<% if @emergency_banner
emergency_banner = render "components/emergency_banner", {
campaign_class: @emergency_banner.campaign_class,
heading: @emergency_banner.heading,
Expand Down
45 changes: 45 additions & 0 deletions app/views/root/_gem_base.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<% if @emergency_banner
emergency_banner = render "components/emergency_banner", {
campaign_class: @emergency_banner.campaign_class,
heading: @emergency_banner.heading,
link: @emergency_banner.link,
link_text: @emergency_banner.link_text,
short_description: @emergency_banner.short_description,
}
end
user_satisfaction_survey = '<div id="user-satisfaction-survey-container"></div>'
global_bar = render "components/global_bar"
%>

<%= render "govuk_publishing_components/components/layout_for_public", {
emergency_banner: emergency_banner,
full_width: full_width,
global_bar: user_satisfaction_survey + global_bar,
navigation_items: [
{
text: "Account",
href: Plek.new.find("account-manager"),
data: {
module: "explicit-cross-domain-links",
link_for: "accounts-signed-in",
},
},
{
text: "Sign out",
href: Plek.new.website_root + "/transition-check/logout",
data: {
module: "explicit-cross-domain-links",
link_for: "accounts-signed-in",
},
},
{
text: "Sign in",
href: Plek.new.website_root + "/transition-check/login",
data: {
module: "explicit-cross-domain-links",
link_for: "accounts-signed-out",
},
}],
title: content_for?(:title) ? yield(:title) : "GOV.UK - The best place to find government services and information",

} %>
3 changes: 3 additions & 0 deletions app/views/root/gem_layout.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<%= render partial: "gem_base", locals: {
full_width: false,
} %>
3 changes: 3 additions & 0 deletions app/views/root/gem_layout_full_width.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<%= render partial: 'gem_base', locals: {
full_width: true,
} %>

0 comments on commit 1d94589

Please sign in to comment.