diff --git a/itou/templates/apply/process_refuse.html b/itou/templates/apply/process_refuse.html
index 3e82bc37d8..f15fcd339e 100644
--- a/itou/templates/apply/process_refuse.html
+++ b/itou/templates/apply/process_refuse.html
@@ -161,6 +161,12 @@
$('input[name="reason-refusal_reason"]').change(function() {
manageWarningSection(this.value);
});
+
+ // Batch mode field names
+ manageWarningSection($('input[name="refusal_reason"]:checked').val());
+ $('input[name="refusal_reason"]').change(function() {
+ manageWarningSection(this.value);
+ });
});
{% endif %}
diff --git a/itou/www/apply/views/batch_views.py b/itou/www/apply/views/batch_views.py
index 0c5376cee8..b58b034a79 100644
--- a/itou/www/apply/views/batch_views.py
+++ b/itou/www/apply/views/batch_views.py
@@ -14,6 +14,7 @@
from django_xworkflows import models as xwf_models
from itou.companies.models import Company
+from itou.job_applications import enums as job_applications_enums
from itou.job_applications.models import JobApplication
from itou.utils.auth import check_user
from itou.utils.perms.company import get_current_company_or_404
@@ -274,7 +275,7 @@ def get_form(self):
def get_context_data(self, **kwargs):
# TODO: provide more info to template to show correct wording
- return super().get_context_data(**kwargs) | {
+ context = super().get_context_data(**kwargs) | {
"job_applications": self.applications,
"can_view_personal_information": True, # SIAE members have access to personal info
"matomo_custom_title": "Candidature refusée",
@@ -282,7 +283,16 @@ def get_context_data(self, **kwargs):
"wizard": {"steps": self.steps_info, "form": self.form},
"form": self.form,
"reset_url": self.reset_url,
+ "RefuseViewStep": RefuseViewStep,
}
+ if self.step != RefuseViewStep.REASON:
+ reason_data = self.wizard_session.get("data", {}).get(RefuseViewStep.REASON, {})
+
+ if refusal_reason := reason_data.get("refusal_reason"):
+ context["refusal_reason_label"] = job_applications_enums.RefusalReason(refusal_reason).label
+ context["refusal_reason_shared_with_job_seeker"] = reason_data.get("refusal_reason_shared_with_job_seeker")
+
+ return context
def post(self, request, *args, **kwargs):
if self.form.is_valid():