Skip to content

Commit

Permalink
Wip
Browse files Browse the repository at this point in the history
  • Loading branch information
CatalinVoineag committed Dec 19, 2023
1 parent 7a23257 commit 63ad814
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/assets/stylesheets/application.sass.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ $govuk-new-link-styles: true;
$govuk-assets-path: "";

@import "govuk-frontend/dist/govuk/all";

@import "components/all";

//@import "govuk-frontend/src/govuk/all";

1 change: 1 addition & 0 deletions app/assets/stylesheets/components/_all.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "page_banner";
22 changes: 22 additions & 0 deletions app/assets/stylesheets/components/_page_banner.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.app-phase-banner .govuk-tag {
color: govuk-colour("white");
text-transform: uppercase;
letter-spacing: 1px;
font-weight: 700;
}

.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");
}
13 changes: 13 additions & 0 deletions app/models/hosting_environment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module HostingEnvironment
def self.name(current_service)
if Rails.env.production?
I18n.t(".models.hosting_environment.#{current_service}.beta.title")
else
Rails.env
end
end

def self.description(current_service)
I18n.t(".models.hosting_environment.#{current_service}.beta.description")
end
end
15 changes: 15 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@

<%= govuk_header(homepage_url: "https://www.gov.uk", service_name: t(".#{current_service}.header.service_name"), service_url: "/") %>

<div class="app-phase-banner app-phase-banner__env--<%= HostingEnvironment.name(current_service) %>">
<div class="govuk-width-container">
<div class="govuk-phase-banner">
<p class="govuk-phase-banner__content">
<strong class="govuk-tag govuk-phase-banner__content__tag">
<%= HostingEnvironment.name(current_service) %>
</strong>
<span class="govuk-phase-banner__text">
<%= govuk_link_to HostingEnvironment.description(current_service), request.env['PATH_INFO'], class: "govuk-link--no-visited-state" %>
</span>
</p>
</div>
</div>
</div>

<div class="govuk-width-container">
<main class="govuk-main-wrapper" id="main-content" role="main">
<%= yield %>
Expand Down
7 changes: 7 additions & 0 deletions config/locales/claims/en/models/hosting_environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
en:
models:
hosting_environment:
claims:
beta:
title: beta
description: Make a complaint or give feedback
6 changes: 6 additions & 0 deletions config/locales/claims/en/models/user.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
en:
activerecord:
models:
user:
claims:
what: what
7 changes: 7 additions & 0 deletions config/locales/placements/en/models/hosting_environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
en:
models:
hosting_environment:
placements:
beta:
title: beta
description: Make a complaint or give feedback

0 comments on commit 63ad814

Please sign in to comment.