Skip to content

Commit

Permalink
refuse: adapt template for multiple applications & jobseekers
Browse files Browse the repository at this point in the history
  • Loading branch information
xavfernandez committed Jan 15, 2025
1 parent c06376c commit 9bbcbe6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
34 changes: 25 additions & 9 deletions itou/templates/apply/process_refuse.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,23 @@
{% load buttons_form %}

{% block title %}
Décliner la candidature de {{ job_application.job_seeker.get_full_name }}
{% if job_applications|length == 1 %}
Décliner la candidature de {{ job_applications.0.job_seeker.get_full_name }}
{% else %}
Décliner {{ job_applications|length }} candidature{{ job_applications|pluralizefr }}
{% endif %}
{{ block.super }}
{% endblock %}

{% block title_content %}
<div class="d-md-flex align-items-center mb-3">
<h1 class="mb-1 mb-md-0 me-3">Décliner la candidature de {{ job_application.job_seeker.get_full_name }}</h1>
<h1 class="mb-1 mb-md-0 me-3">
{% if job_applications|length == 1 %}
Décliner la candidature de {{ job_applications.0.job_seeker.get_full_name }}
{% else %}
Décliner {{ job_applications|length }} candidature{{ job_applications|pluralizefr }}
{% endif %}
</h1>
</div>
{% endblock %}

Expand All @@ -28,7 +38,7 @@ <h1 class="mb-1 mb-md-0 me-3">Décliner la candidature de {{ job_application.job
{% if wizard.steps.current == RefuseViewStep.REASON %}
<strong>Étape {{ wizard.steps.step1 }}</strong>/{{ wizard.steps.count }} : Choix du motif de refus
{% elif wizard.steps.current == RefuseViewStep.JOB_SEEKER_ANSWER %}
<strong>Étape {{ wizard.steps.step1 }}</strong>/{{ wizard.steps.count }} : Message au candidat
<strong>Étape {{ wizard.steps.step1 }}</strong>/{{ wizard.steps.count }} : Message {{ job_seeker_nb|pluralizefr:"au candidat,aux candidats" }}
{% elif wizard.steps.current == RefuseViewStep.PRESCRIBER_ANSWER %}
<strong>Étape {{ wizard.steps.step1 }}</strong>/{{ wizard.steps.count }} : Message {{ to_prescriber }}
{% endif %}
Expand All @@ -43,13 +53,13 @@ <h1 class="mb-1 mb-md-0 me-3">Décliner la candidature de {{ job_application.job
<h2 class="mb-3 mb-md-4">Choix du motif de refus</h2>
<p class="mb-3 mb-md-4">
{% if with_prescriber %}
Dans le cadre d’un parcours IAE, la transparence sur les motifs de refus est importante pour le candidat comme pour {{ the_prescriber }}. Nous vous encourageons à répondre à chacune des parties.
Dans le cadre d’un parcours IAE, la transparence sur les motifs de refus est importante pour {{ job_seeker_nb|pluralizefr:"le candidat,les candidats" }} comme pour {{ the_prescriber }}. Nous vous encourageons à répondre à chacune des parties.
{% else %}
Dans le cadre d’un parcours IAE, la transparence sur les motifs de refus est importante pour le candidat.
Dans le cadre d’un parcours IAE, la transparence sur les motifs de refus est importante pour {{ job_seeker_nb|pluralizefr:"le candidat,les candidats" }}.
{% endif %}
</p>
{% elif wizard.steps.current == RefuseViewStep.JOB_SEEKER_ANSWER %}
<h2 class="mb-3 mb-md-4">Réponse au candidat</h2>
<h2 class="mb-3 mb-md-4">Réponse {{ job_seeker_nb|pluralizefr:"au candidat,aux candidats" }}</h2>
<p class="mb-3 mb-md-4">
{% if with_prescriber %}
Une copie de ce message sera adressée {{ to_prescriber }}.
Expand All @@ -60,7 +70,9 @@ <h2 class="mb-3 mb-md-4">Réponse au candidat</h2>
<p class="mb-3 mb-md-4">
<strong>Motif de refus :</strong>
{{ refusal_reason_label }}
{% if not refusal_reason_shared_with_job_seeker %}<em>(Motif non communiqué au candidat)</em>{% endif %}
{% if not refusal_reason_shared_with_job_seeker %}
<em>(Motif non communiqué {{ job_seeker_nb|pluralizefr:"au candidat,aux candidats" }})</em>
{% endif %}
</p>
{% elif wizard.steps.current == RefuseViewStep.PRESCRIBER_ANSWER %}
<h2 class="mb-3 mb-md-4">Réponse {{ to_prescriber }}</h2>
Expand All @@ -70,7 +82,9 @@ <h2 class="mb-3 mb-md-4">Réponse {{ to_prescriber }}</h2>
<p class="mb-3 mb-md-4">
<strong>Motif de refus :</strong>
{{ refusal_reason_label }}
{% if not refusal_reason_shared_with_job_seeker %}<em>(Motif non communiqué au candidat)</em>{% endif %}
{% if not refusal_reason_shared_with_job_seeker %}
<em>(Motif non communiqué {{ job_seeker_nb|pluralizefr:"au candidat,aux candidats" }})</em>
{% endif %}
</p>
{% endif %}

Expand Down Expand Up @@ -118,7 +132,9 @@ <h2 class="mb-3 mb-md-4">Réponse {{ to_prescriber }}</h2>
</fieldset>
<fieldset>
<div class="form-group">
<legend class="fs-base fw-bold">Partager ce motif de refus au candidat ?</legend>
<legend class="fs-base fw-bold">
Partager ce motif de refus {{ job_seeker_nb|pluralizefr:"au candidat,aux candidats" }} ?
</legend>
{% bootstrap_field form.refusal_reason_shared_with_job_seeker %}
</div>
</fieldset>
Expand Down
3 changes: 2 additions & 1 deletion itou/www/apply/views/process_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def get_context_data(self, **kwargs):
).label
context["refusal_reason_shared_with_job_seeker"] = cleaned_data["refusal_reason_shared_with_job_seeker"]
return context | {
"job_application": self.job_application,
"job_applications": [self.job_application],
"can_view_personal_information": True, # SIAE members have access to personal info
"matomo_custom_title": "Candidature refusée",
"matomo_event_name": f"refuse-application-{self.steps.current}-submit",
Expand All @@ -490,6 +490,7 @@ def get_context_data(self, **kwargs):
"le prescripteur" if self.job_application.is_sent_by_authorized_prescriber else "l’orienteur"
),
"with_prescriber": self.job_application.sender_kind == job_applications_enums.SenderKind.PRESCRIBER,
"job_seeker_nb": 1,
}

def get_form_kwargs(self, step=None):
Expand Down

0 comments on commit 9bbcbe6

Please sign in to comment.