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
- procedure.administrateurs.uniq.each do |admin|
= admin.email
%td.fr-background-alt--green-emeraude{ colspan: '8' }
%ul
- procedure.administrateurs.uniq.each do |admin|
%li= admin.email

View file

@ -14,55 +14,63 @@
.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
%caption
= "#{@procedures.total_count} #{t('pluralize.procedures', count: @procedures.total_count)}"
%span.hidden.spinner{ 'aria-hidden': 'true', 'data-turbo-target': 'spinner' }
- if @filter.libelle
.selected-query.fr-mb-2w
= link_to @filter.libelle, all_admin_procedures_path(@filter.without(:libelle)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- if @filter.service_siret
.selected-query.fr-mb-2w
= link_to @filter.service_siret, all_admin_procedures_path(@filter.without(:service_siret)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- if @filter.service_departement
.selected-query.fr-mb-2w
= link_to "#{@filter.service_departement} #{APIGeoService.departement_name(@filter.service_departement)}", all_admin_procedures_path(@filter.without(:service_departement)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- if @filter.selected_zones.present?
.selected-zones.fr-mb-2w
- @filter.selected_zones.each do |zone|
= link_to zone.current_label, all_admin_procedures_path(@filter.without(:zone_ids, zone.id)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- if @filter.statuses.present?
.selected-statuses.fr-mb-2w
- @filter.statuses.each do |status|
= link_to status, all_admin_procedures_path(@filter.without(:statuses, status)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- if @filter.kind_usagers.present?
.selected-kind_usagers.fr-mb-2w
- @filter.kind_usagers.each do |kind_usager|
= link_to t(kind_usager, scope: 'activerecord.attributes.procedure.kind_usager'), all_admin_procedures_path(@filter.without(:kind_usagers, kind_usager)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- if @filter.tags.present?
.selected-tag.fr-mb-2w
- @filter.tags.each do |tag|
= link_to tag, all_admin_procedures_path(@filter.without(:tags, tag)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- params[:tags].delete(tag)
- if @filter.template?
.selected-template.fr-mb-2w
= link_to "Modèle DS", all_admin_procedures_path(@filter.without(:template)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- 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{ scope: 'col' } Démarche
%th{ scope: 'col' } №
%th{ scope: 'col' } Nombre de dossiers
%th{ scope: 'col' } Zones
%th{ scope: 'col' } Statut
%th{ scope: 'col' } Date
%th{ scope: 'col' } Action
%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.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' }
- if @filter.libelle
.selected-query.fr-mb-2w
= link_to @filter.libelle, all_admin_procedures_path(@filter.without(:libelle)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- if @filter.service_siret
.selected-query.fr-mb-2w
= link_to @filter.service_siret, all_admin_procedures_path(@filter.without(:service_siret)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- if @filter.service_departement
.selected-query.fr-mb-2w
= link_to "#{@filter.service_departement} #{APIGeoService.departement_name(@filter.service_departement)}", all_admin_procedures_path(@filter.without(:service_departement)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- if @filter.selected_zones.present?
.selected-zones.fr-mb-2w
- @filter.selected_zones.each do |zone|
= link_to zone.current_label, all_admin_procedures_path(@filter.without(:zone_ids, zone.id)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- if @filter.statuses.present?
.selected-statuses.fr-mb-2w
- @filter.statuses.each do |status|
= link_to status, all_admin_procedures_path(@filter.without(:statuses, status)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- if @filter.kind_usagers.present?
.selected-kind_usagers.fr-mb-2w
- @filter.kind_usagers.each do |kind_usager|
= link_to t(kind_usager, scope: 'activerecord.attributes.procedure.kind_usager'), all_admin_procedures_path(@filter.without(:kind_usagers, kind_usager)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- if @filter.tags.present?
.selected-tag.fr-mb-2w
- @filter.tags.each do |tag|
= link_to tag, all_admin_procedures_path(@filter.without(:tags, tag)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- params[:tags].delete(tag)
- if @filter.template?
.selected-template.fr-mb-2w
= link_to "Modèle DS", all_admin_procedures_path(@filter.without(:template)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
- 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'
%thead
%tr
%th{ role: 'columnheader' }
%th{ scope: 'col' } Démarche
%th{ scope: 'col' } №
%th{ scope: 'col' } Nombre de dossiers
%th{ scope: 'col' } Zones
%th{ scope: 'col' } Statut
%th{ scope: 'col' } Date
%th{ scope: 'col' } Action
%tbody{ 'data-turbo': 'true' }
- @procedures.each do |procedure|
= render partial: 'detail', locals: { procedure: procedure, show_detail: false }
.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