|
| 1 | +{% extends 'layout.njk' %} |
| 2 | +{% from "govuk/components/back-link/macro.njk" import govukBackLink %} |
| 3 | +{% from "govuk/components/button/macro.njk" import govukButton %} |
| 4 | +{% from "govuk/components/error-message/macro.njk" import govukErrorMessage %} |
| 5 | +{% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %} |
| 6 | +{% from "govuk/components/radios/macro.njk" import govukRadios %} |
| 7 | +{% from 'govuk/components/date-input/macro.njk' import govukDateInput %} |
| 8 | + |
| 9 | +{% block breadcrumbs %} |
| 10 | + {# Back link #} |
| 11 | + {{ |
| 12 | + govukBackLink({ |
| 13 | + text: 'Back', |
| 14 | + href: backLink |
| 15 | + }) |
| 16 | + }} |
| 17 | +{% endblock %} |
| 18 | + |
| 19 | +{% block content %} |
| 20 | + {# Error summary #} |
| 21 | + {% if error %} |
| 22 | + {{ govukErrorSummary({ |
| 23 | + titleText: "There is a problem", |
| 24 | + errorList: error.errorList |
| 25 | + }) }} |
| 26 | + {%endif%} |
| 27 | + |
| 28 | + {# Main heading #} |
| 29 | + <div> |
| 30 | + <span class="govuk-caption-l"> Return reference {{ returnReference }} </span> |
| 31 | + <h1 class="govuk-heading-xl">{{ pageTitle }}</h1> |
| 32 | + </div> |
| 33 | + <div> |
| 34 | + <form method="post"> |
| 35 | + <input type="hidden" name="wrlsCrumb" value="{{wrlsCrumb}}"/> |
| 36 | + |
| 37 | + {% set dateInputHTML %} |
| 38 | + {# From #} |
| 39 | + {{ govukDateInput({ |
| 40 | + id: 'period-used-from', |
| 41 | + namePrefix: 'period-used-from', |
| 42 | + errorMessage: { |
| 43 | + text: error.fromFullDate.message |
| 44 | + } if error.fromFullDate, |
| 45 | + fieldset: { |
| 46 | + legend: { |
| 47 | + text: "From", |
| 48 | + classes: "govuk-fieldset__legend--xs govuk-!-font-weight-bold" |
| 49 | + } |
| 50 | + }, |
| 51 | + items: [ |
| 52 | + { |
| 53 | + classes: 'govuk-input--width-2 ' + errorClass, |
| 54 | + name: 'day', |
| 55 | + value: periodUsedFromDay |
| 56 | + }, |
| 57 | + { |
| 58 | + classes: 'govuk-input--width-2 ' + errorClass, |
| 59 | + name: 'month', |
| 60 | + value: periodUsedFromMonth |
| 61 | + }, |
| 62 | + { |
| 63 | + classes: 'govuk-input--width-4 ' + errorClass, |
| 64 | + name: 'year', |
| 65 | + value: periodUsedFromYear |
| 66 | + } |
| 67 | + ] |
| 68 | + }) }} |
| 69 | + |
| 70 | + {# To #} |
| 71 | + {{ govukDateInput({ |
| 72 | + id: 'period-used-To', |
| 73 | + namePrefix: 'period-used-to', |
| 74 | + errorMessage: { |
| 75 | + text: error.toFullDate.message |
| 76 | + } if error.toFullDate, |
| 77 | + fieldset: { |
| 78 | + legend: { |
| 79 | + text: "To", |
| 80 | + classes: "govuk-fieldset__legend--xs govuk-!-font-weight-bold" |
| 81 | + } |
| 82 | + }, |
| 83 | + items: [ |
| 84 | + { |
| 85 | + classes: 'govuk-input--width-2 ' + errorClass, |
| 86 | + name: 'day', |
| 87 | + value: periodUsedToDay |
| 88 | + }, |
| 89 | + { |
| 90 | + classes: 'govuk-input--width-2 ' + errorClass, |
| 91 | + name: 'month', |
| 92 | + value: periodUsedToMonth |
| 93 | + }, |
| 94 | + { |
| 95 | + classes: 'govuk-input--width-4 ' + errorClass, |
| 96 | + name: 'year', |
| 97 | + value: periodUsedToYear |
| 98 | + } |
| 99 | + ] |
| 100 | + }) }} |
| 101 | + {% endset %} |
| 102 | + |
| 103 | + {{ govukRadios({ |
| 104 | + name: "periodDateUsedOptions", |
| 105 | + errorMessage: { |
| 106 | + text: error.periodDateUsedOptions.message |
| 107 | + } if error.periodDateUsedOptions, |
| 108 | + fieldset: { |
| 109 | + legend: { |
| 110 | + classes: "govuk-fieldset__legend--l" |
| 111 | + } |
| 112 | + }, |
| 113 | + items: [ |
| 114 | + { |
| 115 | + value: "default", |
| 116 | + text: "Default abstraction period", |
| 117 | + hint: { text: abstractionPeriod }, |
| 118 | + checked: periodDateUsedOptions === 'default' |
| 119 | + }, |
| 120 | + { |
| 121 | + value: "custom-dates", |
| 122 | + text: "Custom dates", |
| 123 | + checked: periodDateUsedOptions === 'custom-dates', |
| 124 | + conditional: { |
| 125 | + html: dateInputHTML |
| 126 | + } |
| 127 | + } |
| 128 | + ] |
| 129 | + }) }} |
| 130 | + |
| 131 | + {{ govukButton({ text: "Continue", preventDoubleClick: true }) }} |
| 132 | + </form> |
| 133 | + </div> |
| 134 | +{% endblock %} |
0 commit comments