refactor(demarches): use turbo-frame

This commit is contained in:
Paul Chavard 2023-01-11 16:58:23 +01:00
parent e6ed1caa3a
commit 3e0adc15db
3 changed files with 4 additions and 4 deletions

View file

@ -1,6 +1,6 @@
- content_for :results do
.main-filter-header.fr-my-3w
= form_with(url: administrateurs_admin_procedures_path, method: :get, html: {'data-autosubmit-target': 'form', role: 'search' }) do |f|
= form_with(url: administrateurs_admin_procedures_path, method: :get, html: { 'data-autosubmit-target': 'form', 'data-turbo-frame': 'procedures', role: 'search' }) do |f|
- @filter.zone_ids&.each do |zone_id|
= hidden_field_tag 'zone_ids[]', zone_id
- @filter.statuses&.each do |status|

View file

@ -1,6 +1,6 @@
- content_for :results do
.main-filter-header.fr-my-3w
= form_with(url: all_admin_procedures_path, method: :get, html: { 'data-autosubmit-target': 'form', role: 'search', class: 'search' }) do |f|
= form_with(url: all_admin_procedures_path, method: :get, html: { 'data-autosubmit-target': 'form', 'data-turbo-frame': 'procedures', role: 'search', class: 'search' }) do |f|
- @filter.zone_ids&.each do |zone_id|
= hidden_field_tag 'zone_ids[]', zone_id
- @filter.statuses&.each do |status|

View file

@ -12,7 +12,7 @@
.fr-container--fluid{ 'data-turbo': 'true', 'data-controller': 'autosubmit' }
.fr-grid-row.fr-grid-row--gutters
.fr-col-3
= form_with(url: all_admin_procedures_path, method: :get, html: {'data-autosubmit-target': 'form'}) do |f|
= form_with(url: all_admin_procedures_path, method: :get, html: { 'data-autosubmit-target': 'form', 'data-turbo-frame': 'procedures' }) do |f|
%fieldset.sidebar-filter
%legend
@ -64,6 +64,6 @@
= b.check_box(checked: @filter.status_filtered?(b.value), 'data-action': 'autosubmit#submit')
= b.label(class: 'fr-label') { t b.text, scope: 'activerecord.attributes.procedure.aasm_state' }
.fr-col-9
%turbo-frame#procedures.fr-col-9{ 'data-turbo-action': 'advance' }
= yield(:results)
= render template: 'layouts/application'