Skip to content

Commit

Permalink
Adding candidate pool opt in (#891)
Browse files Browse the repository at this point in the history
Giving candidates the option of allowing other providers to view their application and invite them to apply.
  • Loading branch information
PeteWilliams authored Jan 15, 2025
1 parent 21604e6 commit b3f9da5
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 29 deletions.
36 changes: 29 additions & 7 deletions app/routes/applications.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,16 @@ module.exports = router => {
})
})

router.get('/applications/:id/candidate-pool', (req, res) => {
const { id } = req.params
const degree = req.session.data.degrees

res.render('applications/candidate-pool', {
id,
degree
})
})

router.get('/applications/:id/review-application', (req, res) => {
const { id } = req.params

Expand Down Expand Up @@ -297,13 +307,11 @@ module.exports = router => {
req.session.data.applications[id].status = "Awaiting decision"
req.session.data.applications[id].submittedAt = new Date()
res.redirect('/applications')
}
// function for submitting an application
else if (submitNow == 'yes') {
// req.session.data.applications[id].status = "Awaiting decision"
// req.session.data.applications[id].submittedAt = new Date()
res.redirect('/applications/' + id + '/review-and-submit')
}
} else if (submitNow == 'yes' && !req.session.data.candidatePool ) {
res.redirect('/applications/' + id + '/candidate-pool')
} else if (submitNow == 'yes' ) {
res.redirect('/applications/' + id + '/review-and-submit')
}
// function to save application as a draft
else if (submitNow === 'no') {
res.redirect('/applications')
Expand Down Expand Up @@ -331,6 +339,20 @@ module.exports = router => {
res.redirect('/applications')
})


router.post('/applications(/:id)?/candidate-pool', (req, res) => {
const { id } = req.params

if ( id ) {
const application = req.session.data.applications[id]
res.redirect('/applications/' + id + '/review-and-submit')
} else {
const showPoolBanner = true
res.render('/applications/index', { showPoolBanner, id })
}
})


//function to withdraw application
router.post('/applications/:id/withdraw', (req, res) => {
const { id } = req.params
Expand Down
57 changes: 57 additions & 0 deletions app/views/applications/candidate-pool.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{% extends "layouts/main.html" %}
{% set primaryNavId = "applications" %}
{% set title = "Increase your chances of success by allowing other providers to invite you to apply" %}
{% set application = data.applications[id] %}
{% set degreeGrade = data.degrees[id]%}

{% block beforeContent %}
{{ govukBackLink({
href: "/applications",
text: "Back to your application"
}) }}
{% endblock %}

{% block content %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-three-quarters">
<div{% if id %} class="app-grid-column--grey"{% endif %}>
<h3 class="govuk-heading-l">Increase your chances of success by allowing other providers to invite you to apply</h3>
<p class="govuk-body">If this application is unsuccessful, you can allow other providers of similar courses to view your application and if they think you are suitable, invite you to apply.</p>
</div>

<div class="govuk-button-group">
<form action="/applications/{{ id }}/candidate-pool" method="post">

{{ govukRadios({
name: "candidatePool",
classes: "govuk-radios--inline",
fieldset: {
legend: {
text: "Do you want to allow other providers to invite you to apply to their courses?",
isPageHeading: true,
classes: "govuk-fieldset__legend--m"
}
},
items: [
{
value: "true",
text: "Yes",
checked: ( data.candidatePool == "true")
},
{
value: "false",
text: "No",
checked: ( data.candidatePool == "false")
}
]
}) }}

{{ govukButton({
text: ("Continue" if id else "Save")
}) }}
</form>
</div>

</div>
</div>
{% endblock %}
23 changes: 22 additions & 1 deletion app/views/applications/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{% block content %}

{% if showDeclineBanner or showWithdrawnBanner %}
{% if showDeclineBanner or showWithdrawnBanner or showPoolBanner %}

{% set application = data.applications[id] %}

Expand All @@ -30,6 +30,14 @@
}) }}
{% endif %}

{% if showPoolBanner %}

{{ govukNotificationBanner({
text: ("Other providers can now see your application details" if data['candidatePool'] == "true" else "Other providers can no longer see your application details") ,
type: 'success'
}) }}
{% endif %}

</div>
</div>

Expand Down Expand Up @@ -170,6 +178,19 @@ <h2 class="govuk-heading-m"></h2>

{% endfor %}

{% if data.applications %}
<h3 class="govuk-heading-m">Sharing your application details</h3>
<p class="govuk-body">
{% if data.candidatePool == "true" %}
Your application details are visible to training providers that you have not submitted an application to.
You can <a href="/applications/candidate-pool" class="govuk-link">change this setting to stop providers viewing your details</a>.
{% else %}
Your application details are not visible to training providers that you have not submitted an application to.
<a href="/applications/candidate-pool" class="govuk-link">You can change this setting to allow providers to view your details</a>.
{% endif %}
</p>
{% endif %}

</div>
</div>
{% endblock %}
22 changes: 1 addition & 21 deletions app/views/applications/interruption-module.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h3 class="govuk-heading-l">Give your application the best chance of success</h3
<p class="govuk-body">90% of successful candidates write about 500 words or more for their personal statement.</p>
<p class="govuk-body">Increase your chances of getting an offer by adding more information to your personal statement.</p>

{% elif degree.G3CL4.grade == "Third-class honours"%}
{% elif degree.G3CL4.grade == "Third-class honours"%}
{#------ Degree ------#}
<p class="govuk-body">For this course, you'll need a degree grade of 2:2 or higher.</p>
<p class="govuk-body">{{data.applications[id].providerName}} will still consider your application. To increase your chances of a successful application you can also apply for course matching your degree grade.</p>
Expand All @@ -44,26 +44,6 @@ <h3 class="govuk-heading-l">Give your application the best chance of success</h3
</div>

<div class="govuk-button-group">
{# <form action="/applications/{{ id }}/submit" method="post">
<p class="govuk-body govuk-fieldset__legend--s">Are you sure you want to submit your application now?</p>
{{ govukButton({
name: "submitNowPost",
value: "yes",
text: "Submit application",
classes: "govuk-button--inverse"
}) }}

{% if data.referencesPersonalEmail %}
<a class="govuk-link" href="/details/personal-statement">Update your references</a>
{% elif data.personalStatement.length < 500 %}
<a class="govuk-link" href="/details/personal-statement">Edit your personal statement</a>
{% elif degree.G3CL4.grade == "Third-class honours"%}
<a class="govuk-link" href="/applications">Save as a draft</a>
{% else%}
<a class="govuk-link" href="/details/references">Add references</a>

{% endif %}
</form> #}
<form action="/applications/{{ id }}/review-and-submit" method="post">

{% if data.referencesPersonalEmail %}
Expand Down

0 comments on commit b3f9da5

Please sign in to comment.