From 067991e72b83c77d3fc63b14eae87377524dce61 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 28 May 2024 17:55:21 -0300 Subject: [PATCH] fix: mostrar los valores anteriores al editar --- app/views/posts/attributes/_new_belongs_to.haml | 5 +++-- .../posts/attributes/_new_has_and_belongs_to_many.haml | 6 ++++-- app/views/posts/attributes/_new_has_many.haml | 6 ++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/views/posts/attributes/_new_belongs_to.haml b/app/views/posts/attributes/_new_belongs_to.haml index afbc8bdd..0a2a4c5b 100644 --- a/app/views/posts/attributes/_new_belongs_to.haml +++ b/app/views/posts/attributes/_new_belongs_to.haml @@ -41,8 +41,9 @@ Para poder cancelar, mantenemos el estado original y desactivamos o activamos los ítemes según estén incluidos en esa lista o no. .row.row-cols-3.row-cols-md-4.no-gutters.placeholder-glow{ data: { target: 'array.current' } } - - metadata.values.slice(*metadata.value).each do |value| - = render 'posts/new_array_value', value: value + -# @todo issue-7537 + - if !metadata.empty? && (indexed_post = site.indexed_posts.find_by(post_id: metadata.value)) + = render 'posts/new_related_post', post: indexed_post = render 'bootstrap/modal', id: id, modal_content_attributes: { class: 'h-100' }, hide_actions: ['array#cancel'] do - content_for :"#{id}_header" do diff --git a/app/views/posts/attributes/_new_has_and_belongs_to_many.haml b/app/views/posts/attributes/_new_has_and_belongs_to_many.haml index 143ad2d1..0b53f0ae 100644 --- a/app/views/posts/attributes/_new_has_and_belongs_to_many.haml +++ b/app/views/posts/attributes/_new_has_and_belongs_to_many.haml @@ -40,8 +40,10 @@ Para poder cancelar, mantenemos el estado original y desactivamos o activamos los ítemes según estén incluidos en esa lista o no. .row.row-cols-3.row-cols-md-4.no-gutters.placeholder-glow{ data: { target: 'array.current' } } - - metadata.values.slice(*metadata.value).each do |value| - = render 'posts/new_array_value', value: value + -# @todo issue-7537 + - metadata.value.each do |uuid| + - if (indexed_post = site.indexed_posts.find_by(post_id: uuid)) + = render 'posts/new_related_post', post: indexed_post = render 'bootstrap/modal', id: id, modal_content_attributes: { class: 'h-100' }, hide_actions: ['array#cancel'] do - content_for :"#{id}_header" do diff --git a/app/views/posts/attributes/_new_has_many.haml b/app/views/posts/attributes/_new_has_many.haml index 143ad2d1..0b53f0ae 100644 --- a/app/views/posts/attributes/_new_has_many.haml +++ b/app/views/posts/attributes/_new_has_many.haml @@ -40,8 +40,10 @@ Para poder cancelar, mantenemos el estado original y desactivamos o activamos los ítemes según estén incluidos en esa lista o no. .row.row-cols-3.row-cols-md-4.no-gutters.placeholder-glow{ data: { target: 'array.current' } } - - metadata.values.slice(*metadata.value).each do |value| - = render 'posts/new_array_value', value: value + -# @todo issue-7537 + - metadata.value.each do |uuid| + - if (indexed_post = site.indexed_posts.find_by(post_id: uuid)) + = render 'posts/new_related_post', post: indexed_post = render 'bootstrap/modal', id: id, modal_content_attributes: { class: 'h-100' }, hide_actions: ['array#cancel'] do - content_for :"#{id}_header" do