From fc39a780ffdb9a651675c21031272212bf8a245c Mon Sep 17 00:00:00 2001 From: f Date: Fri, 6 Sep 2024 16:11:20 -0300 Subject: [PATCH 1/2] feat: no mostrar el campo borrador a les invitades #17343 --- app/views/posts/attributes/_boolean.haml | 26 ++++++++++++++---------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/app/views/posts/attributes/_boolean.haml b/app/views/posts/attributes/_boolean.haml index 6928ebd7..050ede70 100644 --- a/app/views/posts/attributes/_boolean.haml +++ b/app/views/posts/attributes/_boolean.haml @@ -1,12 +1,16 @@ -.form-check - = hidden_field_tag "#{base}[#{attribute}]", '0', id: nil - .custom-control.custom-switch - = check_box_tag "#{base}[#{attribute}]", '1', metadata.value, - class: "custom-control-input #{invalid(post, attribute)}", - aria: { describedby: id_for_help(attribute) }, - autofocus: autofocus - = label_tag "#{base}_#{attribute}", post_label_t(attribute, post: post), - class: 'custom-control-label' +-# TODO: convertir los atributos draft a un tipo +- if attribute == :draft && site.invitade?(current_usuarie) + -# Nada +- else + .form-check + = hidden_field_tag "#{base}[#{attribute}]", '0', id: nil + .custom-control.custom-switch + = check_box_tag "#{base}[#{attribute}]", '1', metadata.value, + class: "custom-control-input #{invalid(post, attribute)}", + aria: { describedby: id_for_help(attribute) }, + autofocus: autofocus + = label_tag "#{base}_#{attribute}", post_label_t(attribute, post: post), + class: 'custom-control-label' - = render 'posts/attribute_feedback', - post: post, attribute: attribute, metadata: metadata + = render 'posts/attribute_feedback', + post: post, attribute: attribute, metadata: metadata From 65ed03e0eb6cbfc8bf4fe8a01859bfc0ac155137 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 14 Oct 2024 15:18:51 -0300 Subject: [PATCH 2/2] fix: informar usuarie que no pudo acceder para debug closes #17571 --- app/controllers/concerns/exception_handler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/exception_handler.rb b/app/controllers/concerns/exception_handler.rb index a47278db..fa6415a8 100644 --- a/app/controllers/concerns/exception_handler.rb +++ b/app/controllers/concerns/exception_handler.rb @@ -32,7 +32,7 @@ module ExceptionHandler flash[:error] = I18n.t('errors.page_unauthorized') - ExceptionNotifier.notify_exception(exception) + ExceptionNotifier.notify_exception(exception, data: { usuarie: current_usuarie.id }) redirect_to site_path(site) end