5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 21:46: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 }

View file

@ -1,4 +1,6 @@
:ruby
local_assigns[:modal_id] ||= 'generic_modal'
image = nil
description = nil
@ -6,9 +8,9 @@
description = post.post.image.value['description']
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
- if post.post.attribute?(:description)
%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 }
-# @todo issue-7537
- 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