Skip to content

Commit

Permalink
job_seekers_views: add a button to create a job seeker without applying
Browse files Browse the repository at this point in the history
  • Loading branch information
EwenKorr committed Jan 28, 2025
1 parent b9d101d commit b2f411a
Show file tree
Hide file tree
Showing 4 changed files with 380 additions and 12 deletions.
6 changes: 6 additions & 0 deletions itou/templates/job_seekers_views/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
{% load static %}
{% load str_filters %}
{% load format_filters %}
{% load url_add_query %}

{% block title %}Candidats {{ block.super }}{% endblock %}

{% block title_content %}
<div class="d-flex flex-column flex-md-row gap-3 justify-content-md-between">
<h1 class="m-0">Candidats</h1>
<div class="d-flex flex-column flex-md-row gap-3" role="group" aria-label="Actions sur les candidatures">
{% url "job_seekers_views:get_or_create_start" as get_or_create_url %}
<a href="{% url_add_query get_or_create_url tunnel='standalone' from_url=request.path|urlencode %}" class="btn btn-lg btn-secondary btn-ico">
<i class="ri-user-add-line fw-medium" aria-hidden="true"></i>
<span>Créer un compte candidat</span>
</a>
<a href="{% url 'search:employers_results' %}" class="btn btn-lg btn-primary btn-ico">
<i class="ri-draft-line fw-medium" aria-hidden="true"></i>
<span>Postuler pour un candidat</span>
Expand Down
10 changes: 2 additions & 8 deletions itou/www/job_seekers_views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from itou.utils.emails import redact_email_address
from itou.utils.pagination import ItouPaginator
from itou.utils.session import SessionNamespace
from itou.utils.urls import add_url_params, get_safe_url
from itou.utils.urls import get_safe_url
from itou.www.apply.views.submit_views import ApplicationBaseView
from itou.www.job_seekers_views.enums import JobSeekerSessionKinds
from itou.www.job_seekers_views.forms import (
Expand Down Expand Up @@ -309,14 +309,8 @@ def setup(self, request, *args, hire_process=False, **kwargs):
def get_exit_url(self, job_seeker_public_id, created=False):
if self.is_gps:
return reverse("gps:my_groups")
if self.standalone_creation and created:
if self.standalone_creation:
return reverse("job_seekers_views:details", kwargs={"public_id": job_seeker_public_id})
elif self.standalone_creation:
# Already existing job seeker, apply for them
job_seeker = User.objects.filter(kind=UserKind.JOB_SEEKER, public_id=job_seeker_public_id).first()
return add_url_params(
reverse("search:employers_results"), {"job_seeker": job_seeker_public_id, "city": job_seeker.city_slug}
)

kwargs = {"company_pk": self.company.pk, "job_seeker_public_id": job_seeker_public_id}
if created and self.hire_process:
Expand Down
5 changes: 5 additions & 0 deletions tests/www/job_seekers_views/__snapshots__/test_list.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
<div class="d-flex flex-column flex-md-row gap-3 justify-content-md-between">
<h1 class="m-0">Candidats</h1>
<div aria-label="Actions sur les candidatures" class="d-flex flex-column flex-md-row gap-3" role="group">

<a class="btn btn-lg btn-secondary btn-ico" href="/job-seekers/start?tunnel=standalone&amp;from_url=/job-seekers/list">
<i aria-hidden="true" class="ri-user-add-line fw-medium"></i>
<span>Créer un compte candidat</span>
</a>
<a class="btn btn-lg btn-primary btn-ico" href="/search/employers/results">
<i aria-hidden="true" class="ri-draft-line fw-medium"></i>
<span>Postuler pour un candidat</span>
Expand Down
Loading

0 comments on commit b2f411a

Please sign in to comment.