From d5d31a6d947950cfb6239cdd25148897db5e8248 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 23 May 2024 17:47:21 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20bot=C3=B3n=20de=20guardar=20en=20el=20p?= =?UTF-8?q?ie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/posts/_htmx_form.haml | 7 +------ app/views/posts/attributes/_new_has_many.haml | 2 ++ config/locales/en.yml | 1 + config/locales/es.yml | 1 + 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/views/posts/_htmx_form.haml b/app/views/posts/_htmx_form.haml index 25c45aad..cd482b35 100644 --- a/app/views/posts/_htmx_form.haml +++ b/app/views/posts/_htmx_form.haml @@ -7,6 +7,7 @@ @param :dir [Symbol, String] :ruby options = { + id: base, multipart: true, class: 'form post ', 'hx-swap': params.require(:swap), @@ -29,13 +30,7 @@ %input{ type: 'hidden', name: 'name', value: params.require(:name) } %input{ type: 'hidden', name: 'base', value: params.require(:base) } - -# Botones de guardado - = render 'posts/submit', site: site, post: post - = hidden_field_tag "#{base}[layout]", post.layout.name -# Dibuja cada atributo = render 'posts/attributes', site: site, post: post, dir: dir, base: base, locale: locale - - -# Botones de guardado - = render 'posts/submit', site: site, post: post diff --git a/app/views/posts/attributes/_new_has_many.haml b/app/views/posts/attributes/_new_has_many.haml index 9382e2af..275d0335 100644 --- a/app/views/posts/attributes/_new_has_many.haml +++ b/app/views/posts/attributes/_new_has_many.haml @@ -90,3 +90,5 @@ = render 'bootstrap/modal', id: post_id, modal_content_attributes: { class: 'h-100' } do - content_for :"#{post_id}_body" do %div{ id: post_form_loaded_id } + - content_for :"#{post_id}_footer" do + = render 'bootstrap/btn', form: id, content: t('.save'), type: 'submit' diff --git a/config/locales/en.yml b/config/locales/en.yml index 9f4f7493..8fbfd536 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -944,3 +944,4 @@ en: cancel: "Cancel" edit: "Edit" filter: "Start typing to filter..." + save: "Save" diff --git a/config/locales/es.yml b/config/locales/es.yml index b85ac397..52ade5b2 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -952,3 +952,4 @@ es: cancel: "Cancelar" edit: "Editar" filter: "Empezá a escribir para filtrar..." + save: "Guardar"