diff --git a/app/routes/applications.js b/app/routes/applications.js index 87369ccf..984fed05 100644 --- a/app/routes/applications.js +++ b/app/routes/applications.js @@ -114,19 +114,37 @@ module.exports = router => { }) }) - router.get('/applications/:id/school-placement', (req, res) => { + router.get('/applications/:id/school-placement(-second)?', (req, res) => { + console.log(req.params); const { id } = req.params + var priority = req.params[0] + if ( priority) { + priority = priority.substring(1) + } else { + priority = 'first' + } - const placementItems = data.placements + var placementItems = data.placements .sort((a, b) => (a.name.localeCompare(b.name))) .map(placement => ({ text: placement.name, value: placement.name, hint: { text: placement.address } })) + placementItems.unshift({'text': 'I have no preference', value: 'I have no preference'}) + res.render('applications/school-placement', { id, + priority, placementItems }) }) + router.get('/applications/:id/school-placement-preferences', (req, res) => { + const { id } = req.params + res.render('applications/school-placement-preferences', { + id + }) + }) + + router.get('/applications/:id/courses-other', (req, res) => { const { id } = req.params @@ -362,4 +380,4 @@ module.exports = router => { res.redirect('/accepted') }) -} \ No newline at end of file +} diff --git a/app/views/applications/review.html b/app/views/applications/review.html index 4d1594ff..2ebf9ffd 100644 --- a/app/views/applications/review.html +++ b/app/views/applications/review.html @@ -19,6 +19,14 @@

{{ title }}

This information and your details will be shared with {{ application.providerName }} when you submit your application.

+ {% if application.placement.location == "home" %} + {% set locationAnswer = "My home address (" + ( data.address.postalCode or "KT23 3NW" ) + ")" %} + {% elseif application.placement.location == "another" %} + {% set locationAnswer = application.placement.otherLocation %} + {% else %} + {% set locationAnswer = "I am open to relocating" %} + {% endif %} + {{ govukSummaryList({ rows: [ { @@ -55,10 +63,10 @@

{{ title }}

}, { key: { - text: "Location" + text: "First choice placement" }, value: { - html: application.placement + html: application.placement.first }, actions: { items: [ @@ -68,7 +76,99 @@

{{ title }}

} ] } - } + }, + { + key: { + text: "Second choice placement" + }, + value: { + html: application.placement.second + }, + actions: { + items: [ + { + text: "Change", + href: "/applications/" + id + "/school-placement-second" + } + ] + } + }, + { + key: { + text: "Where you will travel from" + }, + value: { + html: locationAnswer + }, + actions: { + items: [ + { + text: "Change", + href: "/applications/" + id + "/school-placement-preferences" + } + ] + } + }, + { + key: { + text: "Constraints on your time" + }, + value: { + text: ("Yes" if application.placement.constraints == "yes" else "No") + }, + actions: { + items: [ + { + text: "Change", + href: "/applications/" + id + "/school-placement-preferences" + } + ] + } + }, + { + key: { + text: "Relevant information" + }, + value: { + html: application.placement.constraintsDetails + }, + actions: { + items: [{ + text: "Change", + href: "/applications/" + id + "/school-placement-preferences" + }] + } + } if application.placement.constraints === "yes", + { + key: { + text: "Anything else" + }, + value: { + text: ("Yes" if application.placement.other == "yes" else "No") + }, + actions: { + items: [ + { + text: "Change", + href: "/applications/" + id + "/school-placement-preferences" + } + ] + } + }, + { + key: { + text: "Relevant information" + }, + value: { + html: application.placement.otherDetails + }, + actions: { + items: [{ + text: "Change", + href: "/applications/" + id + "/school-placement-preferences" + }] + } + } if application.placement.other === "yes" ] })}} diff --git a/app/views/applications/school-placement-preferences.html b/app/views/applications/school-placement-preferences.html new file mode 100644 index 00000000..26df0871 --- /dev/null +++ b/app/views/applications/school-placement-preferences.html @@ -0,0 +1,149 @@ +{% extends "layouts/main.html" %} + +{% set primaryNavId = "applications" %} + +{% set title = "Select your " + priority + " choice placement" %} +{% set application = data.applications[id] %} + +{% block beforeContent %} + {{ govukBackLink({ + href: "/applications/" + id + "/course" + }) }} +{% endblock %} + +{% block content %} +
+
+ {{ application.providerName }} +

School placement preferences

+ +

Your training provider will work with you to select placements that suit your needs.

+

You can also talk to them at interview about your needs.

+ +
+ + {% set locationHtml %} + {{ govukInput({ + id: "other-location", + name: "applications[" + id + "][placement][otherLocation]", + value: data.applications[id].placement.otherLocation, + classes: "govuk-!-width-one-third", + label: { + text: "Postcode or town name" + } + }) }} + {% endset -%} + + {{ govukRadios({ + name: "applications[" + id + "][placement][location]", + value: data.applications[id].placement.location, + fieldset: { + legend: { + text: "Where will you travel to your placement from? (optional)", + isPageHeading: false, + classes: "govuk-fieldset__legend--m" + } + }, + items: [ + { + value: "home", + text: "My home address (" + ( data.address.postalCode or "KT23 3NW" ) + ")" + }, + { + value: "another", + text: "Another location", + conditional: { + html: locationHtml + } + }, + { + value: "relocating", + text: "I am open to relocating" + } + ] + }) }} + + {% set constraintsHtml %} + {{ govukTextarea({ + id: "constraints-details", + name: "applications[" + id + "][placement][constraintsDetails]", + value: data.applications[id].placement.constraintsDetails, + classes: "govuk-!-width-full", + label: { + text: "Enter more detail" + } + }) }} + {% endset -%} + + {{ govukRadios({ + name: "applications[" + id + "][placement][constraints]", + value: data.applications[id].placement.constraints, + fieldset: { + legend: { + text: "Do you have any constraints on your time? (optional)", + isPageHeading: false, + classes: "govuk-fieldset__legend--m" + } + }, + hint: { + text: "For example, you need to do the school run." + }, + items: [ + { + value: "yes", + text: "Yes", + conditional: { + html: constraintsHtml + } + }, + { + value: "no", + text: "No" + } + ] + }) }} + + {% set otherHtml %} + {{ govukTextarea({ + id: "other-details", + name: "applications[" + id + "][placement][otherDetails]", + value: data.applications[id].placement.otherDetails, + classes: "govuk-!-width-full", + label: { + text: "Enter more detail" + } + }) }} + {% endset -%} + + {{ govukRadios({ + name: "applications[" + id + "][placement][other]", + value: data.applications[id].placement.other, + fieldset: { + legend: { + text: "Is there anything else we should know when we select your placement schools? (optional)", + isPageHeading: false, + classes: "govuk-fieldset__legend--m" + } + }, + items: [ + { + value: "yes", + text: "Yes", + conditional: { + html: otherHtml + } + }, + { + value: "no", + text: "No" + } + ] + }) }} + + {{ govukButton({ + text: "Continue" + }) }} +
+
+
+{% endblock %} diff --git a/app/views/applications/school-placement.html b/app/views/applications/school-placement.html index 624cb657..0d2716f2 100644 --- a/app/views/applications/school-placement.html +++ b/app/views/applications/school-placement.html @@ -2,7 +2,7 @@ {% set primaryNavId = "applications" %} -{% set title = "Which location are you interested in?" %} +{% set title = "Select your " + priority + " choice placement" %} {% set application = data.applications[id] %} {% block beforeContent %} @@ -15,11 +15,18 @@
{{ application.providerName }} -

School placement location

-

During your training, you’ll be placed in at least 2 different schools to give you experience of teaching in a real classroom.

-

You can choose which location you’re most interested in. Your training provider will do their best to place you at a location you prefer and can travel to.

+

Placement schools

+ + {% if priority == 'first' %} +

Your training provider will select at least 2 different placement schools to give you experience of teaching in a real classroom. They will choose placements based on both your practical needs, such as location and transport, and their knowledge of the different strengths and features of the schools in their network.

+

You can select the schools that you are most interested in, but this does not guarantee that you will be placed in them.

+

The schools that training providers work with can change, so schools may be added or removed from this list at any time.

+ +
+ {% else %} + + {% endif %} - {{ govukRadios({ fieldset: { @@ -30,8 +37,8 @@

School placement location

}, idPrefix: "placement", items: placementItems, - name: "applications[" + id + "][placement]", - value: data.applications[id].placement + name: "applications[" + id + "][placement][" + priority + "]", + value: data.applications[id].placement[" + priority + "] }) }} {{ govukButton({