Skip to content

Commit

Permalink
job_seekers_views: Use partial for nav-tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
dejafait committed Jan 13, 2025
1 parent 33c8e8a commit da2b23f
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 120 deletions.
17 changes: 1 addition & 16 deletions itou/templates/job_seekers_views/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,7 @@ <h1 class="mb-0">Candidat : {{ job_seeker.get_full_name|mask_unless:can_view_pe
{% 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 active"
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"
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>
{% include "job_seekers_views/includes/nav_tabs.html" with job_seeker=job_seeker active_nav_tab="informations" only %}
{% endblock %}
{% block title_prevstep %}
{% include "layout/previous_step.html" with back_url=back_url only %}
Expand Down
18 changes: 18 additions & 0 deletions itou/templates/job_seekers_views/includes/nav_tabs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% load matomo %}

<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{% if active_nav_tab == "informations" %} active{% endif %}"
href="{% url 'job_seekers_views:details' public_id=job_seeker.public_id %}?back_url={% url 'job_seekers_views:list' %}"
aria-controls="informations"
aria-selected="{% if active_nav_tab == "informations" %}true{% else %}false{% endif %}"
{% matomo_event "candidat" "clic-onglet" "informations candidat" %}>Informations générales</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link{% if active_nav_tab == "candidatures" %} active{% endif %}"
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="{% if active_nav_tab == "candidatures" %}true{% else %}false{% endif %}"
{% matomo_event "candidat" "clic-onglet" "candidatures" %}>Candidatures</a>
</li>
</ul>
17 changes: 1 addition & 16 deletions itou/templates/job_seekers_views/job_applications.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,7 @@ <h1 class="mb-0">Candidat : {{ job_seeker.get_full_name|mask_unless:can_view_pe
{% 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="false"
{% 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="true"
{% matomo_event "candidat" "clic-onglet" "candidatures" %}>Candidatures</a>
</li>
</ul>
{% include "job_seekers_views/includes/nav_tabs.html" with job_seeker=job_seeker active_nav_tab="candidatures" only %}
{% endblock %}
{% block title_prevstep %}
{% include "layout/previous_step.html" with back_url=back_url only %}
Expand Down
Loading

0 comments on commit da2b23f

Please sign in to comment.