-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3068 from DFE-Digital/TEVA-2059-shortlist-applicant
[TEVA-2059] Publishers can shortlist and reject applicants
- Loading branch information
Showing
48 changed files
with
860 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 46 additions & 2 deletions
48
app/controllers/publishers/vacancies/job_applications_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
app/form_models/publishers/job_application/update_status_form.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Publishers::JobApplication::UpdateStatusForm | ||
include ActiveModel::Model | ||
|
||
attr_accessor :further_instructions, :rejection_reasons | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module JobApplicationHelper | ||
PUBLISHER_STATUS_MAPPINGS = { submitted: "review", unsuccessful: "rejected" }.freeze | ||
|
||
JOB_APPLICATION_STATUS_TAG_COLOURS = { | ||
draft: "pink", submitted: "blue", shortlisted: "green", unsuccessful: "red", withdrawn: "grey" | ||
}.freeze | ||
|
||
def job_application_status_tag(status) | ||
govuk_tag text: status, | ||
colour: JOB_APPLICATION_STATUS_TAG_COLOURS[status.to_sym], | ||
classes: "govuk-!-margin-bottom-2" | ||
end | ||
|
||
def publisher_job_application_status_tag(status) | ||
govuk_tag text: PUBLISHER_STATUS_MAPPINGS[status.to_sym], | ||
colour: JOB_APPLICATION_STATUS_TAG_COLOURS[status.to_sym], | ||
classes: "govuk-!-margin-bottom-2" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,39 @@ | ||
class Jobseekers::JobApplicationMailer < Jobseekers::BaseMailer | ||
def application_shortlisted(job_application) | ||
@job_application = job_application | ||
@vacancy = @job_application.vacancy | ||
@organisation_name = @vacancy.parent_organisation.name | ||
@contact_email = @vacancy.contact_email | ||
@jobseeker = @job_application.jobseeker | ||
|
||
@template = NOTIFY_JOBSEEKER_APPLICATION_SHORTLISTED_TEMPLATE | ||
@to = @jobseeker.email | ||
|
||
view_mail(@template, to: @to, subject: I18n.t("jobseekers.job_application_mailer.application_shortlisted.subject")) | ||
end | ||
|
||
def application_submitted(job_application) | ||
@vacancy = job_application.vacancy | ||
@organisation_name = @vacancy.parent_organisation.name | ||
@contact_email = @vacancy.contact_email | ||
@jobseeker = job_application.jobseeker | ||
|
||
@template = NOTIFY_JOBSEEKER_APPLICATION_SUBMITTED_CONFIRMATION_TEMPLATE | ||
@to = job_application.jobseeker.email | ||
@template = NOTIFY_JOBSEEKER_APPLICATION_SUBMITTED_TEMPLATE | ||
@to = @jobseeker.email | ||
|
||
view_mail(@template, to: @to, subject: I18n.t("jobseekers.job_application_mailer.application_submitted.subject")) | ||
end | ||
|
||
def application_unsuccessful(job_application) | ||
@job_application = job_application | ||
@vacancy = @job_application.vacancy | ||
@organisation_name = @vacancy.parent_organisation.name | ||
@contact_email = @vacancy.contact_email | ||
@jobseeker = @job_application.jobseeker | ||
|
||
@template = NOTIFY_JOBSEEKER_APPLICATION_UNSUCCESSFUL_TEMPLATE | ||
@to = @jobseeker.email | ||
|
||
view_mail(@template, to: @to, subject: I18n.t("jobseekers.job_application_mailer.application_unsuccessful.subject")) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
app/views/jobseekers/job_application_mailer/application_shortlisted.text.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<%= t(".intro", job_title: @vacancy.job_title, organisation_name: @organisation_name) %> | ||
|
||
# <%= t(".heading") %> | ||
<%- if @job_application.application_data["further_instructions"].present? %> | ||
# <%= t(".instructions") %> | ||
<%= @job_application.application_data["further_instructions"] %> | ||
<% end %> | ||
|
||
# <%= t(".more_info.heading") %> | ||
<%= t(".more_info.description", email: notify_mail_to(@contact_email)) %> | ||
<%= t(".search.intro") %> | ||
<%= notify_link(root_url, t(".search.link_text")) %> |
15 changes: 15 additions & 0 deletions
15
app/views/jobseekers/job_application_mailer/application_unsuccessful.text.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<%= t(".intro", job_title: @vacancy.job_title, organisation_name: @organisation_name) %> | ||
|
||
# <%= t(".heading") %> | ||
<%- if @job_application.application_data["rejection_reasons"].present? %> | ||
# <%= t(".feedback") %> | ||
<%= @job_application.application_data["rejection_reasons"] %> | ||
<% end %> | ||
|
||
# <%= t(".more_info.heading") %> | ||
<%= t(".more_info.description", email: notify_mail_to(@contact_email)) %> | ||
<%= t(".search.intro") %> | ||
<%= notify_link(root_url, t(".search.link_text")) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app/views/publishers/vacancies/job_applications/reject.html.slim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
- content_for :page_title_prefix, t(".page_title") | ||
|
||
.govuk-grid-row | ||
.govuk-grid-column-two-thirds | ||
h2.govuk-heading-m class="govuk-!-margin-bottom-0" | ||
= "#{job_application.application_data['first_name']} #{job_application.application_data['last_name']}" | ||
.govuk-caption-l | ||
= t("jobseekers.job_applications.heading_component.caption", | ||
job_title: vacancy.job_title, organisation_name: vacancy.parent_organisation_name) | ||
|
||
h1.govuk-heading-xl class="govuk-!-margin-top-5 govuk-!-margin-bottom-5" = t(".heading") | ||
|
||
= render Shared::NotificationComponent.new style: "danger", content: t(".alert"), alert: "info", dismiss: false | ||
|
||
= form_for form, url: organisation_job_job_application_update_status_path(vacancy.id, job_application.id) do |f| | ||
= f.govuk_text_area :rejection_reasons, label: { size: "s" }, rows: 10, form_group: { classes: "optional-field" } | ||
= f.govuk_submit t("buttons.reject") | ||
|
||
= govuk_link_to t("buttons.cancel"), organisation_job_job_application_path(vacancy.id, job_application.id) |
19 changes: 19 additions & 0 deletions
19
app/views/publishers/vacancies/job_applications/shortlist.html.slim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
- content_for :page_title_prefix, t(".page_title") | ||
|
||
.govuk-grid-row | ||
.govuk-grid-column-two-thirds | ||
h2.govuk-heading-m class="govuk-!-margin-bottom-0" | ||
= "#{job_application.application_data['first_name']} #{job_application.application_data['last_name']}" | ||
.govuk-caption-l | ||
= t("jobseekers.job_applications.heading_component.caption", | ||
job_title: vacancy.job_title, organisation_name: vacancy.parent_organisation_name) | ||
|
||
h1.govuk-heading-xl class="govuk-!-margin-top-5 govuk-!-margin-bottom-5" = t(".heading") | ||
|
||
= render Shared::NotificationComponent.new style: "danger", content: t(".alert"), alert: "info", dismiss: false | ||
|
||
= form_for form, url: organisation_job_job_application_update_status_path(vacancy.id, job_application.id) do |f| | ||
= f.govuk_text_area :further_instructions, label: { size: "s" }, rows: 10, form_group: { classes: "optional-field" } | ||
= f.govuk_submit t("buttons.shortlist") | ||
|
||
= govuk_link_to t("buttons.cancel"), organisation_job_job_application_path(vacancy.id, job_application.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.