5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 14:06:21 +00:00

fix: ocultar el modal al guardar #16714

This commit is contained in:
f 2024-10-08 15:17:00 -03:00
parent fb691b0e81
commit ef05f10b70
No known key found for this signature in database
3 changed files with 4 additions and 3 deletions

View file

@ -50,7 +50,8 @@
= render 'errors', post: post = render 'errors', post: post
-# Parámetros para HTMX -# Parámetros para HTMX
%input{ type: 'hidden', name: 'hide', value: pluck_param((post.errors.empty? ? :show : :hide), optional: true) } %input{ type: 'hidden', name: 'modal_id', value: pluck_param(:modal_id, optional: true) }
%input{ type: 'hidden', name: 'hide', value: pluck_param((post.errors.empty? ? :show : :hide), optional: true) || pluck_param(:modal_id, optional: true) }
%input{ type: 'hidden', name: 'show', value: pluck_param((post.errors.empty? ? :hide : :show), optional: true) } %input{ type: 'hidden', name: 'show', value: pluck_param((post.errors.empty? ? :hide : :show), optional: true) }
%input{ type: 'hidden', name: 'name', value: pluck_param(:name) } %input{ type: 'hidden', name: 'name', value: pluck_param(:name) }
%input{ type: 'hidden', name: 'base', value: pluck_param(:base) } %input{ type: 'hidden', name: 'base', value: pluck_param(:base) }

View file

@ -46,7 +46,7 @@
= render 'bootstrap/modal', id: id, modal_content_attributes: { class: 'h-100' } do = render 'bootstrap/modal', id: id, modal_content_attributes: { class: 'h-100' } do
- content_for :"#{id}_body" do - content_for :"#{id}_body" do
-# @todo ocultar el modal después de guardar -# @todo ocultar el modal después de guardar
.placeholder-glow{ 'hx-get': site_posts_form_path(site, layout: layout, base: id, name: name, form: form_id, swap: 'innerHTML', target: target_id, attribute: 'new_has_one', hide: modal_id, uuid: metadata.value, invalid: invalid_id, submitting: submitting_id, saved: saved_id, inverse: metadata.inverse, metadata.inverse => post.uuid.value), 'hx-trigger': 'load' } .placeholder-glow{ 'hx-get': site_posts_form_path(site, layout: layout, base: id, name: name, form: form_id, swap: 'innerHTML', target: target_id, attribute: 'new_has_one', modal_id: modal_id, uuid: metadata.value, invalid: invalid_id, submitting: submitting_id, saved: saved_id, inverse: metadata.inverse, metadata.inverse => post.uuid.value), 'hx-trigger': 'load' }
%span.placeholder.w-100.h-100 %span.placeholder.w-100.h-100
- content_for :"#{id}_footer" do - content_for :"#{id}_footer" do

View file

@ -1 +1 @@
= render 'posts/new_has_one', post: @post.to_index, name: pluck_param(:name), value: @uuid, modal_id: pluck_param(:show) = render 'posts/new_has_one', post: @post.to_index, name: pluck_param(:name), value: @uuid, modal_id: pluck_param(:modal_id)