style(admin): fix all administrateurs table

This commit is contained in:
Colin Darie 2024-11-25 11:36:27 +01:00
parent f399c7eb2a
commit 6ad6f2167b
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
2 changed files with 48 additions and 42 deletions

View file

@ -1,5 +1,5 @@
%tr.procedure{ id: "procedure_#{procedure.id}" } %tr.procedure{ id: "procedure_#{procedure.id}" }
%th{ scope: 'row' } %th.fr-cell--center{ scope: 'row' }
- title = show_detail ? 'Cacher les détails de la démarche' : 'Afficher les détails de la démarche' - title = show_detail ? 'Cacher les détails de la démarche' : 'Afficher les détails de la démarche'
- icon = show_detail ? 'fr-icon-subtract-line' : 'fr-icon-add-line' - icon = show_detail ? 'fr-icon-subtract-line' : 'fr-icon-add-line'
- params = show_detail ? {} : { show_detail: true } - params = show_detail ? {} : { show_detail: true }

View file

@ -10,11 +10,7 @@
= f.label 'email', 'Rechercher des administrateurs par email', class: 'fr-label' = f.label 'email', 'Rechercher des administrateurs par email', class: 'fr-label'
= f.search_field 'email', size: 40, class: 'fr-input', data: { turbo_force: :server } = f.search_field 'email', size: 40, class: 'fr-input', data: { turbo_force: :server }
.actions= link_to 'Voir la liste des démarches', all_admin_procedures_path(@filter.params), class: 'fr-btn fr-btn--secondary' .actions= link_to 'Voir la liste des démarches', all_admin_procedures_path(@filter.params), class: 'fr-btn fr-btn--secondary'
.fr-table.fr-table--bordered
%table#all-admins
%caption
= "#{@admins.total_count} administrateurs"
%span.hidden.spinner{ 'aria-hidden': 'true', 'data-turbo-target': 'spinner' }
- if @filter.email - if @filter.email
.selected-email.fr-mb-2w .selected-email.fr-mb-2w
= link_to @filter.email, administrateurs_admin_procedures_path(@filter.without(:email)), class: 'fr-tag fr-tag--dismiss fr-mb-1w' = link_to @filter.email, administrateurs_admin_procedures_path(@filter.without(:email)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
@ -29,7 +25,15 @@
- if @filter.from_publication_date.present? - if @filter.from_publication_date.present?
.selected-from-publication-date.fr-mb-2w .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' = 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: 'shared'
.fr-table.fr-table--bordered
.fr-table__wrapper
.fr-table__container
.fr-table__content
%table#all-admins
%caption
= "#{@admins.total_count} administrateurs"
%span.hidden.spinner{ 'aria-hidden': 'true', 'data-turbo-target': 'spinner' }
%thead %thead
%tr %tr
%th{ scope: 'col' } %th{ scope: 'col' }
@ -39,16 +43,18 @@
- @admins.each do |admin| - @admins.each do |admin|
%tbody{ 'data-controller': 'expand' } %tbody{ 'data-controller': 'expand' }
%tr.procedure{ 'data-action': 'click->expand#toggle' } %tr.procedure{ 'data-action': 'click->expand#toggle' }
%td %th.fr-cell--center{ scope: 'row' }
%button.fr-icon-add-line.fr-icon--sm.fr-mr-1w.fr-mb-1w.fr-text-action-high--blue-france{ 'aria-hidden': 'true', 'data-expand-target': 'icon' } %button.fr-icon-add-line.fr-icon--sm.fr-mb-1w.fr-text-action-high--blue-france.fr-btn.fr-btn--tertiary-no-outline{ 'aria-hidden': 'true', 'data-expand-target': 'icon' }
%td= admin.email %td= admin.email
%td= admin.procedures.size %td.fr-cell--right.fr-cell--numeric= admin.procedures.size
%td= l(admin.created_at, format: :message_date_without_time) %td.fr-cell--numeric= l(admin.created_at, format: :message_date_without_time)
%tr.hidden{ 'data-expand-target': 'content' } %tr.hidden{ 'data-expand-target': 'content' }
%td.fr-highlight--beige-gris-galet{ colspan: '6' } %td.fr-cell--multiline.fr-background-alt--green-emeraude{ colspan: '4' }
.fr-container
.fr-col-12.fr-mr-1w
%ul %ul
- admin.procedures.each do |procedure| - admin.procedures.each do |procedure|
%li= procedure.libelle %li= procedure.libelle
.fr-mt-2w= paginate @admins, views_prefix: 'shared' .fr-table__footer
.fr-table__footer--start
.fr-table__footer--middle
= paginate @admins, views_prefix: 'shared'
.fr-table__footer--end.flex-no-grow