mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 05:06:22 +00:00
feat: extraer en un componente
This commit is contained in:
parent
a7d33976ec
commit
3967a63163
3 changed files with 15 additions and 3 deletions
13
app/views/components/_select_all_container.haml
Normal file
13
app/views/components/_select_all_container.haml
Normal file
|
@ -0,0 +1,13 @@
|
|||
-#
|
||||
Contenedor para las acciones en masa.
|
||||
|
||||
Es un formulario auto-contenido, que permite colocar los elementos
|
||||
fuera del formulario para evitar anidarlos. Mientras los elementos
|
||||
tengan el atributo `form` con el mismo parámetro `form_id`, el
|
||||
navegador los va a asignar a este formulario.
|
||||
|
||||
@param path [String]
|
||||
@param form_id [String]
|
||||
|
||||
= form_tag path, id: form_id, method: :patch do
|
||||
-# nada
|
|
@ -1,6 +1,6 @@
|
|||
- form_id = 'actor_moderations_action_on_several'
|
||||
|
||||
= form_tag site_actor_moderations_action_on_several_path, id: form_id, method: :patch
|
||||
= render 'components/select_all_container', path: site_actor_moderations_action_on_several_path, form_id: form_id
|
||||
|
||||
.row.no-gutters.pt-2{ data: { controller: 'select-all' } }
|
||||
.col-1.d-flex.align-items-center
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
- form_id = 'instance_moderation_action_on_several'
|
||||
|
||||
%section
|
||||
= form_tag site_instance_moderations_action_on_several_path, id: form_id, method: :patch
|
||||
|
||||
= render 'components/select_all_container', path: site_instance_moderations_action_on_several_path, form_id: form_id
|
||||
.row.no-gutters.pt-2{ data: { controller: 'select-all' } }
|
||||
.col-1.d-flex.align-items-center
|
||||
= render 'components/select_all', id: 'instances', form_id: form_id
|
||||
|
|
Loading…
Reference in a new issue