|
1 | 1 | {% from "partials/summary-detail.html" import summaryDetail %}
|
2 | 2 | {% from "components/checkboxes/macro.njk" import govukCheckboxes %}
|
| 3 | +{% from "components/radios/macro.njk" import govukRadios %} |
| 4 | +{% from "components/error-summary/macro.njk" import govukErrorSummary %} |
3 | 5 | {% from "button/macro.njk" import govukButton %}
|
4 | 6 | {% extends 'layout.html' %}
|
5 | 7 |
|
|
30 | 32 | {% if not hasMultipleSections and not details[0].hideTitle %}
|
31 | 33 | <span class="govuk-caption-l">{{ details[0].title }}</span>
|
32 | 34 | {% endif %}
|
| 35 | + |
| 36 | + {% if markAsCompleteComponent and markAsCompleteError %} |
| 37 | + {{ govukErrorSummary({ |
| 38 | + titleText: "There is a problem", |
| 39 | + errorList: [{ text: markAsCompleteError, href: "#markAsComplete-error" }] |
| 40 | + }) }} |
| 41 | + {% endif %} |
| 42 | + |
33 | 43 | <h1 class="govuk-heading-l">
|
34 | 44 | {% if callback and callback.title %}
|
35 | 45 | {{ callback.title }}
|
@@ -98,40 +108,39 @@ <h2 class="govuk-heading-m" id="declaration">Declaration</h2>
|
98 | 108 | {% endif %}
|
99 | 109 |
|
100 | 110 | {% if markAsCompleteComponent %}
|
101 |
| - <div class="govuk-!-margin-top-9 govuk-form-group {{ 'govuk-form-group--error' if markAsCompleteError }}"> |
102 |
| - {% if markAsCompleteError %} |
103 |
| - <span id="nationality-error" class="govuk-error-message"> |
104 |
| - <span class="govuk-visually-hidden">Error:</span> {{ markAsCompleteError }}</span> |
105 |
| - {% endif %} |
106 |
| - <fieldset class="govuk-fieldset"> |
107 |
| - <legend class="govuk-fieldset__legend govuk-fieldset__legend--m"> |
108 |
| - <h1 class="govuk-fieldset__heading"> |
109 |
| - {{ i18nGetTranslation("markAsComplete") }} |
110 |
| - </h1> |
111 |
| - </legend> |
112 |
| - <div class="govuk-radios" data-module="govuk-radios"> |
113 |
| - <div class="govuk-radios__item"> |
114 |
| - <input class="govuk-radios__input" id="markAsComplete-yes" |
115 |
| - name="markAsComplete" type="radio" value="true" |
116 |
| - {% if markAsComplete %}checked{% endif %}> |
117 |
| - <label class="govuk-label govuk-radios__label" for="markAsComplete-yes"> |
118 |
| - {{ i18nGetTranslation("components.sectionCompletedField.yes") }} |
119 |
| - </label> |
120 |
| - <div class="govuk-hint govuk-radios__hint"> |
121 |
| - {{ i18nGetTranslation("components.sectionCompletedField.hint") }} |
122 |
| - </div> |
123 |
| - </div> |
124 |
| - <div class="govuk-radios__item"> |
125 |
| - <input class="govuk-radios__input" id="markAsComplete-no" |
126 |
| - name="markAsComplete" type="radio" value="false" |
127 |
| - {% if markAsComplete == false %}checked{% endif %}> |
128 |
| - <label class="govuk-label govuk-radios__label" for="markAsComplete-no"> |
129 |
| - {{ i18nGetTranslation("components.sectionCompletedField.no") }} |
130 |
| - </label> |
131 |
| - </div> |
132 |
| - </div> |
133 |
| - </fieldset> |
134 |
| - </div> |
| 111 | + {% if markAsCompleteError %} |
| 112 | + {% set errorMessageObj = { text: markAsCompleteError } %} |
| 113 | + {% else %} |
| 114 | + {% set errorMessageObj = null %} |
| 115 | + {% endif %} |
| 116 | + {{ govukRadios({ |
| 117 | + name: "markAsComplete", |
| 118 | + fieldset: { |
| 119 | + legend: { |
| 120 | + text: i18nGetTranslation("markAsComplete"), |
| 121 | + isPageHeading: false, |
| 122 | + classes: "govuk-fieldset__legend--m" |
| 123 | + } |
| 124 | + }, |
| 125 | + items: [ |
| 126 | + { |
| 127 | + value: true, |
| 128 | + text: i18nGetTranslation("components.sectionCompletedField.yes"), |
| 129 | + id: "markAsComplete-yes", |
| 130 | + checked: (markAsComplete === true), |
| 131 | + hint: { |
| 132 | + text: i18nGetTranslation("components.sectionCompletedField.hint") |
| 133 | + } |
| 134 | + }, |
| 135 | + { |
| 136 | + value: false, |
| 137 | + checked: (markAsComplete === false), |
| 138 | + id: "markAsComplete-no", |
| 139 | + text: i18nGetTranslation("components.sectionCompletedField.no") |
| 140 | + } |
| 141 | + ], |
| 142 | + errorMessage: errorMessageObj |
| 143 | + }) }} |
135 | 144 | {% endif %}
|
136 | 145 |
|
137 | 146 | {% if fees and fees.details|length %}
|
|
0 commit comments