add dsfr style pagination for all users

This commit is contained in:
Lisa Durand 2023-04-21 17:19:17 +02:00
parent 1b02857662
commit 1c20a9160c
24 changed files with 26 additions and 25 deletions

View file

@ -3,4 +3,4 @@
= link_to_prev_page resources, t("views.pagination.previous"), param_name: "_page"
= link_to_next_page resources, t("views.pagination.next"), param_name: "_page"
- else
= paginate resources, param_name: "_page"
= paginate resources, param_name: "_page", views_prefix: 'shared'

View file

@ -64,4 +64,4 @@
= t('.group_management.move_files', count: group.dossiers.visible_by_administration.size)
= paginate groupes_instructeurs
= paginate groupes_instructeurs, views_prefix: 'shared'

View file

@ -39,4 +39,4 @@
params: { instructeur: { id: instructeur.id }},
class: 'fr-btn fr-btn--secondary' }
= paginate instructeurs
= paginate instructeurs, views_prefix: 'shared'

View file

@ -23,4 +23,4 @@
{ class: 'button',
data: { confirm: "Êtes-vous sûr de vouloir réaffecter les dossiers du groupe « #{@groupe_instructeur.label} » vers le groupe  « #{group.label} » ?" } }
= paginate @groupes_instructeurs
= paginate @groupes_instructeurs, views_prefix: 'shared'

View file

@ -29,7 +29,7 @@
- if @filter.from_publication_date.present?
.selected-from-publication-date.fr-mb-2w
= link_to "Depuis le #{l(@filter.from_publication_date)}", all_admin_procedures_path(@filter.without(:from_publication_date)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
= paginate @admins, views_prefix: 'administrateurs'
= paginate @admins, views_prefix: 'shared'
%thead
%tr
%th{ scope: 'col' }
@ -51,4 +51,4 @@
%ul
- admin.procedures.each do |procedure|
%li= procedure.libelle
.fr-mt-2w= paginate @admins, views_prefix: 'administrateurs'
.fr-mt-2w= paginate @admins, views_prefix: 'shared'

View file

@ -38,7 +38,7 @@
- if @filter.from_publication_date.present?
.selected-from-publication-date.fr-mb-2w
= link_to "Depuis #{l(@filter.from_publication_date)}", all_admin_procedures_path(@filter.without(:from_publication_date)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
= paginate @procedures, params: @filter.params, views_prefix: 'administrateurs'
= paginate @procedures, params: @filter.params, , views_prefix: 'shared'
%thead
%tr
%th{ scope: 'col' }
@ -52,4 +52,4 @@
%tbody{ 'data-turbo': 'true' }
- @procedures.each do |procedure|
= render partial: 'detail', locals: { procedure: procedure, show_detail: false }
.fr-mt-2w= paginate @procedures, params: @filter.params, views_prefix: 'administrateurs'
.fr-mt-2w= paginate @procedures, params: @filter.params, views_prefix: 'shared'

View file

@ -15,16 +15,16 @@
.fr-container#procedures{ data: { item_count: @statut === "publiees" ? @procedures_publiees_count : @statut === "brouillons" ? @procedures_draft_count : @procedures_closed_count } }
- if @statut === "publiees"
= render partial: "procedures_list", locals: { procedures: @procedures_publiees }
= paginate @procedures_publiees
= paginate @procedures_publiees, views_prefix: 'shared'
- if @statut === "brouillons"
= render partial: "procedures_list", locals: { procedures: @procedures_draft }
= paginate @procedures_draft
= paginate @procedures_draft, views_prefix: 'shared'
- if @statut === "archivees"
= render partial: "procedures_list", locals: { procedures: @procedures_closed }
= paginate @procedures_closed
= paginate @procedures_closed, views_prefix: 'shared'
- if @statut === "supprimees"
= render partial: "procedures_list", locals: { procedures: @procedures_deleted }
= paginate @procedures_deleted
= paginate @procedures_deleted, views_prefix: 'shared'

View file

@ -41,6 +41,6 @@
#{avis.dossier.id}
%td= link_to(avis.dossier.user_email_for(:display), expert_avis_path(avis.procedure, avis), class: 'cell-link')
%td= link_to(avis.procedure.libelle, expert_avis_path(avis.procedure, avis), class: 'cell-link')
= paginate(@avis)
= paginate @avis, views_prefix: 'shared'
- else
%h2.empty-text Aucun avis

View file

@ -17,4 +17,4 @@
%td= group.label
%td.actions= link_to "voir", instructeur_groupe_path(@procedure, group)
= paginate @groupes_instructeurs
= paginate @groupes_instructeurs, views_prefix: 'shared'

View file

@ -47,4 +47,4 @@
params: { instructeur: { id: instructeur.id }},
class: 'button' }
= paginate @instructeurs
= paginate @instructeurs, views_prefix: 'shared'

View file

@ -34,7 +34,7 @@
%li Lutilisateur a intentionnellement supprimé son dossier.
%li Le délai de conservation maximal de #{@procedure.duree_conservation_dossiers_dans_ds} mois a expiré. Conformément au règlement RGPD, DS ne peut continuer à les héberger.
- if @deleted_dossiers.any?
= paginate @deleted_dossiers
= paginate @deleted_dossiers, views_prefix: 'shared'
%table.table.dossiers-table.hoverable
%thead
%tr
@ -53,6 +53,6 @@
= deletion_reason_badge(deleted_dossier.reason)
%td.deleted-cell
= l(deleted_dossier.deleted_at, format: '%d/%m/%y')
= paginate @deleted_dossiers
= paginate @deleted_dossiers, views_prefix: 'shared'
- else
Aucun dossier supprimé

View file

@ -184,7 +184,8 @@
turbo: false }
%tfoot
%tr
%td.force-table-100{ colspan: @procedure_presentation.displayed_fields_for_headers.size + 2 }= paginate @filtered_sorted_paginated_ids
%td.force-table-100{ colspan: @procedure_presentation.displayed_fields_for_headers.size + 2 }
= paginate @filtered_sorted_paginated_ids, views_prefix: 'shared'
- else
%h2.empty-text

View file

@ -11,7 +11,7 @@
= t('pluralize.dossier_trouve', count: @dossiers_count)
- if @projected_dossiers.present?
= paginate @paginated_ids
= paginate @paginated_ids, views_prefix: 'shared'
.fr-table.fr-table--bordered
%table.table.dossiers-table.hoverable
%thead
@ -105,7 +105,7 @@
- else
%td
= paginate @paginated_ids
= paginate @paginated_ids, views_prefix: 'shared'
- else
%h2 Aucun dossier correspondant à votre recherche na été trouvé

View file

@ -1,5 +1,5 @@
= paginator.render do
%nav.fr-pagination{ role: 'navigation', 'aria-label': 'Pagination' }
%nav.fr-pagination.fr-mt-2w{ role: 'navigation', 'aria-label': 'Pagination' }
%ul.fr-pagination__list
= first_page_tag unless current_page.first?
= prev_page_tag unless current_page.first?

View file

@ -27,7 +27,7 @@
%td
= dossier.updated_at.strftime('%d/%m/%Y')
= paginate(deleted_dossiers)
= paginate deleted_dossiers, views_prefix: 'shared'
- else
.blank-tab

View file

@ -43,7 +43,7 @@
%td.action-col.follow-col
= render partial: 'dossier_actions', locals: { dossier: dossier }
= paginate(dossiers)
= paginate dossiers, views_prefix: 'shared'
- else
.blank-tab

View file

@ -31,7 +31,7 @@
= link_to restore_dossier_path(dossier.id), method: :patch, class: "fr-btn" do
Restaurer
= paginate(hidden_dossiers)
= paginate hidden_dossiers, views_prefix: 'shared'
- else
.blank-tab

View file

@ -28,7 +28,7 @@
%td= status_badge(dossier.state)
%td.action-col.follow-col{ style: 'padding: 18px;' }= (dossier.depose_at || dossier.created_at).strftime('%d/%m/%Y')
= paginate(dossier_transfers)
= paginate dossier_transfers, views_prefix: 'shared'
- else
.blank-tab