From f62c5edaf48db4f1c58e0f9e003afa90bff49607 Mon Sep 17 00:00:00 2001 From: Paul Hayes Date: Mon, 16 Mar 2020 10:59:12 +0000 Subject: [PATCH 01/14] Put choosing courses guidance back Show this on the 1st page only when no courses selected --- app/views/application/choices/index.njk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/views/application/choices/index.njk b/app/views/application/choices/index.njk index 8dca2cbd6..e7c35b9fa 100644 --- a/app/views/application/choices/index.njk +++ b/app/views/application/choices/index.njk @@ -27,6 +27,12 @@ {% endblock %} {% block primary %} + {% set guidance %} +

You can apply to up to 3 courses at this stage of your application.

+

Not all courses and training providers are signed up to Apply for teacher training. If you choose a course that isn’t signed up to the service, you’ll be directed to UCAS to continue your application.

+

You can preview courses currently available on Apply for teacher training.

+ {% endset %} + {% if choices %} {% set referrer = applicationPath + "/choices" %} {% set canAmend = true %} @@ -36,6 +42,8 @@
{% if not choices or choiceCount == 0 %} + {{ guidance | safe }} + {{ govukButton({ text: "Continue", href: applicationPath + "/choices/add" From f603fa229a65ba9c6a39aa1cefe5796bde314da4 Mon Sep 17 00:00:00 2001 From: Paul Hayes Date: Mon, 16 Mar 2020 11:11:06 +0000 Subject: [PATCH 02/14] "Course choice" not "Course choices" in Apply 2 --- app/routes/application/review.js | 2 +- app/views/application/choices/index.njk | 18 +++++++++++++++--- app/views/application/index.njk | 9 +++++++-- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/app/routes/application/review.js b/app/routes/application/review.js index 592c02947..bd6a5b0fa 100644 --- a/app/routes/application/review.js +++ b/app/routes/application/review.js @@ -12,7 +12,7 @@ module.exports = router => { if (successFlash[0] === 'submitted-incompleted-application') { pageObject.errorList = [] const sections = { - choices: 'Course choices not marked as completed', + choices: applicationData.apply2 ? 'Course choice not marked as completed' : 'Course choices not marked as completed', candidate: 'Personal details not entered', 'contact-details': 'Contact details not entered', 'reasonable-adjustments': 'Training with a disability not entered', diff --git a/app/views/application/choices/index.njk b/app/views/application/choices/index.njk index e7c35b9fa..f44c935bb 100644 --- a/app/views/application/choices/index.njk +++ b/app/views/application/choices/index.njk @@ -6,9 +6,17 @@ {% set choices = applicationValue("choices") | toArray %} {% set choiceCount = choices | length %} {% if choiceCount >= 1 %} - {% set title = "Course choices" %} + {% if applicationValue(["apply2"]) %} + {% set title = "Course choice" %} + {% else %} + {% set title = "Course choices" %} + {% endif %} {% else %} - {% set title = "Choosing courses" %} + {% if applicationValue(["apply2"]) %} + {% set title = "Choosing a course" %} + {% else %} + {% set title = "Choosing courses" %} + {% endif %} {% endif %} {% block pageNavigation %} @@ -28,7 +36,11 @@ {% block primary %} {% set guidance %} -

You can apply to up to 3 courses at this stage of your application.

+ {% if applicationValue(["apply2"]) %} +

You can only apply to 1 course at a time at this stage of your application.

+ {% else %} +

You can apply to up to 3 courses at this stage of your application.

+ {% endif %}

Not all courses and training providers are signed up to Apply for teacher training. If you choose a course that isn’t signed up to the service, you’ll be directed to UCAS to continue your application.

You can preview courses currently available on Apply for teacher training.

{% endset %} diff --git a/app/views/application/index.njk b/app/views/application/index.njk index e37ee1ef4..7e17e9a35 100644 --- a/app/views/application/index.njk +++ b/app/views/application/index.njk @@ -37,11 +37,16 @@ text: "You have 5 days remaining (until " + (7 | nowPlusDays("d MMMM yyyy")) + ") to submit your edited application", iconFallbackText: "Warning" }) if status == "amending" }} -

Course choices

+ + {% if applicationValue(["apply2"]) %} +

Course choice

+ {% else %} +

Course choices

+ {% endif %} {{ appTaskList({ classes: "govuk-!-margin-bottom-8", items: [{ - text: "Course choices", + text: "Course choice" if applicationValue(["apply2"]) else "Course choices", href: applicationPath + "/choices", id: "personal-details", tag: { From 58a1bdf41e1d77a89c88781c657a0a5dad73ac07 Mon Sep 17 00:00:00 2001 From: Paul Hayes Date: Mon, 16 Mar 2020 11:13:03 +0000 Subject: [PATCH 03/14] Don't show Add another course page for Apply 2 --- app/routes/application/choices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routes/application/choices.js b/app/routes/application/choices.js index 6f72b802b..089a228da 100644 --- a/app/routes/application/choices.js +++ b/app/routes/application/choices.js @@ -132,7 +132,7 @@ module.exports = router => { const count = Object.keys(applicationData.choices).length const paths = pickPaths(req) - if (count === 3 || req.body['add-another-course'] === 'no') { + if (count === 3 || applicationData.apply2 || req.body['add-another-course'] === 'no') { res.redirect(req.params.referrer || paths.next) } else { res.render('application/choices/another', { From f04fb72411afbe8724756198b3febdb079a31166 Mon Sep 17 00:00:00 2001 From: Paul Hayes Date: Mon, 16 Mar 2020 11:13:12 +0000 Subject: [PATCH 04/14] Don't show Add another course button for Apply 2 --- app/views/application/choices/index.njk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/application/choices/index.njk b/app/views/application/choices/index.njk index f44c935bb..6e3ee8272 100644 --- a/app/views/application/choices/index.njk +++ b/app/views/application/choices/index.njk @@ -62,7 +62,7 @@ }) }} {% endif %} - {% if choiceCount >= 1 and choiceCount < 3 %} + {% if choiceCount >= 1 and choiceCount < 3 and not applicationValue(["apply2"]) %} {{ govukButton({ classes: "govuk-button--secondary govuk-!-margin-bottom-9", text: "Add another course", From 68ac5474203a941b73237e9f78bb1bc4a6c99030 Mon Sep 17 00:00:00 2001 From: Paul Hayes Date: Mon, 16 Mar 2020 11:18:21 +0000 Subject: [PATCH 05/14] Course not courses on review --- app/views/application/review.njk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/application/review.njk b/app/views/application/review.njk index 8ffdf0ac6..73c20d7ec 100644 --- a/app/views/application/review.njk +++ b/app/views/application/review.njk @@ -28,7 +28,11 @@ text: "Please review your changes carefully before you resubmit. Your application can only be resubmitted once." }) if status == "amending" }} -

Courses

+ {% if applicationValue(["apply2"]) %} +

Course

+ {% else %} +

Courses

+ {% endif %} {% set choices = applicationValue(["choices"]) | toArray %} {% set showChoiceStatus = false %} {% set showIncomplete = true %} From 71cef27a028d2ea244b3e679ad12679141f177e0 Mon Sep 17 00:00:00 2001 From: Paul Hayes Date: Mon, 16 Mar 2020 11:24:45 +0000 Subject: [PATCH 06/14] Add an "Apply again" page A page as a route into starting Apply 2 --- app/views/application/apply-again.njk | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 app/views/application/apply-again.njk diff --git a/app/views/application/apply-again.njk b/app/views/application/apply-again.njk new file mode 100644 index 000000000..187369ebc --- /dev/null +++ b/app/views/application/apply-again.njk @@ -0,0 +1,25 @@ +{% extends "_content.njk" %} + +{% set title = "Do you want to apply again?" %} + +{% block primary %} +

Your first application was unsuccessful.

+ +

If you apply again we’ll:

+
    +
  • copy your application so you don’t need to start again
  • +
  • let you make changes to each section
  • +
  • keep your references so you won’t need to request new ones
  • +
+ +

You can only apply to 1 course at a time at this stage of your application.

+ +
+ {{ govukButton({ + classes: "govuk-!-margin-bottom-5", + text: "Make a new application", + href: "/application/" + applicationId + "/apply2" + }) }} +

or

+

Go to your dashboard

+{% endblock %} From 7e2c6c309b36981e252a6a0d35eba0a85dd22667 Mon Sep 17 00:00:00 2001 From: Paul Hayes Date: Mon, 16 Mar 2020 11:36:58 +0000 Subject: [PATCH 07/14] Show a copied banner after creating Apply 2 application --- app/routes/application.js | 6 ++++-- app/views/application/index.njk | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/routes/application.js b/app/routes/application.js index 037c1e784..e9f6693c2 100644 --- a/app/routes/application.js +++ b/app/routes/application.js @@ -155,8 +155,10 @@ module.exports = router => { // Render application page router.all('/application/:applicationId', (req, res) => { + const showCopiedBanner = req.query.copied + req.session.data.applications[req.params.applicationId].welcomeFlow = false - res.render('application/index') + res.render('application/index', { showCopiedBanner }) }) // Generate apply2 application from an existing one @@ -175,7 +177,7 @@ module.exports = router => { data.applications[code] = apply2Application - res.redirect(`/application/${code}`) + res.redirect(`/application/${code}?copied=true`) }) // Render submitted page diff --git a/app/views/application/index.njk b/app/views/application/index.njk index 7e17e9a35..bedb9252b 100644 --- a/app/views/application/index.njk +++ b/app/views/application/index.njk @@ -14,6 +14,16 @@ {% endif %} {% set hasSecondary = true %} +{% block beforePageTitle %} + {% if showCopiedBanner %} + {{ appBanner({ + html: "

We’ve copied your application

", + type: "success", + icon: false + }) }} + {% endif %} +{% endblock %} + {% block pageNavigation %} {% if hasSubmittedApplications() %} {{ govukBreadcrumbs({ From 490df0ce42a0aaf51a7519b383d71bc48518fa77 Mon Sep 17 00:00:00 2001 From: Paul Hayes Date: Mon, 16 Mar 2020 12:28:29 +0000 Subject: [PATCH 08/14] Show that Apply2 references have been received --- app/data/dummy-apply-2-application.js | 4 ++++ app/routes/application.js | 8 ++++++++ app/views/_includes/item/reference.njk | 5 +++++ app/views/_includes/review/references.njk | 16 ++++++++++------ 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/app/data/dummy-apply-2-application.js b/app/data/dummy-apply-2-application.js index 17d994ca4..c938f13a6 100644 --- a/app/data/dummy-apply-2-application.js +++ b/app/data/dummy-apply-2-application.js @@ -11,4 +11,8 @@ dummyApply2Application.completed = {} // No choices yet dummyApply2Application.choices = {} +// References received +dummyApply2Application.referees.first.status = 'Received' +dummyApply2Application.referees.second.status = 'Received' + module.exports = dummyApply2Application diff --git a/app/routes/application.js b/app/routes/application.js index e9f6693c2..1cf458494 100644 --- a/app/routes/application.js +++ b/app/routes/application.js @@ -175,6 +175,14 @@ module.exports = router => { apply2Application.completed = {} apply2Application.previousApplications = [existingApplicationId] + if (apply2Application.referees && apply2Application.referees.first) { + apply2Application.referees.first.status = 'Received' + } + + if (apply2Application.referees && apply2Application.referees.second) { + apply2Application.referees.second.status = 'Received' + } + data.applications[code] = apply2Application res.redirect(`/application/${code}?copied=true`) diff --git a/app/views/_includes/item/reference.njk b/app/views/_includes/item/reference.njk index 151c38a36..5fb848328 100644 --- a/app/views/_includes/item/reference.njk +++ b/app/views/_includes/item/reference.njk @@ -1,5 +1,10 @@ {% set applicationPath = "/application/" + applicationId %} {% set status = item.status or "requested" %} + +{% if applicationValue('apply2') %} + {% set showReferenceStatus = true %} +{% endif %} + {% set statusHtml %} {{ govukTag({ classes: "app-tag--" + status, diff --git a/app/views/_includes/review/references.njk b/app/views/_includes/review/references.njk index ddbf4ae0e..85e4ff2dd 100644 --- a/app/views/_includes/review/references.njk +++ b/app/views/_includes/review/references.njk @@ -1,12 +1,16 @@ {% set complete = references | length > 0 %} {% if complete %} {% set canAmend = true if not hasSubmittedApplications() %} - {% if not canAmend %} -

We’ve contacted the referees you provided below. We’ll let you know if they don’t give a reference.

- {% else %} - {# You can’t change your referees once application has been submitted #} -

We’ll contact your referees after you submit your application. We’ll let you know if they don’t give a reference.

- {% endif %} +
+
+ {% if not canAmend %} +

We’ve contacted the referees you provided below. We’ll let you know if they don’t give a reference.

+ {% else %} + {# You can’t change your referees once application has been submitted #} +

We’ll contact your referees after you submit your application. We’ll let you know if they don’t give a reference.

+ {% endif %} +
+
{% set references = references | toArray %} {% for item in references %} {% set refereeHtml %} From 166379fd1696a9a08670de7f0d0df4ab09c94dbb Mon Sep 17 00:00:00 2001 From: Paul Hayes Date: Mon, 16 Mar 2020 12:40:21 +0000 Subject: [PATCH 09/14] Make references read only for submitted referees --- app/views/_includes/item/reference.njk | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/_includes/item/reference.njk b/app/views/_includes/item/reference.njk index 5fb848328..5fddb6a6e 100644 --- a/app/views/_includes/item/reference.njk +++ b/app/views/_includes/item/reference.njk @@ -3,6 +3,7 @@ {% if applicationValue('apply2') %} {% set showReferenceStatus = true %} + {% set canAmend = false %} {% endif %} {% set statusHtml %} From d64076a77e009b53281b4aa5d14a6df59efe427c Mon Sep 17 00:00:00 2001 From: Paul Hayes Date: Mon, 16 Mar 2020 12:40:30 +0000 Subject: [PATCH 10/14] Tweak references guidance for Apply 2 --- app/views/_includes/review/references.njk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/_includes/review/references.njk b/app/views/_includes/review/references.njk index 85e4ff2dd..d79faea53 100644 --- a/app/views/_includes/review/references.njk +++ b/app/views/_includes/review/references.njk @@ -6,8 +6,12 @@ {% if not canAmend %}

We’ve contacted the referees you provided below. We’ll let you know if they don’t give a reference.

{% else %} - {# You can’t change your referees once application has been submitted #} -

We’ll contact your referees after you submit your application. We’ll let you know if they don’t give a reference.

+ {% if applicationValue('apply2') %} +

If you replace a referee we will contact them after you submit your application. We’ll let you know if they don’t give a reference.

+ {% else %} + {# You can’t change your referees once application has been submitted #} +

We’ll contact your referees after you submit your application. We’ll let you know if they don’t give a reference.

+ {% endif %} {% endif %}
From bf5a1f2f49b4da64fee69c94059f3d5d2a1e03a3 Mon Sep 17 00:00:00 2001 From: Paul Hayes Date: Mon, 16 Mar 2020 12:54:51 +0000 Subject: [PATCH 11/14] Include link to previous applications --- app/views/_includes/need-help.njk | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/_includes/need-help.njk b/app/views/_includes/need-help.njk index 71250577e..4cd41bbf4 100644 --- a/app/views/_includes/need-help.njk +++ b/app/views/_includes/need-help.njk @@ -1,4 +1,11 @@ {% set contentHtml %} + {% if applicationValue('apply2') %} +

+ View previous applications +

+ +

Need help?

+ {% endif %}