refactor(dsfr): all procedures table to v1.12

This commit is contained in:
Colin Darie 2024-11-05 18:23:14 +01:00
parent 8b68350e0c
commit 35a17cc2c6
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
3 changed files with 72 additions and 60 deletions

View file

@ -266,6 +266,11 @@ button.fr-tag-bug {
white-space: nowrap;
}
// Caption is bold, but all-procedures table use fr-tag in caption
.fr-table caption .fr-tag {
font-weight: normal;
}
// We remove the line height because it creates unharmonized spaces - most of all in table
.fr-tags-group > li {
line-height: inherit;

View file

@ -1,9 +1,9 @@
%tr.procedure{ id: "procedure_#{procedure.id}" }
%td
%th.fr-cell--fixed{ scope: 'row' }
- 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'
- params = show_detail ? {} : { show_detail: true }
= button_to detail_admin_procedure_path(procedure["id"]), method: :post, params:, title:, class: [icon, "fr-icon--sm fr-mr-1w fr-mb-1w fr-text-action-high--blue-france fr-btn fr-btn--tertiary-no-outline" ] do
= button_to detail_admin_procedure_path(procedure["id"]), method: :post, params:, title:, class: [icon, "fr-icon--sm fr-mb-1w fr-text-action-high--blue-france fr-btn fr-btn--tertiary-no-outline" ] do
= title
%td
- if procedure.template
@ -11,7 +11,7 @@
%abbr{ title: APPLICATION_NAME }= acronymize(APPLICATION_NAME)
= procedure.libelle
%td= procedure.id
%td= procedure.estimated_dossiers_count
%td.fr-cell--right= procedure.estimated_dossiers_count
%td
- if procedure.respond_to?(:parsed_latest_zone_labels)
- procedure.parsed_latest_zone_labels.uniq.each do |zone_label|
@ -31,8 +31,7 @@
- if show_detail
%tr.procedure{ id: "procedure_detail_#{procedure.id}" }
%td.fr-highlight--green-emeraude{ colspan: '8' }
.fr-container
.fr-col-6
%td.fr-background-alt--green-emeraude{ colspan: '8' }
%ul
- procedure.administrateurs.uniq.each do |admin|
= admin.email
%li= admin.email

View file

@ -14,8 +14,12 @@
.actions
.link.fr-mx-1w= link_to 'Voir les administrateurs', administrateurs_admin_procedures_path(@filter.params), class: 'fr-btn fr-btn--secondary'
.link.fr-mx-1w{ "data-turbo": "false" }= link_to 'Exporter les résultats', all_admin_procedures_path(@filter.params.merge(format: :xlsx)), class: 'fr-btn fr-btn--secondary'
.fr-table.fr-table--bordered
%table#all-demarches
.fr-table.fr-table--sm.fr-table--no-scroll.fr-table--bordered
.fr-table__wrapper
.fr-table__container
.fr-table__content
%table
%caption
= "#{@procedures.total_count} #{t('pluralize.procedures', count: @procedures.total_count)}"
%span.hidden.spinner{ 'aria-hidden': 'true', 'data-turbo-target': 'spinner' }
@ -51,10 +55,10 @@
- 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: 'shared'
%thead
%tr
%th{ scope: 'col' }
%th{ role: 'columnheader' }
%th{ scope: 'col' } Démarche
%th{ scope: 'col' } №
%th{ scope: 'col' } Nombre de dossiers
@ -65,4 +69,8 @@
%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: 'shared'
.fr-table__footer
.fr-table__footer--start
.fr-table__footer--middle
= paginate @procedures, params: @filter.params, views_prefix: 'shared'
.fr-table__footer--end.flex-no-grow