From dbdce703c3e40065e7b9588e44ec38420e990bfd Mon Sep 17 00:00:00 2001 From: jazzari Date: Wed, 7 Feb 2024 14:42:25 -0300 Subject: [PATCH] fix: corregidos botones en comentarios, instancias y cuentas #15028 --- app/helpers/moderation_queue_helper.rb | 63 ------------------- app/views/moderation_queue/_accounts.haml | 15 ++++- app/views/moderation_queue/_btn_base.haml | 2 +- app/views/moderation_queue/_button_box.haml | 6 -- app/views/moderation_queue/_comments.haml | 16 ++++- app/views/moderation_queue/_instances.haml | 14 ++++- .../moderation_queue/_remote_profile.haml | 15 ++++- app/views/posts/_moderation_queue.haml | 17 ++++- 8 files changed, 64 insertions(+), 84 deletions(-) delete mode 100644 app/helpers/moderation_queue_helper.rb delete mode 100644 app/views/moderation_queue/_button_box.haml diff --git a/app/helpers/moderation_queue_helper.rb b/app/helpers/moderation_queue_helper.rb deleted file mode 100644 index 16be2a51..00000000 --- a/app/helpers/moderation_queue_helper.rb +++ /dev/null @@ -1,63 +0,0 @@ -module ModerationQueueHelper - - # parámetros de botones: - # text: [texto del botón] - # class: [clases css] - # href: [href del botón] - def botoneras_moderation_queue - # botones de comentarios - @btn_params = [[t('moderation_queue.button_box.text_pause'), 'btn-secondary', ''], - [t('moderation_queue.button_box.text_reject'), 'btn-primary', ''], - [t('moderation_queue.button_box.text_accept'), 'bg-blue white', ''], - [t('moderation_queue.button_box.text_reply'), 'btn-outline-primary', ''], - [t('moderation_queue.button_box.text_report'), 'btn-danger', '']] - - #botones de remote_profile (cuentas) - @profile_btn_params = [[t('moderation_queue.profile_button_box.text_approve'), 'btn-success', ''], - [t('moderation_queue.profile_button_box.text_check'), 'btn-outline-success', ''], - [t('moderation_queue.profile_button_box.text_deny'), 'bg-blue white', ''], - [t('moderation_queue.profile_button_box.text_report'), 'btn-danger', '']] - - #botones de instances (instancias) - @instances_btn_params = [[t('moderation_queue.instances_button_box.text_check'), 'btn-outline-success', ''], - [t('moderation_queue.instances_button_box.text_allow'), 'btn-success', ''], - [t('moderation_queue.instances_button_box.text_deny'), 'btn-danger', '']] - end - - # parámetros de filtros: - # text: [texto del botón] - # href: [href del botón] - def filtros_moderation_queue - #filtros de comentarios - @comment_filter_params = { - t('moderation_queue.filter_box.text_checked') => - [ - [t('moderation_queue.filter_box.submenu_pause'), '/sutty.nl'], - [t('moderation_queue.filter_box.submenu_reject'), '#reject'], - [t('moderation_queue.filter_box.submenu_accept'),'#accept'] - ], - t('moderation_queue.filter_box.text_show') => - [ - [t('moderation_queue.filter_box.submenu_pause'), '#pause'], - [t('moderation_queue.filter_box.submenu_reject'), '#reject'], - [t('moderation_queue.filter_box.submenu_accept'),'#accept'], - [t('moderation_queue.filter_box.submenu_report'), '#report'] - ] - } - - #filtros de instancias - @instances_filter_params = { - t('moderation_queue.filter_box.text_checked') => - [ - [t('moderation_queue.filter_box.submenu_case'), '#case_by_case'], - [t('moderation_queue.filter_box.submenu_allow'), '#allow'], - [t('moderation_queue.filter_box.submenu_reject'),'#reject'] - ], - t('moderation_queue.filter_box.text_show') => - [ - [t('moderation_queue.filter_box.submenu_allow'), '#allow'], - [t('moderation_queue.filter_box.submenu_reject'), '#reject'] - ] - } - end -end \ No newline at end of file diff --git a/app/views/moderation_queue/_accounts.haml b/app/views/moderation_queue/_accounts.haml index fcdfdce6..825b77c2 100644 --- a/app/views/moderation_queue/_accounts.haml +++ b/app/views/moderation_queue/_accounts.haml @@ -1,5 +1,4 @@ -- botoneras_moderation_queue - +-# Filtros .d-flex.py-2.justify-content-center = render 'components/dropdown', text: t('moderation_queue.filter_box.text_checked') do = render 'components/dropdown_item', text: t('moderation_queue.filter_box.submenu_case'), path: '/' @@ -11,4 +10,14 @@ - @moderation_queue.map{|c| c['attributedTo']}.uniq.each do |remote_profile| = render 'account', profile: remote_profile -= render 'moderation_queue/button_box', btn_params: @profile_btn_params + +-# Botones de Moderación +.d-flex.py-4.justify-content-center + - @class = 'btn-success' + = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_approve'), class: @class, href: '' + - @class = 'btn-outline-success' + = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_check'), class: @class, href: '' + - @class = 'bg-blue white' + = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_deny'), class: @class, href: '' + - @class = 'btn-danger' + = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_report'), class: @class, href: '' diff --git a/app/views/moderation_queue/_btn_base.haml b/app/views/moderation_queue/_btn_base.haml index 0f9d7c08..41349ec5 100644 --- a/app/views/moderation_queue/_btn_base.haml +++ b/app/views/moderation_queue/_btn_base.haml @@ -1,3 +1,3 @@ -# Componente Botón general Moderación -%a.btn.btn-lg.rounded.mx-2{role: 'button', href: href, class: @class} #{text} +%button.btn.btn-lg.rounded.mx-2{ href: href, class: @class } #{text} diff --git a/app/views/moderation_queue/_button_box.haml b/app/views/moderation_queue/_button_box.haml deleted file mode 100644 index 8971a780..00000000 --- a/app/views/moderation_queue/_button_box.haml +++ /dev/null @@ -1,6 +0,0 @@ --# Componente Botonera de Moderación - -.d-flex.py-4.justify-content-center - - btn_params.each do |btn| - - @class = btn[1] - = render 'moderation_queue/btn_base', href: btn[2], class: @class, text: btn[0] diff --git a/app/views/moderation_queue/_comments.haml b/app/views/moderation_queue/_comments.haml index 39c8cfae..8bb11eec 100644 --- a/app/views/moderation_queue/_comments.haml +++ b/app/views/moderation_queue/_comments.haml @@ -1,4 +1,4 @@ -- botoneras_moderation_queue +-# Filtros .d-flex.py-2.justify-content-center = render 'components/dropdown', text: t('moderation_queue.filter_box.text_checked') do = render 'components/dropdown_item', text: t('moderation_queue.filter_box.submenu_pause'), path: '/' @@ -13,4 +13,16 @@ - moderation_queue.each do |comment| = render 'comment', comment: comment, profile: @remote_profile - = render 'moderation_queue/button_box', btn_params: @btn_params \ No newline at end of file + + -# Botones moderación + .d-flex.py-4.justify-content-center + - @class = 'btn-secondary' + = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_pause'), class: @class, href: '' + - @class = 'btn-primary' + = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_reject'), class: @class, href: '' + - @class = 'bg-blue white' + = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_accept'), class: @class, href: '' + - @class = 'btn-outline-primary' + = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_reply'), class: @class, href: '' + - @class = 'btn-danger' + = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_report'), class: @class, href: '' \ No newline at end of file diff --git a/app/views/moderation_queue/_instances.haml b/app/views/moderation_queue/_instances.haml index 88a1e11c..7af106ee 100644 --- a/app/views/moderation_queue/_instances.haml +++ b/app/views/moderation_queue/_instances.haml @@ -1,5 +1,4 @@ -- botoneras_moderation_queue - +-# Filtros .d-flex.py-2.justify-content-center = render 'components/dropdown', text: t('moderation_queue.filter_box.text_checked') do = render 'components/dropdown_item', text: t('moderation_queue.filter_box.submenu_case'), path: '/' @@ -11,7 +10,16 @@ - @instances.each do |instance| = render 'moderation_queue/instance', instance: instance - = render 'moderation_queue/button_box', btn_params: @instances_btn_params + + + -# Botones moderación + .d-flex.py-4.justify-content-center + - @class = 'btn-outline-success' + = render 'moderation_queue/btn_base', text: t('moderation_queue.instances_button_box.text_check'), class: @class, href: '' + - @class = 'btn-success' + = render 'moderation_queue/btn_base', text: t('moderation_queue.instances_button_box.text_check'), class: @class, href: '' + - @class = 'btn-danger' + = render 'moderation_queue/btn_base', text: t('moderation_queue.instances_button_box.text_check'), class: @class, href: '' %h3.cyan.mt-5= t('moderation_queue.instances.title') %p.pb-2= t('moderation_queue.instances.description') diff --git a/app/views/moderation_queue/_remote_profile.haml b/app/views/moderation_queue/_remote_profile.haml index b50d63e6..a972b051 100644 --- a/app/views/moderation_queue/_remote_profile.haml +++ b/app/views/moderation_queue/_remote_profile.haml @@ -1,8 +1,7 @@ -# Componente Remote_Profile .flex.py-2.mx-2.text-center - - botoneras_moderation_queue - + -# Filtros .d-flex.py-2.justify-content-center = render 'components/dropdown', text: t('moderation_queue.filter_box.text_checked') do = render 'components/dropdown_item', text: t('moderation_queue.filter_box.submenu_pause'), path: '/' @@ -19,4 +18,14 @@ %h5= t('.profile_published') + ': ' + remote_profile['published'].to_datetime.strftime('%m/%d/%Y') %h5= t('.profile_summary') + ':' %p= sanitize remote_profile['summary'] - = render 'moderation_queue/button_box', btn_params: @profile_btn_params + +-# Botones de Moderación +.d-flex.py-4.justify-content-center + - @class = 'btn-success' + = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_approve'), class: @class, href: '' + - @class = 'btn-outline-success' + = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_check'), class: @class, href: '' + - @class = 'bg-blue white' + = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_deny'), class: @class, href: '' + - @class = 'btn-danger' + = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_report'), class: @class, href: '' diff --git a/app/views/posts/_moderation_queue.haml b/app/views/posts/_moderation_queue.haml index 34e30538..e7bbfd22 100644 --- a/app/views/posts/_moderation_queue.haml +++ b/app/views/posts/_moderation_queue.haml @@ -1,6 +1,6 @@ .flex %h3.text-center.py-2 Comentarios - - botoneras_moderation_queue + -# Filtros .d-flex.py-2.justify-content-center = render 'components/dropdown', text: t('moderation_queue.filter_box.text_checked') do = render 'components/dropdown_item', text: t('moderation_queue.filter_box.submenu_pause'), path: '/' @@ -14,5 +14,16 @@ - moderation_queue.each do |comment| = render 'moderation_queue/comment', comment: comment, profile: @remote_profile - .row.d-flex.justify-content-center - = render 'moderation_queue/button_box', btn_params: @btn_params + + -# Botones moderación + .d-flex.py-4.justify-content-center + - @class = 'btn-secondary' + = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_pause'), class: @class, href: '' + - @class = 'btn-primary' + = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_reject'), class: @class, href: '' + - @class = 'bg-blue white' + = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_accept'), class: @class, href: '' + - @class = 'btn-outline-primary' + = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_reply'), class: @class, href: '' + - @class = 'btn-danger' + = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_report'), class: @class, href: ''