Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .review_apps/ecs_task_definition.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ locals {
{ name = "SETTINGS__FORMS_API__AUTH_KEY", value = "unsecured_api_key_for_review_apps_only" },
{ name = "SETTINGS__FORMS_API__BASE_URL", value = "http://localhost:9292" },
{ name = "SETTINGS__FORMS_ENV", value = "review" },
{ name = "SETTINGS__FEATURES__REBRAND", value = "true" },

##
# Settings for AWS SES email sending, and S3 CSV submission and file upload
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ gem "activeresource"
gem "pg", "~> 1.5"

# For GOV.UK branding
gem "govuk-components"
gem "govuk-components", github: "x-govuk/govuk-components", ref: "f0bfa9bd6b15a5e3f719987c7329e2b6a9f5d30d"
gem "govuk_design_system_formbuilder"

# Our own custom markdown renderer
Expand Down
12 changes: 11 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ GIT
govuk-forms-markdown (0.5.0)
redcarpet (~> 3.6)

GIT
remote: https://github.com/x-govuk/govuk-components.git
revision: f0bfa9bd6b15a5e3f719987c7329e2b6a9f5d30d
ref: f0bfa9bd6b15a5e3f719987c7329e2b6a9f5d30d
specs:
govuk-components (5.10.0b1)
html-attributes-utils (~> 1.0.0, >= 1.0.0)
pagy (>= 6, < 10)
view_component (>= 3.18, < 3.22)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -531,7 +541,7 @@ DEPENDENCIES
dfe-autocomplete!
factory_bot_rails
faker
govuk-components
govuk-components!
govuk-forms-markdown!
govuk_design_system_formbuilder
govuk_notify_rails
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

class ApplicationController < ActionController::Base
before_action :rebrand
before_action :set_request_id
before_action :set_request_logging_attributes
before_action :check_maintenance_mode_is_enabled
Expand Down Expand Up @@ -66,6 +67,10 @@ def log_rescued_exception(exception)

private

def rebrand
@rebrand = Settings.features.rebrand
end

def add_robots_header
response.headers["X-Robots-Tag"] = "noindex, nofollow"
end
Expand Down
3 changes: 3 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

<% content_for :footer do %>

<%# TODO: add crown SVG to footer %>
<%# To do that, we'll either need an update to govuk-components to apply the crown automatically, or we can replace the component with HTML and add the crown ourselves %>
Comment on lines +16 to +17

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added here and is available in 5.10.0b2.


<% meta_links = {t("footer.accessibility_statement") => accessibility_statement_path, t("footer.cookies") => cookies_path} %>
<% if @current_context.present? %>
<% meta_links[t("footer.privacy_policy")] = form_privacy_path(@current_context.form.id) %>
Expand Down
28 changes: 19 additions & 9 deletions app/views/layouts/base.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en" class="govuk-template ">
<html lang="en" class="govuk-template <% if @rebrand %> govuk-template--rebranded<% end %>">
<head>
<meta charset="utf-8">
<title><%= page_title %></title>
Expand All @@ -8,14 +8,24 @@
<%= csrf_meta_tags %>
<%= csp_meta_tag %>

<link rel="icon" sizes="48x48" href="<%= vite_asset_path "#{govuk_assets_path}/images/favicon.ico" %>">
<link rel="icon" sizes="any" href="<%= vite_asset_path "#{govuk_assets_path}/images/favicon.svg" %>" type="image/svg+xml">
<link rel="mask-icon" href="<%= vite_asset_path "#{govuk_assets_path}/images/govuk-icon-mask.svg" %>" color="#0b0c0c">
<link rel="apple-touch-icon" href="<%= vite_asset_path "#{govuk_assets_path}/images/govuk-icon-180.png"%>">
<%# This manifest file and the icons it references are currently being served from the `public` folder. %>
<%# TODO: update the build to either generate the manifest with references to fingerprinted assets, or automatically copy the manifest and its dependencies to `public`. %>
<link rel="manifest" href="/icons/manifest.json">
<meta property="og:image" content="<%= vite_asset_path "#{govuk_assets_path}/images/govuk-opengraph-image.png" %>">
<% if @rebrand %>
<meta name="theme-color" content="#1d70b8">
<link rel="icon" sizes="48x48" href="<%= vite_asset_path "#{govuk_assets_path}/rebrand/images/favicon.ico" %>">
<link rel="icon" sizes="any" href="<%= vite_asset_path "#{govuk_assets_path}/rebrand/images/favicon.svg" %>" type="image/svg+xml">
<link rel="mask-icon" href="<%= vite_asset_path "#{govuk_assets_path}/rebrand/images/govuk-icon-mask.svg" %>" color="#1d70b8">
<link rel="apple-touch-icon" href="<%= vite_asset_path "#{govuk_assets_path}/rebrand/images/govuk-icon-180.png"%>">
<%# This manifest file and the icons it references are currently being served from the `public` folder. %>
<%# TODO: update the build to either generate the manifest with references to fingerprinted assets, or automatically copy the manifest and its dependencies to `public`. %>
<link rel="manifest" href="/rebrand/manifest.json">
<meta property="og:image" content="<%= vite_asset_path "#{govuk_assets_path}/rebrand/images/govuk-opengraph-image.png" %>">
<% else %>
<link rel="icon" sizes="48x48" href="<%= vite_asset_path "#{govuk_assets_path}/images/favicon.ico" %>">
<link rel="icon" sizes="any" href="<%= vite_asset_path "#{govuk_assets_path}/images/favicon.svg" %>" type="image/svg+xml">
<link rel="mask-icon" href="<%= vite_asset_path "#{govuk_assets_path}/images/govuk-icon-mask.svg" %>" color="#0b0c0c">
<link rel="apple-touch-icon" href="<%= vite_asset_path "#{govuk_assets_path}/images/govuk-icon-180.png"%>">
<link rel="manifest" href="/icons/manifest.json">
<meta property="og:image" content="<%= vite_asset_path "#{govuk_assets_path}/images/govuk-opengraph-image.png" %>">
<% end %>

<%= vite_stylesheet_tag 'application.scss' %>

Expand Down
Binary file added public/rebrand/images/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions public/rebrand/images/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/rebrand/images/govuk-crest.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/rebrand/images/govuk-icon-180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/rebrand/images/govuk-icon-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/rebrand/images/govuk-icon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/rebrand/images/govuk-icon-mask.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/rebrand/images/govuk-opengraph-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions public/rebrand/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"icons": [
{
"src": "images/favicon.ico",
"type": "image/x-icon",
"sizes": "48x48"
},
{
"src": "images/favicon.svg",
"type": "image/svg+xml",
"sizes": "150x150",
"purpose": "any"
},
{
"src": "images/govuk-icon-180.png",
"type": "image/png",
"sizes": "180x180",
"purpose": "maskable"
},
{
"src": "images/govuk-icon-192.png",
"type": "image/png",
"sizes": "192x192",
"purpose": "maskable"
},
{
"src": "images/govuk-icon-512.png",
"type": "image/png",
"sizes": "512x512",
"purpose": "maskable"
},
{
"src": "images/govuk-icon-mask.svg",
"type": "image/svg+xml",
"sizes": "150x150",
"purpose": "monochrome"
}
]
}