From 30920529ab67738e327da3c39bfb3188037382a2 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 20 Apr 2023 18:11:43 -0300 Subject: [PATCH] feat: avisar que hay que publicar al cambiar la configuracion #13114 --- app/controllers/sites_controller.rb | 1 + app/views/layouts/_flash.haml | 2 +- config/locales/en.yml | 2 ++ config/locales/es.yml | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/sites_controller.rb b/app/controllers/sites_controller.rb index 63865e44..17287eb0 100644 --- a/app/controllers/sites_controller.rb +++ b/app/controllers/sites_controller.rb @@ -57,6 +57,7 @@ class SitesController < ApplicationController usuarie: current_usuarie) if service.update.valid? + flash[:notice] = I18n.t('sites.update.post') redirect_to site_posts_path(site, locale: site.default_locale) else render 'edit' diff --git a/app/views/layouts/_flash.haml b/app/views/layouts/_flash.haml index 7bd7ec0b..2d65ff78 100644 --- a/app/views/layouts/_flash.haml +++ b/app/views/layouts/_flash.haml @@ -1,4 +1,4 @@ - flash.each do |type, message| - unless type == 'js' = render 'bootstrap/alert' do - = message + = sanitize_markdown message, tags: %w[a strong em] diff --git a/config/locales/en.yml b/config/locales/en.yml index a39758bb..099f304d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -401,6 +401,8 @@ en: title: 'Edit %{site}' submit: 'Save changes' btn: 'Configuration' + update: + post: "Your changes have been saved. **If you enabled a publication method, don't forget to publish changes.**" form: errors: title: There were errors and we couldn't save your changes :( diff --git a/config/locales/es.yml b/config/locales/es.yml index a52519f7..bf2d8b93 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -407,6 +407,8 @@ es: title: 'Editar %{site}' submit: 'Guardar cambios' btn: 'Configuración' + update: + post: "Tus cambios han sido guardados. **Si agregaste un método de publicación, no te olvides de publicar cambios.**" form: errors: title: Hubo errores y no pudimos guardar tus cambios :(