From 0e83b09bf01a9903feb9629b5986e29219f7155c Mon Sep 17 00:00:00 2001 From: f Date: Tue, 4 Jun 2024 17:11:32 -0300 Subject: [PATCH] fix: new_has_one --- app/views/posts/attributes/_new_has_one.haml | 6 ++++-- config/locales/en.yml | 3 +++ config/locales/es.yml | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/views/posts/attributes/_new_has_one.haml b/app/views/posts/attributes/_new_has_one.haml index 5a614990..4235b9b3 100644 --- a/app/views/posts/attributes/_new_has_one.haml +++ b/app/views/posts/attributes/_new_has_one.haml @@ -38,7 +38,8 @@ datos y recibir su UUID en respuesta. - content_for :post_form do %div{ id: modal_id, data: { controller: 'modal' }} - - if layout.is_a?(String) + -# Si hay un solo layout o el post asociado ya existía + - if layout.is_a?(String) || metadata.has_one.present? = render 'bootstrap/modal', id: id, modal_content_attributes: { class: 'h-100' } do - content_for :"#{id}_body" do -# @todo ocultar el modal después de guardar @@ -47,7 +48,8 @@ - content_for :"#{id}_footer" do = render 'bootstrap/btn', form: form_id, content: t('.save'), type: 'submit', class: 'm-0 mt-1 mr-1' - = render 'bootstrap/btn', content: t('.cancel'), action: 'modal#hide', class: 'm-0 mt-1 mr-1' + = render 'bootstrap/btn', content: t('.close'), action: 'modal#hide', class: 'm-0 mt-1 mr-1' - else + -# @todo Implementar selección de layout para cargar el formulario correcto Nada diff --git a/config/locales/en.yml b/config/locales/en.yml index b432f11b..c9d988a4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -756,6 +756,8 @@ en: empty: "(Empty)" draft: label: Draft + new_has_one: + edit: "Edit" reorder: submit: 'Save order' select: 'Select this post' @@ -944,6 +946,7 @@ en: add: "Add %{layout}" add_new: "Add new option" cancel: "Cancel" + close: "Close" edit: "Edit" filter: "Start typing to filter..." save: "Save" diff --git a/config/locales/es.yml b/config/locales/es.yml index 7ffe4f90..8d3d7f74 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -764,6 +764,8 @@ es: empty: "(Vacío)" draft: label: Borrador + new_has_one: + edit: "Editar" reorder: submit: 'Guardar orden' select: 'Seleccionar este artículo' @@ -952,6 +954,7 @@ es: add: "Agregar %{layout}" add_new: "Agregar nueva opción" cancel: "Cancelar" + close: "Cerrar" edit: "Editar" filter: "Empezá a escribir para filtrar..." save: "Guardar"