Skip to content

Commit

Permalink
fix: job description card
Browse files Browse the repository at this point in the history
  • Loading branch information
hellodeloo committed Apr 23, 2024
1 parent e36cce0 commit 0d21383
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 128 deletions.
58 changes: 24 additions & 34 deletions itou/templates/approvals/includes/job_description_creation.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,36 @@
{% if request.user == job_application.sender %}
<strong>Vous</strong>
{% elif job_application.sender_kind == SenderKind.JOB_SEEKER %}
<span class="text-nowrap">
<i class="ri-user-line me-1" aria-hidden="true"></i><strong>Le candidat lui-même</strong>
</span>
<i class="ri-user-line me-1" aria-hidden="true"></i><strong>Le candidat lui-même</strong>
{% elif job_application.sender_kind == SenderKind.EMPLOYER %}
<span class="text-nowrap">
<strong>{{ job_application.sender_company.display_name }}</strong>
{% if request.user.is_employer %}
{% if job_application.origin == JobApplicationOrigin.PE_APPROVAL %}
<i class="ri-community-line me-1" aria-hidden="true"></i>Employeur (Import agrément Pôle emploi)
{% else %}
<i class="ri-community-line me-1" aria-hidden="true"></i>Employeur (Auto-prescription)
{% endif %}
</span>
<strong>{{ job_application.sender_company.display_name }}</strong>
{% if request.user.is_employer %}
{% if job_application.origin == JobApplicationOrigin.PE_APPROVAL %}
<i class="ri-community-line me-1" aria-hidden="true"></i>Employeur (Import agrément Pôle emploi)
{% else %}
<i class="ri-community-line me-1" aria-hidden="true"></i>Employeur (Auto-prescription)
{% endif %}
{% elif request.user.is_job_seeker %}
<span class="text-nowrap">
<i class="ri-community-line me-1" aria-hidden="true"></i>Employeur
</span>
<i class="ri-community-line me-1" aria-hidden="true"></i>Employeur
{% endif %}
{% elif job_application.sender_kind == SenderKind.PRESCRIBER %}
<span class="text-nowrap">
{% if job_application.sender_prescriber_organization %}
<strong>{{ job_application.sender_prescriber_organization.display_name }}</strong>
{% else %}
<strong>{{ job_application.sender.get_full_name }}</strong>
{% endif %}
{% if job_application.is_sent_by_authorized_prescriber %}
<i class="ri-home-smile-2-line me-1" aria-hidden="true"></i>Prescripteur habilité
{% else %}
<i class="ri-home-smile-2-line me-1" aria-hidden="true"></i>Orienteur
{% endif %}
</span>
{% if job_application.sender_prescriber_organization %}
<strong>{{ job_application.sender_prescriber_organization.display_name }}</strong>
{% else %}
<strong>{{ job_application.sender.get_full_name }}</strong>
{% endif %}
{% if job_application.is_sent_by_authorized_prescriber %}
<i class="ri-home-smile-2-line me-1" aria-hidden="true"></i>Prescripteur habilité
{% else %}
<i class="ri-home-smile-2-line me-1" aria-hidden="true"></i>Orienteur
{% endif %}
{% endif %}
{% if request.user.is_prescriber %}
<span class="text-nowrap">
chez
<a href="{% url 'companies_views:card' siae_id=job_application.to_company.id %}" class="btn-ico btn-link">
<i class="ri-community-line font-weight-medium ri-sm me-1" aria-hidden="true"></i>
<span>{{ job_application.to_company.display_name }}</span>
</a>
</span>
chez
<a href="{% url 'companies_views:card' siae_id=job_application.to_company.id %}" class="btn-ico btn-link">
<i class="ri-community-line font-weight-medium ri-sm me-1" aria-hidden="true"></i>
<span>{{ job_application.to_company.display_name }}</span>
</a>
{% endif %}
</p>
<div>{% state_badge job_application %}</div>
Expand Down
12 changes: 6 additions & 6 deletions itou/templates/employee_record/includes/_status.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{% if employee_record.status == "SENT" %}
<span class="badge rounded-pill badge-sm bg-warning">
<span class="badge rounded-pill badge-sm text-nowrap bg-warning">
Transmise à l'ASP le {{ employee_record.updated_at|date:"SHORT_DATETIME_FORMAT" }}
</span>
{% elif employee_record.status == "REJECTED" %}
<span class="badge rounded-pill badge-sm bg-danger">
<span class="badge rounded-pill badge-sm text-nowrap bg-danger">
Retour en erreur le {{ employee_record.updated_at|date:"SHORT_DATETIME_FORMAT" }}
</span>
{% elif employee_record.status == "PROCESSED" %}
<span class="badge rounded-pill badge-sm bg-success">
<span class="badge rounded-pill badge-sm text-nowrap bg-success">
Intégrée par l'ASP le {{ employee_record.updated_at|date:"SHORT_DATETIME_FORMAT" }}
</span>
{% elif employee_record.status == "READY" %}
<span class="badge rounded-pill badge-sm bg-secondary">
<span class="badge rounded-pill badge-sm text-nowrap bg-secondary">
Complétée le {{ employee_record.updated_at|date:"SHORT_DATETIME_FORMAT" }}
</span>
{% elif employee_record.status == "DISABLED" %}
<span class="badge rounded-pill badge-sm bg-emploi-lightest text-primary">
<span class="badge rounded-pill badge-sm text-nowrap bg-emploi-lightest text-primary">
Désactivée le {{ employee_record.updated_at|date:"SHORT_DATETIME_FORMAT" }}
</span>
{% elif employee_record.status == "ARCHIVED" %}
<span class="badge rounded-pill badge-sm bg-emploi-lightest text-primary">
<span class="badge rounded-pill badge-sm text-nowrap bg-emploi-lightest text-primary">
Archivée le {{ employee_record.updated_at|date:"SHORT_DATETIME_FORMAT" }}
</span>
{% endif %}
2 changes: 1 addition & 1 deletion itou/utils/templatetags/job_applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def state_badge(job_application, *, hx_swap_oob=False, extra_class="badge-sm mb-
}[job_application.state]
attrs = [
f'id="state_{ job_application.pk }"',
f'class="badge rounded-pill text-wrap { extra_class } { state_classes }"',
f'class="badge rounded-pill text-nowrap { extra_class } { state_classes }"',
]
if hx_swap_oob:
attrs.append('hx-swap-oob="true"')
Expand Down
18 changes: 9 additions & 9 deletions tests/utils/__snapshots__/tests.ambr
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# serializer version: 1
# name: test_job_application_state_badge_oob_swap
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-wrap badge-sm mb-1 bg-info" hx-swap-oob="true">Nouvelle candidature</span>'
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-nowrap badge-sm mb-1 bg-info" hx-swap-oob="true">Nouvelle candidature</span>'
# ---
# name: test_job_application_state_badge_processing[accepted]
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-wrap badge-sm mb-1 bg-success">Candidature acceptée</span>'
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-nowrap badge-sm mb-1 bg-success">Candidature acceptée</span>'
# ---
# name: test_job_application_state_badge_processing[cancelled]
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-wrap badge-sm mb-1 bg-primary">Embauche annulée</span>'
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-nowrap badge-sm mb-1 bg-primary">Embauche annulée</span>'
# ---
# name: test_job_application_state_badge_processing[new]
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-wrap badge-sm mb-1 bg-info">Nouvelle candidature</span>'
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-nowrap badge-sm mb-1 bg-info">Nouvelle candidature</span>'
# ---
# name: test_job_application_state_badge_processing[obsolete]
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-wrap badge-sm mb-1 bg-primary">Embauché ailleurs</span>'
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-nowrap badge-sm mb-1 bg-primary">Embauché ailleurs</span>'
# ---
# name: test_job_application_state_badge_processing[postponed]
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-wrap badge-sm mb-1 bg-accent-03 text-primary">Candidature en attente</span>'
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-nowrap badge-sm mb-1 bg-accent-03 text-primary">Candidature en attente</span>'
# ---
# name: test_job_application_state_badge_processing[prior_to_hire]
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-wrap badge-sm mb-1 bg-accent-02 text-primary">Action préalable à l’embauche</span>'
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-nowrap badge-sm mb-1 bg-accent-02 text-primary">Action préalable à l’embauche</span>'
# ---
# name: test_job_application_state_badge_processing[processing]
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-wrap badge-sm mb-1 bg-accent-03 text-primary">Candidature à l\'étude</span>'
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-nowrap badge-sm mb-1 bg-accent-03 text-primary">Candidature à l\'étude</span>'
# ---
# name: test_job_application_state_badge_processing[refused]
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-wrap badge-sm mb-1 bg-danger">Candidature déclinée</span>'
'<span id="state_00000000-0000-0000-0000-000000000000" class="badge rounded-pill text-nowrap badge-sm mb-1 bg-danger">Candidature déclinée</span>'
# ---
# name: test_matomo_context_processor[matomo custom init 404]
'''
Expand Down
138 changes: 60 additions & 78 deletions tests/www/apply/__snapshots__/test_list.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -850,18 +850,16 @@
<p class="fs-sm mb-0 flex-grow-1">
Émise le 30 mars 2023 par

<span class="text-nowrap">

<strong>Max THROUGHPUT</strong>


<i aria-hidden="true" class="ri-home-smile-2-line me-1"></i>Orienteur

</span>

<strong>Max THROUGHPUT</strong>


<i aria-hidden="true" class="ri-home-smile-2-line me-1"></i>Orienteur



</p>
<div><span class="badge rounded-pill text-wrap badge-sm mb-1 bg-info" id="state_11111111-1111-1111-1111-111111111111">Nouvelle candidature</span></div>
<div><span class="badge rounded-pill text-nowrap badge-sm mb-1 bg-info" id="state_11111111-1111-1111-1111-111111111111">Nouvelle candidature</span></div>
</div>

<div class="c-box--results__summary">
Expand Down Expand Up @@ -914,18 +912,16 @@
<p class="fs-sm mb-0 flex-grow-1">
Émise le 18 mars 2023 par

<span class="text-nowrap">

<strong>Max THROUGHPUT</strong>


<i aria-hidden="true" class="ri-home-smile-2-line me-1"></i>Orienteur

</span>

<strong>Max THROUGHPUT</strong>


<i aria-hidden="true" class="ri-home-smile-2-line me-1"></i>Orienteur



</p>
<div><span class="badge rounded-pill text-wrap badge-sm mb-1 bg-info" id="state_22222222-2222-2222-2222-222222222222">Nouvelle candidature</span></div>
<div><span class="badge rounded-pill text-nowrap badge-sm mb-1 bg-info" id="state_22222222-2222-2222-2222-222222222222">Nouvelle candidature</span></div>
</div>

<div class="c-box--results__summary">
Expand Down Expand Up @@ -983,18 +979,16 @@
<p class="fs-sm mb-0 flex-grow-1">
Émise le 16 février 2023 par

<span class="text-nowrap">

<strong>Max THROUGHPUT</strong>


<i aria-hidden="true" class="ri-home-smile-2-line me-1"></i>Orienteur

</span>

<strong>Max THROUGHPUT</strong>


<i aria-hidden="true" class="ri-home-smile-2-line me-1"></i>Orienteur



</p>
<div><span class="badge rounded-pill text-wrap badge-sm mb-1 bg-info" id="state_33333333-3333-3333-3333-333333333333">Nouvelle candidature</span></div>
<div><span class="badge rounded-pill text-nowrap badge-sm mb-1 bg-info" id="state_33333333-3333-3333-3333-333333333333">Nouvelle candidature</span></div>
</div>

<div class="c-box--results__summary">
Expand Down Expand Up @@ -1085,16 +1079,14 @@
<strong>Vous</strong>


<span class="text-nowrap">
chez
<a class="btn-ico btn-link" href="/company/42/card">
<i aria-hidden="true" class="ri-community-line font-weight-medium ri-sm me-1"></i>
<span>Hit pit</span>
</a>
</span>
chez
<a class="btn-ico btn-link" href="/company/42/card">
<i aria-hidden="true" class="ri-community-line font-weight-medium ri-sm me-1"></i>
<span>Hit pit</span>
</a>

</p>
<div><span class="badge rounded-pill text-wrap badge-sm mb-1 bg-info" id="state_11111111-1111-1111-1111-111111111111">Nouvelle candidature</span></div>
<div><span class="badge rounded-pill text-nowrap badge-sm mb-1 bg-info" id="state_11111111-1111-1111-1111-111111111111">Nouvelle candidature</span></div>
</div>

<div class="c-box--results__summary">
Expand Down Expand Up @@ -1164,16 +1156,14 @@
<strong>Vous</strong>


<span class="text-nowrap">
chez
<a class="btn-ico btn-link" href="/company/42/card">
<i aria-hidden="true" class="ri-community-line font-weight-medium ri-sm me-1"></i>
<span>Hit pit</span>
</a>
</span>
chez
<a class="btn-ico btn-link" href="/company/42/card">
<i aria-hidden="true" class="ri-community-line font-weight-medium ri-sm me-1"></i>
<span>Hit pit</span>
</a>

</p>
<div><span class="badge rounded-pill text-wrap badge-sm mb-1 bg-info" id="state_22222222-2222-2222-2222-222222222222">Nouvelle candidature</span></div>
<div><span class="badge rounded-pill text-nowrap badge-sm mb-1 bg-info" id="state_22222222-2222-2222-2222-222222222222">Nouvelle candidature</span></div>
</div>

<div class="c-box--results__summary">
Expand Down Expand Up @@ -1248,16 +1238,14 @@
<strong>Vous</strong>


<span class="text-nowrap">
chez
<a class="btn-ico btn-link" href="/company/42/card">
<i aria-hidden="true" class="ri-community-line font-weight-medium ri-sm me-1"></i>
<span>Hit pit</span>
</a>
</span>
chez
<a class="btn-ico btn-link" href="/company/42/card">
<i aria-hidden="true" class="ri-community-line font-weight-medium ri-sm me-1"></i>
<span>Hit pit</span>
</a>

</p>
<div><span class="badge rounded-pill text-wrap badge-sm mb-1 bg-info" id="state_33333333-3333-3333-3333-333333333333">Nouvelle candidature</span></div>
<div><span class="badge rounded-pill text-nowrap badge-sm mb-1 bg-info" id="state_33333333-3333-3333-3333-333333333333">Nouvelle candidature</span></div>
</div>

<div class="c-box--results__summary">
Expand Down Expand Up @@ -1359,18 +1347,16 @@
<p class="fs-sm mb-0 flex-grow-1">
Émise le 30 mars 2023 par

<span class="text-nowrap">

<strong>Max THROUGHPUT</strong>


<i aria-hidden="true" class="ri-home-smile-2-line me-1"></i>Orienteur

</span>

<strong>Max THROUGHPUT</strong>


<i aria-hidden="true" class="ri-home-smile-2-line me-1"></i>Orienteur



</p>
<div><span class="badge rounded-pill text-wrap badge-sm mb-1 bg-info" id="state_11111111-1111-1111-1111-111111111111">Nouvelle candidature</span></div>
<div><span class="badge rounded-pill text-nowrap badge-sm mb-1 bg-info" id="state_11111111-1111-1111-1111-111111111111">Nouvelle candidature</span></div>
</div>

<div class="c-box--results__summary">
Expand Down Expand Up @@ -1465,18 +1451,16 @@
<p class="fs-sm mb-0 flex-grow-1">
Émise le 18 mars 2023 par

<span class="text-nowrap">

<strong>Max THROUGHPUT</strong>


<i aria-hidden="true" class="ri-home-smile-2-line me-1"></i>Orienteur

</span>

<strong>Max THROUGHPUT</strong>


<i aria-hidden="true" class="ri-home-smile-2-line me-1"></i>Orienteur



</p>
<div><span class="badge rounded-pill text-wrap badge-sm mb-1 bg-info" id="state_22222222-2222-2222-2222-222222222222">Nouvelle candidature</span></div>
<div><span class="badge rounded-pill text-nowrap badge-sm mb-1 bg-info" id="state_22222222-2222-2222-2222-222222222222">Nouvelle candidature</span></div>
</div>

<div class="c-box--results__summary">
Expand Down Expand Up @@ -1546,18 +1530,16 @@
<p class="fs-sm mb-0 flex-grow-1">
Émise le 16 février 2023 par

<span class="text-nowrap">

<strong>Max THROUGHPUT</strong>


<i aria-hidden="true" class="ri-home-smile-2-line me-1"></i>Orienteur

</span>

<strong>Max THROUGHPUT</strong>


<i aria-hidden="true" class="ri-home-smile-2-line me-1"></i>Orienteur



</p>
<div><span class="badge rounded-pill text-wrap badge-sm mb-1 bg-info" id="state_33333333-3333-3333-3333-333333333333">Nouvelle candidature</span></div>
<div><span class="badge rounded-pill text-nowrap badge-sm mb-1 bg-info" id="state_33333333-3333-3333-3333-333333333333">Nouvelle candidature</span></div>
</div>

<div class="c-box--results__summary">
Expand Down

0 comments on commit 0d21383

Please sign in to comment.