diff --git a/app/assets/stylesheets/application.sass.scss b/app/assets/stylesheets/application.sass.scss
index bf74278001..312cf6e614 100644
--- a/app/assets/stylesheets/application.sass.scss
+++ b/app/assets/stylesheets/application.sass.scss
@@ -3,3 +3,5 @@ $govuk-new-link-styles: true;
$govuk-assets-path: "";
@import "govuk-frontend/dist/govuk/all";
+
+@import "components/all";
diff --git a/app/assets/stylesheets/components/_all.scss b/app/assets/stylesheets/components/_all.scss
new file mode 100644
index 0000000000..7f20259f3a
--- /dev/null
+++ b/app/assets/stylesheets/components/_all.scss
@@ -0,0 +1 @@
+@import "page_banner";
diff --git a/app/assets/stylesheets/components/_page_banner.scss b/app/assets/stylesheets/components/_page_banner.scss
new file mode 100644
index 0000000000..1a5fff6688
--- /dev/null
+++ b/app/assets/stylesheets/components/_page_banner.scss
@@ -0,0 +1,22 @@
+.app-phase-banner .govuk-tag {
+ color: govuk-colour("white");
+ text-transform: uppercase;
+ letter-spacing: 1px;
+ font-weight: $govuk-font-weight-bold;
+}
+
+.app-phase-banner__env--development .govuk-tag {
+ background: govuk-colour("dark-grey");
+}
+
+.app-phase-banner__env--qa .govuk-tag {
+ background-color: govuk-colour("orange");
+}
+
+.app-phase-banner__env--staging .govuk-tag {
+ background-color: govuk-colour("red");
+}
+
+.app-phase-banner__env--beta .govuk-tag {
+ background: govuk-colour("blue");
+}
diff --git a/app/models/hosting_environment.rb b/app/models/hosting_environment.rb
new file mode 100644
index 0000000000..f094884348
--- /dev/null
+++ b/app/models/hosting_environment.rb
@@ -0,0 +1,13 @@
+module HostingEnvironment
+ def self.name(current_service)
+ if Rails.env.production?
+ I18n.t(".models.hosting_environment.#{current_service}.name")
+ else
+ Rails.env
+ end
+ end
+
+ def self.banner_description(current_service)
+ I18n.t(".models.hosting_environment.#{current_service}.banner.description")
+ end
+end
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 675782b9b7..7b9287fcf6 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -27,6 +27,14 @@
<%= govuk_header(homepage_url: "https://www.gov.uk", service_name: t(".#{current_service}.header.service_name"), service_url: "/") %>
+
+
+ <%= govuk_phase_banner(tag: { text: HostingEnvironment.name(current_service) }) do %>
+ <%= govuk_link_to HostingEnvironment.banner_description(current_service), request.env["PATH_INFO"], class: "govuk-link--no-visited-state" %>
+ <% end %>
+
+
+
<%= yield %>
diff --git a/config/locales/claims/en/models/hosting_environment.yml b/config/locales/claims/en/models/hosting_environment.yml
new file mode 100644
index 0000000000..4aaa02ae6d
--- /dev/null
+++ b/config/locales/claims/en/models/hosting_environment.yml
@@ -0,0 +1,7 @@
+en:
+ models:
+ hosting_environment:
+ claims:
+ name: beta
+ banner:
+ description: Make a complaint or give feedback
diff --git a/config/locales/placements/en/models/hosting_environment.yml b/config/locales/placements/en/models/hosting_environment.yml
new file mode 100644
index 0000000000..0ff5383669
--- /dev/null
+++ b/config/locales/placements/en/models/hosting_environment.yml
@@ -0,0 +1,7 @@
+en:
+ models:
+ hosting_environment:
+ placements:
+ name: beta
+ banner:
+ description: Make a complaint or give feedback
diff --git a/spec/models/hosting_environment_spec.rb b/spec/models/hosting_environment_spec.rb
new file mode 100644
index 0000000000..bd8c8490a9
--- /dev/null
+++ b/spec/models/hosting_environment_spec.rb
@@ -0,0 +1,40 @@
+require "rails_helper"
+
+RSpec.describe HostingEnvironment do
+ describe ".name" do
+ it "returns the name of the hosting environment" do
+ current_service = "claims"
+ expect(described_class.name(current_service)).to eq("test")
+ end
+
+ context "when environment is production" do
+ it "returns the name of the hosting environment for claims" do
+ allow(Rails.env).to receive(:production?).and_return(true)
+ current_service = "claims"
+ expect(described_class.name(current_service)).to eq("beta")
+ end
+
+ it "returns the name of the hosting environment for placements" do
+ allow(Rails.env).to receive(:production?).and_return(true)
+ current_service = "placements"
+ expect(described_class.name(current_service)).to eq("beta")
+ end
+ end
+ end
+
+ describe ".banner_description" do
+ it "returns the banner description of the hosting environment for claims" do
+ current_service = "claims"
+ expect(described_class.banner_description(current_service)).to eq(
+ "Make a complaint or give feedback"
+ )
+ end
+
+ it "returns the banner description of the hosting environment for placements" do
+ current_service = "placements"
+ expect(described_class.banner_description(current_service)).to eq(
+ "Make a complaint or give feedback"
+ )
+ end
+ end
+end