Skip to content

Commit 39d57fa

Browse files
committed
Environment banner
1 parent bd0e097 commit 39d57fa

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

manage_breast_screening/assets/sass/main.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,24 @@ a[href="#"] {
4646
color: #c80000 !important;
4747
}
4848

49+
// Environment banner at the top of the page
50+
.app-environment {
51+
@include nhsuk-font-size(14);
52+
@include nhsuk-responsive-padding(2, bottom);
53+
@include nhsuk-responsive-padding(2, top);
54+
55+
.nhsuk-link {
56+
color: inherit;
57+
}
58+
59+
.nhsuk-width-container {
60+
align-items: baseline;
61+
display: flex;
62+
flex-wrap: wrap;
63+
gap: nhsuk-spacing(1) nhsuk-spacing(2);
64+
}
65+
}
66+
4967
// Status tag positioning within headers
5068
.app-header {
5169
position: relative;

manage_breast_screening/config/jinja2_env.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
import inflect
24
from django.conf import settings
35
from django.templatetags.static import static
@@ -41,6 +43,7 @@ def environment(**options):
4143
"static": static,
4244
"url": reverse,
4345
"inflector": inflector,
46+
"ENV_CONFIG": os.environ.get("ENV_CONFIG", "unknown"),
4447
}
4548
)
4649

manage_breast_screening/core/jinja2/layout-app.jinja

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@
1414
{% block pageTitle %}{% if form and form.errors %}Error: {% endif %}{% if page_title %}{{ page_title }} – {% endif %}Manage breast screening – NHS{% endblock %}
1515

1616
{% block header %}
17+
{% if ENV_CONFIG != 'prod' %}
18+
<div class="app-environment nhsuk-tag--grey">
19+
<div class="nhsuk-width-container">
20+
<strong class="nhsuk-tag nhsuk-tag--grey">
21+
{{ ENV_CONFIG }}
22+
</strong>
23+
This is the {{ ENV_CONFIG }} environment.
24+
</div>
25+
</div>
26+
{% endif %}
27+
1728
{{ header({
1829
"service": {
1930
"text": "Manage breast screening"

0 commit comments

Comments
 (0)