Skip to content

Commit

Permalink
job_seeker_views: split route to fix nav-tab
Browse files Browse the repository at this point in the history
  • Loading branch information
dejafait committed Dec 26, 2024
1 parent aada9f1 commit 292920f
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 585 deletions.
25 changes: 2 additions & 23 deletions itou/templates/job_seekers_views/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,14 @@ <h1 class="mb-0">Candidat : {{ job_seeker.get_full_name|mask_unless:can_view_pe
<ul class="s-tabs-01__nav nav nav-tabs mb-0" role="tablist" data-it-sliding-tabs="true">
<li class="nav-item" role="presentation">
<a class="nav-link active"
id="informations-tab"
data-bs-toggle="tab"
href="#informations"
role="tab"
href="{% url 'job_seekers_views:details' public_id=job_seeker.public_id %}?back_url={% url 'job_seekers_views:list' %}"
aria-controls="informations"
aria-selected="true"
{% matomo_event "candidat" "clic-onglet" "informations candidat" %}>Informations générales</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link"
id="job-applications-tab"
data-bs-toggle="tab"
href="#candidatures"
role="tab"
href="{% url 'job_seekers_views:job_applications' public_id=job_seeker.public_id %}?back_url={% url 'job_seekers_views:list' %}"
aria-controls="candidatures"
aria-selected="false"
{% matomo_event "candidat" "clic-onglet" "candidatures" %}>Candidatures</a>
Expand Down Expand Up @@ -80,21 +74,6 @@ <h2>Informations</h2>
{% endif %}
</div>
</div>
<div class="tab-pane fade" id="candidatures" role="tabpanel" aria-labelledby="job-applications-tab">
<h2>Candidatures envoyées</h2>
<hr>
{% matomo_event "candidat" "clic" "detail-candidature" as matomo_event_attrs %}
{% for job_application in sent_job_applications %}
{% url 'apply:details_for_prescriber' job_application_id=job_application.id as detail_url %}
{% include "apply/includes/job_application_box_for_user.html" with job_application=job_application detail_url=detail_url matomo_event_attrs=matomo_event_attrs %}
{% empty %}
<div class="c-box c-box--results my-3 my-md-4">
<div class="c-box--results__body">
<p class="mb-0">Aucune candidature envoyée.</p>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
Expand Down
81 changes: 81 additions & 0 deletions itou/templates/job_seekers_views/job_applications.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{% extends "layout/base.html" %}
{% load matomo %}
{% load static %}
{% load str_filters %}
{% load format_filters %}
{% load url_add_query %}

{% block title %}
Profil de {{ job_seeker.get_full_name|mask_unless:can_view_personal_information }} {{ block.super }}
{% endblock %}

{% block title_content %}
<div class="d-flex flex-column flex-md-row gap-3 mb-3 justify-content-md-between">
<h1 class="mb-0">Candidat : {{ job_seeker.get_full_name|mask_unless:can_view_personal_information }}</h1>
{% url 'search:employers_results' as search_url %}
{% if can_view_personal_information %}
{% url_add_query search_url job_seeker=job_seeker.public_id city=job_seeker.city_slug as url_query %}
{% else %}
{% url_add_query search_url job_seeker=job_seeker.public_id as url_query %}
{% endif %}
<a href="{{ url_query }}" {% matomo_event "candidature" "clic" "postuler-pour-ce-candidat" %} class="btn btn-lg btn-primary btn-ico">
<i class="ri-draft-line fw-medium" aria-hidden="true"></i>
<span>Postuler pour ce candidat</span>
</a>
</div>
{% endblock %}

{% block title_extra %}
<ul class="s-tabs-01__nav nav nav-tabs mb-0" role="tablist" data-it-sliding-tabs="true">
<li class="nav-item" role="presentation">
<a class="nav-link"
href="{% url 'job_seekers_views:details' public_id=job_seeker.public_id %}?back_url={% url 'job_seekers_views:list' %}"
aria-controls="informations"
aria-selected="true"
{% matomo_event "candidat" "clic-onglet" "informations candidat" %}>Informations générales</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link active"
href="{% url 'job_seekers_views:job_applications' public_id=job_seeker.public_id %}?back_url={% url 'job_seekers_views:list' %}"
aria-controls="candidatures"
aria-selected="false"
{% matomo_event "candidat" "clic-onglet" "candidatures" %}>Candidatures</a>
</li>
</ul>
{% 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="s-section__row row">
<div class="s-section__col col-12">
<div class="tab-content">
<div class="tab-pane fade show active" id="candidatures" role="tabpanel" aria-labelledby="job-applications-tab">
<h2>Candidatures envoyées</h2>
<hr>
{% matomo_event "candidat" "clic" "detail-candidature" as matomo_event_attrs %}
{% for job_application in sent_job_applications %}
{% url 'apply:details_for_prescriber' job_application_id=job_application.id as detail_url %}
{% include "apply/includes/job_application_box_for_user.html" with job_application=job_application detail_url=detail_url matomo_event_attrs=matomo_event_attrs %}
{% empty %}
<div class="c-box c-box--results my-3 my-md-4">
<div class="c-box--results__body">
<p class="mb-0">Aucune candidature envoyée.</p>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</section>
{% endblock %}

{% block script %}
{{ block.super }}
<script src="{% static 'js/sliding_tabs.js'%}"></script>
{% endblock %}
11 changes: 10 additions & 1 deletion itou/www/job_seekers_views/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@
app_name = "job_seekers_views"

urlpatterns = [
path("details/<uuid:public_id>", views.JobSeekerDetailView.as_view(), name="details"),
path(
"details/<uuid:public_id>",
views.JobSeekerDetailView.as_view(template_name="job_seekers_views/details.html"),
name="details",
),
path(
"job_applications/<uuid:public_id>",
views.JobSeekerDetailView.as_view(template_name="job_seekers_views/job_applications.html"),
name="job_applications",
),
path("list", views.JobSeekerListView.as_view(), name="list"),
# For sender
path("<uuid:session_uuid>/sender/check-nir", views.CheckNIRForSenderView.as_view(), name="check_nir_for_sender"),
Expand Down
1 change: 0 additions & 1 deletion itou/www/job_seekers_views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
class JobSeekerDetailView(LoginRequiredMixin, UserPassesTestMixin, DetailView):
model = User
queryset = User.objects.select_related("jobseeker_profile")
template_name = "job_seekers_views/details.html"
slug_field = "public_id"
slug_url_kwarg = "public_id"
context_object_name = "job_seeker"
Expand Down
Loading

0 comments on commit 292920f

Please sign in to comment.