5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 08:56:22 +00:00

fix: editar el post de has_one desde su modal #16665

This commit is contained in:
f 2024-07-04 15:05:58 -03:00
parent 338af3f0fe
commit e9e55945d9
No known key found for this signature in database
3 changed files with 6 additions and 4 deletions

View file

@ -1,2 +1,2 @@
= render 'posts/new_related_post', post: post = render 'posts/new_related_post', post: post, modal_id: modal_id
%input{ type: 'hidden', name: name, value: value } %input{ type: 'hidden', name: name, value: value }

View file

@ -1,4 +1,6 @@
:ruby :ruby
local_assigns[:modal_id] ||= 'generic_modal'
image = nil image = nil
description = nil description = nil
@ -6,9 +8,9 @@
description = post.post.image.value['description'] description = post.post.image.value['description']
end end
.col.mb-3.p-1 .col.mb-3.p-1{ data: { controller: 'modal' } }
= render('bootstrap/card', image: image, description: description, title: post.title, class: 'h-100') do = render('bootstrap/card', image: image, description: description, title: post.title, class: 'h-100') do
- if post.post.attribute?(:description) - if post.post.attribute?(:description)
%p.card-text= post.post.description.value %p.card-text= post.post.description.value
= link_to t('.edit'), edit_site_post_path(post.site, post.path), class: 'btn btn-secondary' = render 'bootstrap/btn', content: t('.edit'), data: { action: 'modal#showAnother', 'modal-show-value': local_assigns[:modal_id] }, id: random_id

View file

@ -34,7 +34,7 @@
.row.no-gutters.placeholder-glow{ id: target_id } .row.no-gutters.placeholder-glow{ id: target_id }
-# @todo issue-7537 -# @todo issue-7537
- if !metadata.empty? && (indexed_post = site.indexed_posts.find_by(post_id: metadata.value)) - if !metadata.empty? && (indexed_post = site.indexed_posts.find_by(post_id: metadata.value))
= render 'posts/new_has_one', post: indexed_post, name: name, value: metadata.value = render 'posts/new_has_one', post: indexed_post, name: name, value: metadata.value, modal_id: modal_id
-# -#
El modal se genera por fuera del formulario, para poder enviar los El modal se genera por fuera del formulario, para poder enviar los