Skip to content

Commit

Permalink
Merge pull request #1909 from alphagov/ldeb-add-archive-banner
Browse files Browse the repository at this point in the history
Add archive banner
  • Loading branch information
lfdebrux committed Oct 4, 2021
2 parents efd50f8 + be4009d commit e895d03
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions views/partials/_banner.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
{% endif %}

<div class="app-phase-banner__wrapper">
{% if PULL_REQUEST %}
{% if PULL_REQUEST === "true" %}
{% set phaseBannerText %}
This is a preview of
{% if REVIEW_ID %}
a <a class="govuk-link" href="https://github.com/alphagov/govuk-design-system/pull/{{ REVIEW_ID }}">proposed change</a> to the
{% else %}
the <a class="govuk-link" href="https://github.com/alphagov/govuk-design-system/tree/{{ BRANCH }}">{{ BRANCH }}</a> branch for the
{% endif %}
a <a class="govuk-link" href="https://github.com/alphagov/govuk-design-system/pull/{{ REVIEW_ID }}">proposed change</a> to the
<a class="govuk-link" href="https://design-system.service.gov.uk">Design System</a>.
{% endset %}

Expand All @@ -24,13 +20,28 @@
"classes": phaseBannerClasses,
"html": phaseBannerText
}) }}
{% else %}
{{ govukPhaseBanner({
"tag": {
"text": "beta"
},
"classes": phaseBannerClasses,
"html": "This is a new service – your <a class=\"govuk-link\" href=\"/get-in-touch\">feedback</a> will help us to improve it."
}) }}
{% endif %}
{% elif PULL_REQUEST === "false" %}
{% set phaseBannerText %}
This is an archived version of
the <a class="govuk-link" href="https://github.com/alphagov/govuk-design-system/tree/{{ BRANCH }}">{{ BRANCH }}</a> branch for the
<a class="govuk-link" href="https://design-system.service.gov.uk">Design System</a>.
{% endset %}

{{ govukPhaseBanner({
"tag": {
"text": "archive",
"classes": "app-tag--review"
},
"classes": phaseBannerClasses,
"html": phaseBannerText
}) }}
{% else %} {# in production the envvar PULL_REQUEST is not set #}
{{ govukPhaseBanner({
"tag": {
"text": "beta"
},
"classes": phaseBannerClasses,
"html": "This is a new service – your <a class=\"govuk-link\" href=\"/get-in-touch\">feedback</a> will help us to improve it."
}) }}
{% endif %}
</div>

0 comments on commit e895d03

Please sign in to comment.