Skip to content

Commit

Permalink
companies: add button to other jobs in job description card
Browse files Browse the repository at this point in the history
  • Loading branch information
xavfernandez committed Jul 16, 2024
1 parent a781958 commit 3ecb4f0
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 3 deletions.
10 changes: 9 additions & 1 deletion itou/templates/companies/job_description_card.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ <h2 class="visually-hidden">Actions rapides</h2>
</a>
</div>
{% endif %}
{% if others_active_jobs and not siae.block_job_applications %}
<div class="form-group col col-lg-auto">
<a href="#recrutements" class="btn btn-lg btn-outline-white btn-block btn-ico">
<i class="ri-eye-line font-weight-medium" aria-hidden="true"></i>
<span>Voir tous les métiers</span>
</a>
</div>
{% endif %}
<div class="form-group col-12 col-lg d-flex justify-content-center justify-content-lg-end">
<button class="btn btn-lg btn-ico btn-link-white" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Ouverture et fermeture du menu des actions complémentaires">
<i class="ri-more-2-line ri-lg font-weight-normal" aria-hidden="true"></i>
Expand Down Expand Up @@ -91,7 +99,7 @@ <h2 class="visually-hidden">Actions rapides</h2>
</section>

{% if others_active_jobs and not siae.block_job_applications %}
<section class="s-tabs-01 mt-0 pt-0">
<section id="recrutements" class="s-tabs-01 mt-0 pt-0">
<div class="s-tabs-01__container container">
<div class="s-tabs-01__row row">
<div class="s-tabs-01__col col-12">
Expand Down
52 changes: 51 additions & 1 deletion tests/www/companies_views/__snapshots__/test_card_views.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@
</a>
</div>


<div class="form-group col-12 col-lg d-flex justify-content-center justify-content-lg-end">
<button aria-expanded="false" aria-label="Ouverture et fermeture du menu des actions complémentaires" class="btn btn-lg btn-ico btn-link-white" data-bs-toggle="dropdown">
<i aria-hidden="true" class="ri-more-2-line ri-lg font-weight-normal"></i>
Expand All @@ -562,7 +563,55 @@
</div>
'''
# ---
# name: JobDescriptionCardViewTest.test_card_tally_url_with_user
# name: JobDescriptionCardViewTest.test_card_tally_url_with_user[with_other_jobs]
'''
<div class="c-box c-box--action">
<h2 class="visually-hidden">Actions rapides</h2>
<div class="form-row align-items-center gx-3">


<div class="form-group col col-lg-auto">
<a aria-label="Postuler auprès de l'employeur inclusif Acme inc." class="btn btn-lg btn-white btn-block btn-ico" data-matomo-action="clic" data-matomo-category="candidature" data-matomo-event="true" data-matomo-option="start_application" href="/apply/100/start?job_description_id=42">
<i aria-hidden="true" class="ri-draft-line font-weight-medium"></i>
<span>Postuler</span>
</a>
</div>


<div class="form-group col col-lg-auto">
<a class="btn btn-lg btn-outline-white btn-block btn-ico" href="#recrutements">
<i aria-hidden="true" class="ri-eye-line font-weight-medium"></i>
<span>Voir tous les métiers</span>
</a>
</div>

<div class="form-group col-12 col-lg d-flex justify-content-center justify-content-lg-end">
<button aria-expanded="false" aria-label="Ouverture et fermeture du menu des actions complémentaires" class="btn btn-lg btn-ico btn-link-white" data-bs-toggle="dropdown">
<i aria-hidden="true" class="ri-more-2-line ri-lg font-weight-normal"></i>
<span class="d-lg-none">Autres actions</span>
</button>
<ul class="dropdown-menu">
<li>
<button class="dropdown-item btn-ico btn-link" data-bs-placement="top" data-bs-title="Copié !" data-bs-toggle="tooltip" data-bs-trigger="manual" data-it-clipboard-button="copy" data-it-copy-to-clipboard="http://localhost:8000/company/job_description/42/card">
<i aria-hidden="true" class="ri-file-copy-line ri-lg font-weight-normal"></i>
<span>Copier le lien de cette fiche de poste</span>
</button>

</li>
<li>
<a class="dropdown-item btn-ico btn-link" href="https://tally.so/r/m62GYo?companyID=100&amp;UserID=10&amp;jobdescriptionID=42" rel="noopener" target="_blank">
<i aria-hidden="true" class="ri-notification-4-line ri-lg font-weight-normal"></i>
<span>Signaler cette fiche de poste</span>
</a>
</li>
</ul>
</div>

</div>
</div>
'''
# ---
# name: JobDescriptionCardViewTest.test_card_tally_url_with_user[without_other_jobs]
'''
<div class="c-box c-box--action">
<h2 class="visually-hidden">Actions rapides</h2>
Expand All @@ -576,6 +625,7 @@
</a>
</div>


<div class="form-group col-12 col-lg d-flex justify-content-center justify-content-lg-end">
<button aria-expanded="false" aria-label="Ouverture et fermeture du menu des actions complémentaires" class="btn btn-lg btn-ico btn-link-white" data-bs-toggle="dropdown">
<i aria-hidden="true" class="ri-more-2-line ri-lg font-weight-normal"></i>
Expand Down
9 changes: 8 additions & 1 deletion tests/www/companies_views/test_card_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,14 @@ def test_card_tally_url_with_user(self):
self.client.force_login(JobSeekerFactory(pk=10))
response = self.client.get(url)
soup = parse_response_to_soup(response, selector=".c-box--action")
assert str(soup) == self.snapshot()
assert str(soup) == self.snapshot(name="without_other_jobs")
# Create other job_description
JobDescriptionFactory(company=job_description.company)
response = self.client.get(url)
soup = parse_response_to_soup(response, selector=".c-box--action")
assert str(soup) == self.snapshot(name="with_other_jobs")
# Check link consistency
assert parse_response_to_soup(response, selector="#recrutements")

def test_card_tally_url_no_user(self):
job_description = JobDescriptionFactory(
Expand Down

0 comments on commit 3ecb4f0

Please sign in to comment.