Skip to content

Commit 033e32c

Browse files
committed
Environment banner
Uses DJANGO_ENV to determine environment name
1 parent 7693ff8 commit 033e32c

3 files changed

Lines changed: 30 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
@@ -50,6 +50,24 @@ a[href="#"] {
5050
color: #c80000 !important;
5151
}
5252

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

manage_breast_screening/config/jinja2_env.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def environment(**options):
4141
"static": static,
4242
"url": reverse,
4343
"inflector": inflector,
44+
"DJANGO_ENV": settings.DJANGO_ENV,
4445
}
4546
)
4647

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 DJANGO_ENV != 'prod' %}
18+
<div class="app-environment nhsuk-tag--grey">
19+
<div class="nhsuk-width-container">
20+
<strong class="nhsuk-tag nhsuk-tag--grey">
21+
{{ DJANGO_ENV }}
22+
</strong>
23+
This is the {{ DJANGO_ENV }} environment.
24+
</div>
25+
</div>
26+
{% endif %}
27+
1728
{{ header({
1829
"classes": "nhsuk-header--inline",
1930
"service": {

0 commit comments

Comments
 (0)