Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
KludgeKML committed Feb 4, 2025
1 parent 4be18fc commit 279f222
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 31 deletions.
8 changes: 0 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -697,13 +697,6 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
slimmer (18.7.0)
json
nokogiri (~> 1.7)
null_logger
plek (>= 1.1.0)
rack (>= 3.0)
rest-client
smart_properties (1.17.0)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -789,7 +782,6 @@ DEPENDENCIES
rspec-rails
rubocop-govuk
simplecov
slimmer
sprockets-rails
terser
timecop
Expand Down
1 change: 0 additions & 1 deletion app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
$govuk-include-default-font-face: false;

@import "govuk_publishing_components/govuk_frontend_support";
@import "govuk_publishing_components/all_components";

// Helper stylesheets (things on more than one page layout)
@import "helpers/truncated-url";
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/homepage_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
class HomepageController < ContentItemsController
include Cacheable

layout "homepage"

def index; end

Check failure on line 6 in app/controllers/homepage_controller.rb

View workflow job for this annotation

GitHub Actions / Lint Ruby / Run RuboCop

Layout/ExtraSpacing: Unnecessary spacing detected.
end
39 changes: 20 additions & 19 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
<% content_for :body do %>
<% if @is_account && local_assigns %>
<main id="content">
<% if content_item&.phase == "beta" %>
<%= render "govuk_publishing_components/components/phase_banner", phase: "beta" %>
<% end %>
<% unless !(content_item || @calendar) || remove_breadcrumbs(content_item) %>
<%= render "govuk_publishing_components/components/contextual_breadcrumbs", content_item: content_item.to_h %>
<% end %>
<%= render "govuk_web_banners/recruitment_banner" %>
<% if local_assigns %>
<%= yield :before_content %>
<main role="main" id="content" class="govuk-main-wrapper <%= yield :main_classes %>" <%= lang_attribute %>>
<%= yield %>
</main>
<% else %>
<% if content_item&.phase == "beta" %>
<%= render "govuk_publishing_components/components/phase_banner", phase: "beta" %>
<% end %>
<% unless current_page?(root_path) || !(content_item || @calendar) || remove_breadcrumbs(content_item) %>
<%= render "govuk_publishing_components/components/contextual_breadcrumbs", content_item: content_item.to_h %>
<% end %>
<%= render "govuk_web_banners/recruitment_banner" %>
<% if local_assigns %>
<%= yield :before_content %>
<main role="main" id="content" class="govuk-main-wrapper <%= yield :main_classes %>" <%= lang_attribute %>>
<%= yield %>
</main>
<%= yield :after_content %>
<% end %>
<%= yield :after_content %>
<% end %>
<% end %>

Expand All @@ -32,13 +26,20 @@
end
%>

<%= content_for :head do %>
<link title="Search" rel="search" type="application/opensearchdescription+xml" href="/search/opensearch.xml">
<%= render_component_stylesheets %>
<% end %>

<%= render "govuk_publishing_components/components/layout_for_public", {
title:,
show_explore_header: true,
emergency_banner: render("govuk_web_banners/emergency_banner"),
# emergency_banner: render("govuk_web_banners/emergency_banner"),
global_banner: render("govuk_web_banners/global_banner"),
} do %>
<%= yield :body %>
<div class="govuk-width-container">
<%= yield :body %>
</div>
<%= javascript_include_tag 'application', type: "module" %>
<% end %>

41 changes: 41 additions & 0 deletions app/views/layouts/homepage.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<% content_for :body do %>
<%= yield :before_content %>
<main role="main" id="content" class="govuk-main-wrapper <%= yield :main_classes %>" <%= lang_attribute %>>
<%= yield %>
</main>
<%= yield :after_content %>
<% end %>

<%
title = yield(:title)
title = if title.present?
title
elsif content_item
page_title(content_item)
else
"GOV.UK"
end
%>

<%= content_for :head do %>
<link title="Search" rel="search" type="application/opensearchdescription+xml" href="/search/opensearch.xml">
<% add_gem_component_stylesheet("layout-for-public") %>
<% add_gem_component_stylesheet("layout-super-navigation-header") %>
<% add_gem_component_stylesheet("layout-header") %>
<% add_gem_component_stylesheet("layout-footer") %>
<%= render_component_stylesheets %>
<% end %>

<%= render "govuk_publishing_components/components/layout_for_public", {
title:,
full_width: true,
homepage: true,
show_explore_header: true,
# emergency_banner: render("govuk_web_banners/emergency_banner"),
global_banner: render("govuk_web_banners/global_banner"),
logo_link: Plek.new.website_root.present? ? Plek.new.website_root : "https://www.gov.uk/",
} do %>
<%= yield :body %>
<%= javascript_include_tag 'application', type: "module" %>
<% end %>

3 changes: 0 additions & 3 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ class Application < Rails::Application
# Enable the asset pipeline
config.assets.enabled = true

# Path within public/ where assets are compiled to
config.assets.prefix = "/assets/frontend"

# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += %i[password postcode]

Expand Down

0 comments on commit 279f222

Please sign in to comment.