From ca86c6ebf2ec5bd72b2268881cff58c9bfc3ad93 Mon Sep 17 00:00:00 2001 From: hellodeloo Date: Wed, 15 May 2024 15:10:12 +0200 Subject: [PATCH] feat: update employee record list filters ui --- .../includes/approvals_filters/expiry.html | 2 +- .../employee_record_filters/status.html | 17 ++++++++++ .../includes/list_counter.html | 7 ++++ .../includes/list_form_fields.html | 21 ------------ .../employee_record/includes/list_order.html | 13 ++++++++ .../includes/list_results.html | 25 +++----------- itou/templates/employee_record/list.html | 33 +++++++++++-------- itou/www/employee_record_views/forms.py | 8 +++-- itou/www/employee_record_views/views.py | 10 +++--- tests/www/employee_record_views/test_list.py | 24 +++++++++++++- 10 files changed, 95 insertions(+), 65 deletions(-) create mode 100644 itou/templates/employee_record/includes/employee_record_filters/status.html create mode 100644 itou/templates/employee_record/includes/list_counter.html delete mode 100644 itou/templates/employee_record/includes/list_form_fields.html create mode 100644 itou/templates/employee_record/includes/list_order.html diff --git a/itou/templates/approvals/includes/approvals_filters/expiry.html b/itou/templates/approvals/includes/approvals_filters/expiry.html index 0898d44957..bcbad18dad 100644 --- a/itou/templates/approvals/includes/approvals_filters/expiry.html +++ b/itou/templates/approvals/includes/approvals_filters/expiry.html @@ -7,7 +7,7 @@
  • diff --git a/itou/templates/employee_record/includes/employee_record_filters/status.html b/itou/templates/employee_record/includes/employee_record_filters/status.html new file mode 100644 index 0000000000..ad0fb6fe84 --- /dev/null +++ b/itou/templates/employee_record/includes/employee_record_filters/status.html @@ -0,0 +1,17 @@ +{% load list_filters %} + +
    + {% for choice, badge in form.status|zip:badges %} +
  • + +
  • + {% endfor %} + diff --git a/itou/templates/employee_record/includes/list_counter.html b/itou/templates/employee_record/includes/list_counter.html new file mode 100644 index 0000000000..869ff32caf --- /dev/null +++ b/itou/templates/employee_record/includes/list_counter.html @@ -0,0 +1,7 @@ +{% load str_filters %} + +{% with navigation_pages.paginator.count as counter %} +

    + {{ counter }} résultat{{ counter|pluralizefr }} +

    +{% endwith %} diff --git a/itou/templates/employee_record/includes/list_form_fields.html b/itou/templates/employee_record/includes/list_form_fields.html deleted file mode 100644 index d3a49719b2..0000000000 --- a/itou/templates/employee_record/includes/list_form_fields.html +++ /dev/null @@ -1,21 +0,0 @@ -{% load django_bootstrap5 %} -{% load list_filters %} -
    -
    - Statut -
    - {% for status, badge in form.status|zip:badges %} -
    -
    {{ status }}
    -
    - {{ badge.0 }} -
    -
    - {% endfor %} -
    -
    -
    - Par candidat - {% bootstrap_field filters_form.job_seekers show_label=False %} -
    -
    diff --git a/itou/templates/employee_record/includes/list_order.html b/itou/templates/employee_record/includes/list_order.html new file mode 100644 index 0000000000..451dfefd41 --- /dev/null +++ b/itou/templates/employee_record/includes/list_order.html @@ -0,0 +1,13 @@ +
    + Trier par : + + +
    diff --git a/itou/templates/employee_record/includes/list_results.html b/itou/templates/employee_record/includes/list_results.html index ac14ed7a38..dffee24a1f 100644 --- a/itou/templates/employee_record/includes/list_results.html +++ b/itou/templates/employee_record/includes/list_results.html @@ -1,25 +1,7 @@ +{% load django_bootstrap5 %} {% load str_filters %} +
    -
    -
    - {% with navigation_pages.paginator.count as counter %} -

    {{ counter }} résultat{{ counter|pluralizefr }}

    - {% endwith %} -
    -
    - Trier par : - - -
    -
    {# "Real" employee records objects #}
    {% if employee_records_list %} @@ -42,9 +24,10 @@

    {{ counter }} résultat{{ counter|pluralizefr }}

    {% endif %} {% include "includes/pagination.html" with page=navigation_pages boost=True boost_target="#employee-records-container" boost_indicator="#employee-records-container" %}
    + {% if request.htmx %} + {% include "employee_record/includes/list_order.html" %} {% include "employee_record/includes/list_status_help.html" with request=request status=form.status.value only %} {% include "employee_record/includes/list_counter.html" %} {% include "employee_record/includes/employee_record_filters/status.html" %} - {% include "employee_record/includes/employee_record_filters/reset.html" %} {% endif %} diff --git a/itou/templates/employee_record/list.html b/itou/templates/employee_record/list.html index b53d7e6ac9..c34ee88b56 100644 --- a/itou/templates/employee_record/list.html +++ b/itou/templates/employee_record/list.html @@ -57,18 +57,23 @@

    Nous transférons vos fiches salarié à l'ASP afin de vous faire

    -
    -