Skip to content

Commit

Permalink
Merge pull request #323 from DFE-Digital/criminal-convictions
Browse files Browse the repository at this point in the history
Add section for suitability to work with children
  • Loading branch information
fofr committed Jan 21, 2020
2 parents 3697a11 + ec86040 commit ce43b47
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ module.exports = router => {
require('./application/work-history')(router)
require('./application/school-experience')(router)
require('./application/reasonable-adjustments')(router)
require('./application/suitability')(router)
require('./application/vocation')(router)
require('./application/degree')(router)
require('./application/gcse')(router)
Expand Down
27 changes: 27 additions & 0 deletions app/routes/application/suitability.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Application: Suitability routes
*/
module.exports = router => {
// First page
router.get('/application/:applicationId/suitability', (req, res) => {
const referrer = req.query.referrer
const option = req.query.option || 'a'

res.render('application/suitability/index', {
referrer,
option,
formaction: `/application/${req.params.applicationId}/suitability/review`
})
})

// Render other reasonable adjustment pages
router.get('/application/:applicationId/suitability/:view', (req, res) => {
const { referrer } = req.query
const { option } = req.session.data

res.render(`application/suitability/${req.params.view}`, {
referrer,
option
})
})
}
48 changes: 48 additions & 0 deletions app/views/_includes/review/suitability.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{% set applicationPath = "/application/" + applicationId %}
{% set supportDetailsHtml %}
{{ govukSummaryList({
rows: [{
key: {
text: "Do you want to share any information which could have an impact on your application?"
},
value: {
text: "Yes" if applicationValue(["suitability", "disclose"]) == 'true' else 'No'
},
actions: {
items: [{
href: applicationPath + "/suitability?referrer=" + referrer,
text: "Change",
visuallyHiddenText: "whether you need to share something"
}]
} if canAmend
}, {
key: {
text: "Relevant information"
},
value: {
html: applicationValue(["suitability", "statement"])
},
actions: {
items: [{
href: applicationPath + "/suitability?referrer=" + referrer,
text: "Change",
visuallyHiddenText: "the information you are sharing"
}]
} if canAmend
} if applicationValue(["suitability", "disclose"]) == 'true']
}) }}
{% endset %}

{% set complete = applicationValue(["suitability"]) | length > 0 %}
{% if complete %}
{{ appSummaryCard({
classes: "govuk-!-margin-bottom-6",
html: supportDetailsHtml
}) }}
{% else %}
{% set incompleteType = "warning" if errorList %}
{% set incompleteId = "suitability" %}
{% set incompleteText = "No information entered" %}
{% set incompleteLink = "/suitability?referrer=" + referrer %}
{% include "_includes/review/incomplete.njk" %}
{% endif %}
10 changes: 9 additions & 1 deletion app/views/application/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,15 @@
classes: tagClass,
text: tagText
} if applicationValue("reasonable-adjustments") | length > 0
}]
}, {
text: "Your suitability to work with children",
href: applicationPath + "/suitability" + ("/review" if applicationValue("suitability") | length > 0),
id: "suitability",
tag: {
classes: tagClass,
text: tagText
} if applicationValue("suitability") | length > 0
}]
}) }}

<h2 class="govuk-heading-m govuk-!-font-size-27 govuk-!-margin-bottom-2">Qualifications</h2>
Expand Down
3 changes: 3 additions & 0 deletions app/views/application/review.njk
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
<h3 class="govuk-heading-m">Get extra assistance to become a teacher</h3>
{% include "_includes/review/reasonable-adjustments.njk" %}

<h3 class="govuk-heading-m">Your suitability to work with children</h3>
{% include "_includes/review/suitability.njk" %}

<h2 class="govuk-heading-m govuk-!-font-size-27">Work history</h2>
{% include "_includes/review/work-history.njk" %}

Expand Down
72 changes: 72 additions & 0 deletions app/views/application/suitability/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{% extends "_form.njk" %}

{% set title = "Your suitability to work with children" %}

{% block pageNavigation %}
{% if referrer %}
{{ govukBackLink({
href: referrer
}) }}
{% else %}
{{ govukBackLink({
href: "/application/" + applicationId,
text: "Back to application"
}) }}
{% endif %}
{% endblock %}

{% block primary %}
<p class="govuk-body">
Everyone has to have an enhanced <a href="https://www.gov.uk/government/organisations/disclosure-and-barring-service">Disclosure and Barring Check</a> (DBS check) before becoming a teacher. This shows your criminal record.
</p>

<p class="govuk-body">
Providers will also use other evidence and formal checks in the UK and abroad to decide if you’re suitable for teaching.
</p>

<p class="govuk-body">
If you’re concerned about something which could affect your application, you can talk to your provider about it.
</p>

<p class="govuk-body">
It won’t necessarily stop you from becoming a teacher. Showing honesty early on can help your application.
</p>

{% set disabilityConditional %}
{{ govukCharacterCount({
label: {
html: "Give any relevant information",
classes: "govuk-label--s"
},
maxwords: 400,
rows: 8
} | decorateApplicationAttributes(["suitability", "statement"])) }}
{% endset %}

{{ govukRadios({
fieldset: {
classes: "govuk-!-margin-top-6",
legend: {
text: "Do you want to share any information which could have an impact on your application?",
classes: "govuk-fieldset__legend--m"
}
},
items: [{
value: "true",
text: "Yes, I want to share something",
hint: {
text: "You can tell us about it here or get in touch with your training provider directly."
},
conditional: {
html: disabilityConditional
}
}, {
value: "false",
text: "No"
}]
} | decorateApplicationAttributes(["suitability", "disclose"])) }}

{{ govukButton({
text: "Continue"
}) }}
{% endblock %}
21 changes: 21 additions & 0 deletions app/views/application/suitability/review.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% extends "_content-wide.njk" %}

{% set applicationPath = "/application/" + applicationId %}
{% set referrer = applicationPath + "/suitability/review" %}
{% set title = "Your suitability to work with children" %}
{% set canAmend = true %}

{% block pageNavigation %}
{{ govukBackLink({
href: "/application/" + applicationId,
text: "Back to application"
}) }}
{% endblock %}

{% block primary %}
{% include "_includes/review/suitability.njk" %}
{{ govukButton({
text: "Continue",
href: applicationPath
}) }}
{% endblock %}

0 comments on commit ce43b47

Please sign in to comment.