Skip to content

Commit

Permalink
Add new equalities information pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanita Barrett committed Mar 25, 2021
1 parent 0692a58 commit 88ddae6
Show file tree
Hide file tree
Showing 17 changed files with 1,105 additions and 0 deletions.
68 changes: 68 additions & 0 deletions src/patterns/equality-information/asian/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: Asian ethnicity equality question
layout: layout-example.njk
---

{% from "govuk/components/button/macro.njk" import govukButton %}
{% from "govuk/components/radios/macro.njk" import govukRadios %}
{% from "govuk/components/input/macro.njk" import govukInput %}

{% set ethnicityHtml %}
{{ govukInput({
id: "other-description",
name: "other-description",
type: "text",
classes: "govuk-!-width-one-half",
label: {
text: "How would you describe your background? (optional)"
}
}) }}
{% endset -%}

{{ govukRadios({
idPrefix: "ethnicity-detail",
name: "ethnicity-detail",
fieldset: {
legend: {
text: "Which of the following best describes your Asian or Asian British background?",
isPageHeading: true,
classes: "govuk-fieldset__legend--l"
}
},
items: [
{
value: "indian",
text: "Indian"
},
{
value: "pakistani",
text: "Pakistani"
},
{
value: "bangladeshi",
text: "Bangladeshi"
},
{
value: "chinese",
text: "Chinese"
},
{
value: "other",
text: "Any other Asian background",
conditional: {
html: ethnicityHtml
}
},
{
divider: "or"
},
{
value: "skip",
text: "Prefer not to say"
}
]
}) }}

{{ govukButton({
text: "Continue"
}) }}
60 changes: 60 additions & 0 deletions src/patterns/equality-information/black/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: Black ethnicity equality question
layout: layout-example.njk
---

{% from "govuk/components/button/macro.njk" import govukButton %}
{% from "govuk/components/radios/macro.njk" import govukRadios %}
{% from "govuk/components/input/macro.njk" import govukInput %}

{% set ethnicityHtml %}
{{ govukInput({
id: "other-description",
name: "other-description",
type: "text",
classes: "govuk-!-width-one-half",
label: {
text: "How would you describe your background? (optional)"
}
}) }}
{% endset -%}

{{ govukRadios({
idPrefix: "ethnicity-detail",
name: "ethnicity-detail",
fieldset: {
legend: {
text: "Which of the following best describes your Black, African, Caribbean or Black British background?",
isPageHeading: true,
classes: "govuk-fieldset__legend--l"
}
},
items: [
{
value: "african",
text: "African"
},
{
value: "caribbean",
text: "Caribbean"
},
{
value: "other",
text: "Any other Black, African or Caribbean background",
conditional: {
html: ethnicityHtml
}
},
{
divider: "or"
},
{
value: "skip",
text: "Prefer not to say"
}
]
}) }}

{{ govukButton({
text: "Continue"
}) }}
28 changes: 28 additions & 0 deletions src/patterns/equality-information/date-of-birth/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: Date of birth equality question
layout: layout-example.njk
---

{% from "govuk/components/date-input/macro.njk" import govukDateInput %}
{% from "govuk/components/button/macro.njk" import govukButton %}

{{ govukDateInput({
id: "date-of-birth",
namePrefix: "date-of-birth",
fieldset: {
legend: {
text: "What is your date of birth?",
isPageHeading: true,
classes: "govuk-fieldset__legend--l"
}
},
hint: {
text: "For example, 31 3 1980"
}
}) }}

<p class="govuk-body">If you prefer not to say, continue without entering any information.</p>

{{ govukButton({
text: "Continue"
}) }}
47 changes: 47 additions & 0 deletions src/patterns/equality-information/disability-impact/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: Disability impact equality question
layout: layout-example.njk
---

{% from "govuk/components/button/macro.njk" import govukButton %}
{% from "govuk/components/radios/macro.njk" import govukRadios %}

{{ govukRadios({
idPrefix: "disability",
name: "disability",
fieldset: {
legend: {
text: "Do any of your conditions or illnesses reduce your ability to carry out day to day activities?",
isPageHeading: true,
classes: "govuk-fieldset__legend--l"
}
},
hint: {
text: "For example eating, washing, walking or going shopping."
},
items: [
{
value: "little",
text: "Yes, a little"
},
{
value: "lot",
text: "Yes, a lot"
},
{
value: "No",
text: "Not at all"
},
{
divider: "or"
},
{
value: "skip",
text: "Prefer not to say"
}
]
}) }}

{{ govukButton({
text: "Continue"
}) }}
40 changes: 40 additions & 0 deletions src/patterns/equality-information/disability/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Disability equality question
layout: layout-example.njk
---

{% from "govuk/components/button/macro.njk" import govukButton %}
{% from "govuk/components/radios/macro.njk" import govukRadios %}

{{ govukRadios({
idPrefix: "disability",
name: "disability",
fieldset: {
legend: {
text: "Do you have any physical or mental health conditions or illness lasting or expected to last 12 months or more?",
isPageHeading: true,
classes: "govuk-fieldset__legend--l"
}
},
items: [
{
value: "yes",
text: "Yes"
},
{
value: "no",
text: "No"
},
{
divider: "or"
},
{
value: "skip",
text: "Prefer not to say"
}
]
}) }}

{{ govukButton({
text: "Continue"
}) }}
31 changes: 31 additions & 0 deletions src/patterns/equality-information/error-date-of-birth/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Date of birth equality question with error
layout: layout-example.njk
---

{% from "govuk/components/date-input/macro.njk" import govukDateInput %}
{% from "govuk/components/button/macro.njk" import govukButton %}

{{ govukDateInput({
id: "date-of-birth",
namePrefix: "date-of-birth",
fieldset: {
legend: {
text: "What is your date of birth?",
isPageHeading: true,
classes: "govuk-fieldset__legend--l"
}
},
errorMessage: {
text: "Enter a real date of birth, or leave it blank"
},
hint: {
text: "For example, 31 3 1980"
}
}) }}

<p class="govuk-body">If you prefer not to say, continue without entering any information.</p>

{{ govukButton({
text: "Continue"
}) }}
55 changes: 55 additions & 0 deletions src/patterns/equality-information/error-ethnicity/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: Ethnicity question with error
layout: layout-example.njk
---

{% from "govuk/components/radios/macro.njk" import govukRadios %}
{% from "govuk/components/button/macro.njk" import govukButton %}

{{ govukRadios({
idPrefix: "ethnicity",
name: "ethnicity",
fieldset: {
legend: {
text: "What is your ethnic group?",
isPageHeading: true,
classes: "govuk-fieldset__legend--l"
}
},
errorMessage: {
text: "Select an ethnic group or ‘Prefer not to say’"
},
items: [
{
value: "white",
text: "White"
},
{
value: "multiple",
text: "Mixed or multiple ethnic groups"
},
{
value: "asian",
text: "Asian or Asian British"
},
{
value: "black",
text: "Black, African, Carribean or Black British"
},
{
value: "other",
text: "Other ethnic group"
},
{
divider: "or"
},
{
value: "skip",
text: "Prefer not to say"
}
]
}) }}

{{ govukButton({
text: "Continue"
}) }}
52 changes: 52 additions & 0 deletions src/patterns/equality-information/ethnic-group/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: Ethnic group equality question
layout: layout-example.njk
---

{% from "govuk/components/button/macro.njk" import govukButton %}
{% from "govuk/components/radios/macro.njk" import govukRadios %}

{{ govukRadios({
idPrefix: "ethnicity",
name: "ethnicity",
fieldset: {
legend: {
text: "What is your ethnic group?",
isPageHeading: true,
classes: "govuk-fieldset__legend--l"
}
},
items: [
{
value: "white",
text: "White"
},
{
value: "multiple",
text: "Mixed or multiple ethnic groups"
},
{
value: "asian",
text: "Asian or Asian British"
},
{
value: "black",
text: "Black, African, Carribean or Black British"
},
{
value: "other",
text: "Other ethnic group"
},
{
divider: "or"
},
{
value: "skip",
text: "Prefer not to say"
}
]
}) }}

{{ govukButton({
text: "Continue"
}) }}
Loading

0 comments on commit 88ddae6

Please sign in to comment.