diff --git a/app/views/bill-licences/remove.njk b/app/views/bill-licences/remove.njk index fed0e95127..bb4be3016c 100644 --- a/app/views/bill-licences/remove.njk +++ b/app/views/bill-licences/remove.njk @@ -5,7 +5,7 @@ {% from "govuk/components/inset-text/macro.njk" import govukInsetText %} {% from "govuk/components/summary-list/macro.njk" import govukSummaryList %} -{% from "macros/badge.njk" import statusBadge %} +{% from "macros/bill-run-status-tag.njk" import statusTag %} {% block breadcrumbs %} {# Back link #} @@ -32,9 +32,9 @@
- {{ statusBadge(billRunStatus) }} + {{ statusTag(billRunStatus) }}
{# Bill run meta-data #} diff --git a/app/views/bill-runs/cancel.njk b/app/views/bill-runs/cancel.njk index ffd3dc41f9..65bbb0e282 100644 --- a/app/views/bill-runs/cancel.njk +++ b/app/views/bill-runs/cancel.njk @@ -3,7 +3,7 @@ {% from "govuk/components/button/macro.njk" import govukButton %} {% from "govuk/components/summary-list/macro.njk" import govukSummaryList %} -{% from "macros/badge.njk" import statusBadge %} +{% from "macros/bill-run-status-tag.njk" import statusTag %} {% block breadcrumbs %} {# Back link #} @@ -26,9 +26,9 @@- {{ statusBadge(billRunStatus) }} + {{ statusTag(billRunStatus) }}
{# Bill run meta-data #} diff --git a/app/views/bill-runs/empty.njk b/app/views/bill-runs/empty.njk index 7d6f038b4f..75ab34cf99 100644 --- a/app/views/bill-runs/empty.njk +++ b/app/views/bill-runs/empty.njk @@ -4,7 +4,7 @@ {% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %} {% from "govuk/components/summary-list/macro.njk" import govukSummaryList %} -{% from "macros/badge.njk" import statusBadge %} +{% from "macros/bill-run-status-tag.njk" import statusTag %} {% block breadcrumbs %} {# Back link #} @@ -38,9 +38,9 @@- {{ statusBadge(billRunStatus) }} + {{ statusTag(billRunStatus) }}
{# Bill run meta-data #} diff --git a/app/views/bill-runs/errored.njk b/app/views/bill-runs/errored.njk index 78fa155403..bed31cdee1 100644 --- a/app/views/bill-runs/errored.njk +++ b/app/views/bill-runs/errored.njk @@ -4,7 +4,7 @@ {% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %} {% from "govuk/components/summary-list/macro.njk" import govukSummaryList %} -{% from "macros/badge.njk" import statusBadge %} +{% from "macros/bill-run-status-tag.njk" import statusTag %} {% block breadcrumbs %} {# Back link #} @@ -38,9 +38,9 @@- {{ statusBadge(billRunStatus) }} + {{ statusTag(billRunStatus) }}
{# Bill run meta-data #} diff --git a/app/views/bill-runs/review-licence.njk b/app/views/bill-runs/review-licence.njk index ed413f12e8..348f545630 100644 --- a/app/views/bill-runs/review-licence.njk +++ b/app/views/bill-runs/review-licence.njk @@ -1,11 +1,9 @@ {% extends 'layout.njk' %} {% from "govuk/components/back-link/macro.njk" import govukBackLink %} -{% from "govuk/components/tag/macro.njk" import govukTag %} {% from "govuk/components/table/macro.njk" import govukTable %} {% from "govuk/components/summary-list/macro.njk" import govukSummaryList %} {% from "govuk/components/details/macro.njk" import govukDetails %} -{% from "macros/badge.njk" import badge %} - +{% from "macros/review-status-tag.njk" import statusTag %} {% block breadcrumbs %} {# Back link #} @@ -24,18 +22,8 @@- {{govukTag({ - text: licence.status, - classes: colour - })}} + {{ statusTag(licence.status) }}
- {{ govukTag({ - text: status, - classes: colour - }) }} + {{ billRunStatusTag(status) }}
{# Bill run meta-data #} @@ -263,17 +255,8 @@ {% set tableRows = [] %} {% if preparedLicences.length > 0 %} {% for licence in preparedLicences %} - {% if licence.status == 'review' %} - {% set colour = "govuk-tag--blue" %} - {% else %} - {% set colour = "govuk-tag--green" %} - {% endif %} - {% set statusTag %} - {{govukTag({ - text: licence.status, - classes: colour - })}} + {{ reviewStatusTag(licence.status) }} {% endset %} {% set action %} diff --git a/app/views/bill-runs/send.njk b/app/views/bill-runs/send.njk index 20f4f67682..385068d19e 100644 --- a/app/views/bill-runs/send.njk +++ b/app/views/bill-runs/send.njk @@ -3,7 +3,7 @@ {% from "govuk/components/button/macro.njk" import govukButton %} {% from "govuk/components/summary-list/macro.njk" import govukSummaryList %} -{% from "macros/badge.njk" import statusBadge %} +{% from "macros/bill-run-status-tag.njk" import statusTag %} {% block breadcrumbs %} {# Back link #} @@ -26,9 +26,9 @@- {{ statusBadge(billRunStatus) }} + {{ statusTag(billRunStatus) }}
{# Bill run meta-data #} diff --git a/app/views/bill-runs/setup/create.njk b/app/views/bill-runs/setup/create.njk index 334ee7bf1c..fbb5333ef4 100644 --- a/app/views/bill-runs/setup/create.njk +++ b/app/views/bill-runs/setup/create.njk @@ -4,7 +4,7 @@ {% from "govuk/components/summary-list/macro.njk" import govukSummaryList %} {% from "govuk/components/warning-text/macro.njk" import govukWarningText %} -{% from "macros/badge.njk" import statusBadge %} +{% from "macros/bill-run-status-tag.njk" import statusTag %} {% block breadcrumbs %} {# Back link #} @@ -32,9 +32,9 @@ iconFallbackText: 'Warning' }) }} - {# Status badge #} + {# Status tag #}- {{ statusBadge(billRunStatus) }} + {{ statusTag(billRunStatus) }}
{# Bill run meta-data #} diff --git a/app/views/bill-runs/view.njk b/app/views/bill-runs/view.njk index f1d5a1f12d..326c78d304 100644 --- a/app/views/bill-runs/view.njk +++ b/app/views/bill-runs/view.njk @@ -5,7 +5,7 @@ {% from "govuk/components/summary-list/macro.njk" import govukSummaryList %} {% from "govuk/components/table/macro.njk" import govukTable %} -{% from "macros/badge.njk" import statusBadge %} +{% from "macros/bill-run-status-tag.njk" import statusTag %} {% block breadcrumbs %} {# Back link #} @@ -28,9 +28,9 @@- {{ statusBadge(billRunStatus) }} + {{ statusTag(billRunStatus) }}
{# Bill run meta-data #} diff --git a/app/views/bills/remove.njk b/app/views/bills/remove.njk index ee4e853200..c620d53201 100644 --- a/app/views/bills/remove.njk +++ b/app/views/bills/remove.njk @@ -5,7 +5,7 @@ {% from "govuk/components/inset-text/macro.njk" import govukInsetText %} {% from "govuk/components/summary-list/macro.njk" import govukSummaryList %} -{% from "macros/badge.njk" import statusBadge %} +{% from "macros/bill-run-status-tag.njk" import statusTag %} {% block breadcrumbs %} {# Back link #} @@ -32,9 +32,9 @@- {{ statusBadge(billRunStatus) }} + {{ statusTag(billRunStatus) }}
{# Bill run meta-data #} diff --git a/app/views/bills/view-multi-licence.njk b/app/views/bills/view-multi-licence.njk index b932591f32..0ceab86e8e 100644 --- a/app/views/bills/view-multi-licence.njk +++ b/app/views/bills/view-multi-licence.njk @@ -6,7 +6,7 @@ {% from "govuk/components/table/macro.njk" import govukTable %} {% from "govuk/components/warning-text/macro.njk" import govukWarningText %} -{% from "macros/badge.njk" import statusBadge %} +{% from "macros/bill-run-status-tag.njk" import statusTag %} {% block breadcrumbs %} {# Back link #} @@ -29,9 +29,9 @@- {{ statusBadge(billRunStatus) }} + {{ statusTag(billRunStatus) }}
{# Bill meta-data #} diff --git a/app/views/bills/view-single-licence-presroc.njk b/app/views/bills/view-single-licence-presroc.njk index b7ad20b619..394914f2e0 100644 --- a/app/views/bills/view-single-licence-presroc.njk +++ b/app/views/bills/view-single-licence-presroc.njk @@ -6,7 +6,7 @@ {% from "govuk/components/table/macro.njk" import govukTable %} {% from "govuk/components/warning-text/macro.njk" import govukWarningText %} -{% from "macros/badge.njk" import statusBadge %} +{% from "macros/bill-run-status-tag.njk" import statusTag %} {% block breadcrumbs %} {# Back link #} @@ -29,9 +29,9 @@- {{ statusBadge(billRunStatus) }} + {{ statusTag(billRunStatus) }}
{# Bill meta-data #} diff --git a/app/views/bills/view-single-licence-sroc.njk b/app/views/bills/view-single-licence-sroc.njk index 6d17946ff8..9f5bafaeec 100644 --- a/app/views/bills/view-single-licence-sroc.njk +++ b/app/views/bills/view-single-licence-sroc.njk @@ -6,7 +6,7 @@ {% from "govuk/components/table/macro.njk" import govukTable %} {% from "govuk/components/warning-text/macro.njk" import govukWarningText %} -{% from "macros/badge.njk" import statusBadge %} +{% from "macros/bill-run-status-tag.njk" import statusTag %} {% block breadcrumbs %} {# Back link #} @@ -29,9 +29,9 @@- {{ statusBadge(billRunStatus) }} + {{ statusTag(billRunStatus) }}
{# Bill meta-data #} diff --git a/app/views/macros/badge.njk b/app/views/macros/bill-run-status-tag.njk similarity index 54% rename from app/views/macros/badge.njk rename to app/views/macros/bill-run-status-tag.njk index e71df59b7c..1b5be516d3 100644 --- a/app/views/macros/badge.njk +++ b/app/views/macros/bill-run-status-tag.njk @@ -1,38 +1,24 @@ {% from "govuk/components/tag/macro.njk" import govukTag %} -{% macro badge(text, type) %} - {% if type === 'error' %} - {% set classes = "govuk-tag--red govuk-!-font-size-27" %} - {% elif type === 'inactive' %} - {% set classes = "govuk-tag--grey govuk-!-font-size-27" %} - {% elif type === 'info' %} +{% macro statusTag(status) %} + {% if status === 'ready' %} {% set classes = "govuk-tag--blue govuk-!-font-size-27" %} - {% elif type === 'warning' %} - {% set classes = "govuk-tag--orange govuk-!-font-size-27" %} - {% elif type === 'success' %} + {% elif status === 'review' %} + {% set classes = "govuk-tag--blue govuk-!-font-size-27" %} + {% elif status === 'sent' %} {% set classes = "govuk-tag--green govuk-!-font-size-27" %} + {% elif status === 'empty' %} + {% set classes = "govuk-tag--grey govuk-!-font-size-27" %} + {% elif status === 'error' %} + {% set classes = "govuk-tag--red govuk-!-font-size-27" %} {% else %} {% set classes = "govuk-tag--blue govuk-!-font-size-27" %} {% endif %} {{ govukTag({ - text: text, + text: status, classes: classes }) }} {% endmacro %} - -{% macro statusBadge(status) %} - {% if status === 'ready' %} - {% set badgeType = 'info' %} - {% elif status === 'sent' %} - {% set badgeType = 'success' %} - {% elif status === 'empty' %} - {% set badgeType = 'inactive' %} - {% elif status === 'error' %} - {% set badgeType = 'error' %} - {% endif %} - - {{ badge(status, badgeType) }} -{% endmacro %} diff --git a/app/views/macros/review-status-tag.njk b/app/views/macros/review-status-tag.njk new file mode 100644 index 0000000000..121efa745a --- /dev/null +++ b/app/views/macros/review-status-tag.njk @@ -0,0 +1,28 @@ +{% from "govuk/components/tag/macro.njk" import govukTag %} + +{% macro statusTag(status) %} + {% if status === 'ready' %} + {% set classes = "govuk-tag--green" %} + {% elif status === 'review' %} + {% set classes = "govuk-tag--blue" %} + {% elif status === 'completed' %} + {% set classes = "govuk-tag--green govuk-!-font-size-14" %} + {% elif status === 'overdue' %} + {% set classes = "govuk-tag--red govuk-!-font-size-14" %} + {% elif status === 'query' %} + {% set classes = "govuk-tag--red govuk-!-font-size-14" %} + {% elif status === 'received' %} + {% set classes = "govuk-tag--blue govuk-!-font-size-14" %} + {% elif status === 'void' %} + {% set classes = "govuk-tag--grey govuk-!-font-size-14" %} + {% else %} + {% set classes = "govuk-tag--blue govuk-!-font-size-14" %} + {% endif %} + + {{ + govukTag({ + text: status, + classes: classes + }) + }} +{% endmacro %}