diff --git a/.review_apps/ecs_task_definition.tf b/.review_apps/ecs_task_definition.tf index 7eb32774c..d035c329b 100644 --- a/.review_apps/ecs_task_definition.tf +++ b/.review_apps/ecs_task_definition.tf @@ -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 diff --git a/Gemfile b/Gemfile index 6241b66a1..0ec38b3e8 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index eae1d8982..16ad80249 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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: @@ -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 diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index cda343833..ad25687c4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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 @@ -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 diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6c9167fbf..83241c2ff 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -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 %> + <% 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) %> diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index 8b01fcfd8..684c8f823 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -1,5 +1,5 @@ - + <%= page_title %> @@ -8,14 +8,24 @@ <%= csrf_meta_tags %> <%= csp_meta_tag %> - "> - " type="image/svg+xml"> - " color="#0b0c0c"> - "> - <%# 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`. %> - - "> + <% if @rebrand %> + + "> + " type="image/svg+xml"> + " color="#1d70b8"> + "> + <%# 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`. %> + + "> + <% else %> + "> + " type="image/svg+xml"> + " color="#0b0c0c"> + "> + + "> + <% end %> <%= vite_stylesheet_tag 'application.scss' %> diff --git a/public/rebrand/images/favicon.ico b/public/rebrand/images/favicon.ico new file mode 100644 index 000000000..450f29809 Binary files /dev/null and b/public/rebrand/images/favicon.ico differ diff --git a/public/rebrand/images/favicon.svg b/public/rebrand/images/favicon.svg new file mode 100644 index 000000000..d74844736 --- /dev/null +++ b/public/rebrand/images/favicon.svg @@ -0,0 +1 @@ + diff --git a/public/rebrand/images/govuk-crest.svg b/public/rebrand/images/govuk-crest.svg new file mode 100644 index 000000000..71f7dff2f --- /dev/null +++ b/public/rebrand/images/govuk-crest.svg @@ -0,0 +1 @@ + diff --git a/public/rebrand/images/govuk-icon-180.png b/public/rebrand/images/govuk-icon-180.png new file mode 100644 index 000000000..62c4eb079 Binary files /dev/null and b/public/rebrand/images/govuk-icon-180.png differ diff --git a/public/rebrand/images/govuk-icon-192.png b/public/rebrand/images/govuk-icon-192.png new file mode 100644 index 000000000..d4ef53984 Binary files /dev/null and b/public/rebrand/images/govuk-icon-192.png differ diff --git a/public/rebrand/images/govuk-icon-512.png b/public/rebrand/images/govuk-icon-512.png new file mode 100644 index 000000000..a984294ef Binary files /dev/null and b/public/rebrand/images/govuk-icon-512.png differ diff --git a/public/rebrand/images/govuk-icon-mask.svg b/public/rebrand/images/govuk-icon-mask.svg new file mode 100644 index 000000000..e10ff6cc3 --- /dev/null +++ b/public/rebrand/images/govuk-icon-mask.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/rebrand/images/govuk-opengraph-image.png b/public/rebrand/images/govuk-opengraph-image.png new file mode 100644 index 000000000..659d3fc80 Binary files /dev/null and b/public/rebrand/images/govuk-opengraph-image.png differ diff --git a/public/rebrand/manifest.json b/public/rebrand/manifest.json new file mode 100644 index 000000000..0d183a2a5 --- /dev/null +++ b/public/rebrand/manifest.json @@ -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" + } + ] +}