From 8ebdb00fc2d5129a3e9d740909e6cdab9fd18fd8 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 13 Nov 2024 12:49:41 +0100 Subject: [PATCH] fix(procedures): turbo force server, fix table JS style --- .../administrateurs/procedures/all.html.haml | 69 ++++++++++--------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/app/views/administrateurs/procedures/all.html.haml b/app/views/administrateurs/procedures/all.html.haml index 1b4c21f80..bcc513e36 100644 --- a/app/views/administrateurs/procedures/all.html.haml +++ b/app/views/administrateurs/procedures/all.html.haml @@ -15,7 +15,40 @@ .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--sm.fr-table--no-scroll.fr-table--bordered + - 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' + + .fr-table.fr-table--sm.fr-table--no-scroll.fr-table--bordered{ 'data-turbo': 'true', 'data-turbo-force': 'server' } .fr-table__wrapper .fr-table__container .fr-table__content @@ -23,38 +56,6 @@ %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 @@ -66,7 +67,7 @@ %th{ scope: 'col' } Statut %th{ scope: 'col' } Date %th{ scope: 'col' } Action - %tbody{ 'data-turbo': 'true' } + %tbody - @procedures.each do |procedure| = render partial: 'detail', locals: { procedure: procedure, show_detail: false } .fr-table__footer