-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
02af778
commit c549ed5
Showing
9 changed files
with
183 additions
and
20 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
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
20 changes: 20 additions & 0 deletions
20
itou/templates/apply/includes/geiq/geiq_diagnosis_allowance_alert.html
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,20 @@ | ||
<div class="alert alert-info" role="status"> | ||
<div class="row"> | ||
<div class="col-auto pe-0"> | ||
<i class="ri-information-line ri-xl text-info"></i> | ||
</div> | ||
<div class="col"> | ||
<p> | ||
<b>Aide à l'accompagement GEIQ</b> | ||
</p> | ||
<p> | ||
{% if diagnosis.author_prescriber_organization %} | ||
Ce diagnostic émis par un prescripteur habilité vous donnera droit en cas d’embauche, | ||
{% else %} | ||
Les critères que vous avez sélectionnés vous donnent droit en cas d’embauche, | ||
{% endif %} | ||
à une aide financière de l’État s’élevant à <b>{{ diagnosis.allowance_amount }} €</b> (sous réserve de la contractualisation initialement prévue et de l’enveloppe disponible). | ||
</p> | ||
</div> | ||
</div> | ||
</div> |
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,38 @@ | ||
{% extends "layout/base.html" %} | ||
{% load matomo %} | ||
{% load str_filters %} | ||
{% load format_filters %} | ||
|
||
{% block title %}Profil de {{ job_seeker.get_full_name }} {{ block.super }}{% endblock %} | ||
|
||
{% block title_content %}<h1>{{ job_seeker.get_full_name }}</h1>{% endblock %} | ||
|
||
{% block title_prevstep %} | ||
{% include "layout/previous_step.html" with back_url=back_url only %} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<section class="s-section"> | ||
<div class="s-section__container container"> | ||
<div class="row"> | ||
<div class="col-12 {% if approval %}col-lg-8 order-2 order-lg-1{% endif %}"> | ||
<h2>Informations</h2> | ||
<div class="c-box mb-3 mb-lg-5"> | ||
{% include "apply/includes/job_seeker_info.html" with job_seeker=job_seeker job_application=None with_matomo_event=True can_view_personal_information=can_view_personal_information can_edit_personal_information=can_edit_personal_information request=request csrf_token=csrf_token SenderKind=SenderKind only %} | ||
</div> | ||
{% if iae_eligibility_diagnosis %} | ||
{% include "job_seekers_views/includes/eligibility_diagnosis.html" with eligibility_diagnosis=iae_eligibility_diagnosis kind="IAE" only %} | ||
{% endif %} | ||
{% if geiq_eligibility_diagnosis %} | ||
{% include "job_seekers_views/includes/eligibility_diagnosis.html" with eligibility_diagnosis=geiq_eligibility_diagnosis kind="GEIQ" with_details=request.user.is_employer only %} | ||
{% endif %} | ||
</div> | ||
{% if approval %} | ||
<div class="col-12 col-lg-4 order-1 order-lg-2 mt-lg-6"> | ||
{% include "approvals/includes/box.html" with approval=approval only %} | ||
</div> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</section> | ||
{% endblock %} |
56 changes: 56 additions & 0 deletions
56
itou/templates/job_seekers_views/includes/eligibility_diagnosis.html
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,56 @@ | ||
|
||
<div class="c-box mb-3 mb-lg-5"> | ||
<div class="d-flex justify-content-between"> | ||
<div class="mb-3"> | ||
{% if kind == "IAE" %} | ||
<h3 class="mb-0">Diagnostic IAE</h3> | ||
{% else %} | ||
<h3 class="mb-0">Diagnostic public prioritaire GEIQ</h3> | ||
{% endif %} | ||
<span class="text-success">Valide du {{ eligibility_diagnosis.created_at|date:"d/m/Y" }} au {{ eligibility_diagnosis.expires_at|date:"d/m/Y" }}</span> | ||
</div> | ||
<div> | ||
<span class="badge badge-base rounded-pill bg-success-lighter text-success"> | ||
<i class="ri-check-line" aria-hidden="true"></i> | ||
{% if kind == "IAE" %} | ||
Éligible à l’IAE | ||
{% else %} | ||
Éligible public prioritaire GEIQ | ||
{% endif %} | ||
</span> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-6"> | ||
<p> | ||
<small>Confirmé par</small> | ||
<br> | ||
<strong>{{ eligibility_diagnosis.author.get_full_name }} | ||
{% if eligibility_diagnosis.author_siae %}({{ eligibility_diagnosis.author_siae.display_name }}){% endif %} | ||
{% if eligibility_diagnosis.author_prescriber_organization %} | ||
({{ eligibility_diagnosis.author_prescriber_organization.display_name }}) | ||
{% endif %} | ||
</strong> | ||
</p> | ||
<p> | ||
<small>Type</small> | ||
<br> | ||
<strong>{{ eligibility_diagnosis.get_author_kind_display }}</strong> | ||
</p> | ||
</div> | ||
<div class="col-6"> | ||
<small>Critère administratifs selectionés</small> | ||
<br> | ||
{# Keep ordering from manager (level then ui_rank) #} | ||
{% for criteria in eligibility_diagnosis.administrative_criteria.all %} | ||
<strong>{{ criteria.name }}</strong> | ||
<br> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
{% if kind == "GEIQ" %} | ||
{% if with_details %} | ||
{% include "apply/includes/geiq/geiq_diagnosis_allowance_alert.html" with diagnosis=eligibility_diagnosis only %} | ||
{% endif %} | ||
{% endif %} | ||
</div> |
Empty file.
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,10 @@ | ||
from django.urls import path | ||
|
||
from . import views | ||
|
||
|
||
app_name = "job_seekers_views" | ||
|
||
urlpatterns = [ | ||
path("details/<uuid:public_id>", views.JobSeekerDetailView.as_view(), name="details"), | ||
] |
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,48 @@ | ||
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin | ||
from django.views.generic import DetailView | ||
|
||
from itou.companies.enums import CompanyKind | ||
from itou.eligibility.models.geiq import GEIQEligibilityDiagnosis | ||
from itou.eligibility.models.iae import EligibilityDiagnosis | ||
from itou.users.models import User | ||
|
||
|
||
class JobSeekerDetailView(LoginRequiredMixin, UserPassesTestMixin, DetailView): | ||
model = User | ||
queryset = User.objects.select_related("jobseeker_profile").prefetch_related() | ||
template_name = "job_seekers_views/details.html" | ||
slug_field = "public_id" | ||
slug_url_kwarg = "public_id" | ||
context_object_name = "job_seeker" | ||
|
||
def test_func(self): | ||
return self.request.user.is_authenticated and self.request.user.can_view_personal_information( | ||
self.get_object() | ||
) | ||
|
||
def get_context_data(self, **kwargs): | ||
geiq_eligibility_diagnosis = None | ||
if self.request.user.is_prescriber or self.request.current_organization.kind == CompanyKind.GEIQ: | ||
geiq_eligibility_diagnosis = GEIQEligibilityDiagnosis.objects.valid_diagnoses_for( | ||
self.object, | ||
for_geiq=self.request.current_organization if self.request.user.is_employer else None, | ||
).first() | ||
|
||
approval = None | ||
iae_eligibility_diagnosis = None | ||
if self.request.user.is_prescriber or self.request.current_organization.is_subject_to_eligibility_rules: | ||
approval = self.object.approvals.valid().first() | ||
iae_eligibility_diagnosis = EligibilityDiagnosis.objects.last_considered_valid( | ||
self.object, | ||
for_siae=self.request.current_organization if self.request.user.is_employer else None, | ||
) | ||
|
||
return super().get_context_data(**kwargs) | { | ||
"geiq_eligibility_diagnosis": geiq_eligibility_diagnosis, | ||
"iae_eligibility_diagnosis": iae_eligibility_diagnosis, | ||
"matomo_custom_title": "Détail candidat", | ||
"approval": approval, | ||
# already checked in test_func because the user name is displayed in the title | ||
"can_view_personal_information": True, | ||
"can_edit_personal_information": self.request.user.can_edit_personal_information(self.object), | ||
} |