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; 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 // We remove the line height because it creates unharmonized spaces - most of all in table
.fr-tags-group > li { .fr-tags-group > li {
line-height: inherit; line-height: inherit;

View file

@ -1,9 +1,9 @@
%tr.procedure{ id: "procedure_#{procedure.id}" } %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' - 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 }
= 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 = title
%td %td
- if procedure.template - if procedure.template
@ -11,7 +11,7 @@
%abbr{ title: APPLICATION_NAME }= acronymize(APPLICATION_NAME) %abbr{ title: APPLICATION_NAME }= acronymize(APPLICATION_NAME)
= procedure.libelle = procedure.libelle
%td= procedure.id %td= procedure.id
%td= procedure.estimated_dossiers_count %td.fr-cell--right= procedure.estimated_dossiers_count
%td %td
- if procedure.respond_to?(:parsed_latest_zone_labels) - if procedure.respond_to?(:parsed_latest_zone_labels)
- procedure.parsed_latest_zone_labels.uniq.each do |zone_label| - procedure.parsed_latest_zone_labels.uniq.each do |zone_label|
@ -31,8 +31,7 @@
- if show_detail - if show_detail
%tr.procedure{ id: "procedure_detail_#{procedure.id}" } %tr.procedure{ id: "procedure_detail_#{procedure.id}" }
%td.fr-highlight--green-emeraude{ colspan: '8' } %td.fr-background-alt--green-emeraude{ colspan: '8' }
.fr-container %ul
.fr-col-6 - procedure.administrateurs.uniq.each do |admin|
- procedure.administrateurs.uniq.each do |admin| %li= admin.email
= admin.email

View file

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