From 3f288ab6e4a7806c29d472dd71f34d8d8265dd2f Mon Sep 17 00:00:00 2001 From: jazzari Date: Fri, 9 Feb 2024 14:45:12 -0300 Subject: [PATCH] fix: creados componentes botoneras de comentarios, instancias y cuentas, y movidos a app/views/components --- app/views/components/_btn_base.haml | 3 ++ app/views/components/_checkbox.haml | 3 +- app/views/components/_comments_btn_box.haml | 9 ++++++ app/views/components/_instances_btn_box.haml | 6 ++++ app/views/components/_profiles_btn_box.haml | 7 +++++ app/views/moderation_queue/_accounts.haml | 6 +--- app/views/moderation_queue/_btn_base.haml | 3 -- app/views/moderation_queue/_comments.haml | 8 +---- app/views/moderation_queue/_instances.haml | 7 ++--- .../moderation_queue/_remote_profile.haml | 7 +---- app/views/moderation_queue/index.haml | 6 ++-- app/views/posts/_moderation_queue.haml | 11 +------ app/views/posts/edit.haml | 4 +-- config/locales/es.yml | 30 +++++++++---------- 14 files changed, 53 insertions(+), 57 deletions(-) create mode 100644 app/views/components/_btn_base.haml create mode 100644 app/views/components/_comments_btn_box.haml create mode 100644 app/views/components/_instances_btn_box.haml create mode 100644 app/views/components/_profiles_btn_box.haml delete mode 100644 app/views/moderation_queue/_btn_base.haml diff --git a/app/views/components/_btn_base.haml b/app/views/components/_btn_base.haml new file mode 100644 index 00000000..2985d646 --- /dev/null +++ b/app/views/components/_btn_base.haml @@ -0,0 +1,3 @@ +-# Componente Botón general Moderación + +%button.btn.btn-lg.mx-2{ href: href, class: local_assigns[:class] }= text diff --git a/app/views/components/_checkbox.haml b/app/views/components/_checkbox.haml index ccf22e84..33630780 100644 --- a/app/views/components/_checkbox.haml +++ b/app/views/components/_checkbox.haml @@ -1,2 +1,3 @@ +-# Componente Checkbox .custom-control.custom-checkbox - %input{ type: 'checkbox', id: '', class: '' } \ No newline at end of file + %input{ type: 'checkbox', id: '', class: '' } diff --git a/app/views/components/_comments_btn_box.haml b/app/views/components/_comments_btn_box.haml new file mode 100644 index 00000000..aa755dcc --- /dev/null +++ b/app/views/components/_comments_btn_box.haml @@ -0,0 +1,9 @@ +-# Componente Botonera de Comentarios + +.d-flex.py-4 +- btn_class = 'btn-secondary' += render 'components/btn_base', text: t('.text_pause'), class: btn_class, href: '' += render 'components/btn_base', text: t('.text_reject'), class: btn_class, href: '' += render 'components/btn_base', text: t('.text_accept'), class: btn_class, href: '' += render 'components/btn_base', text: t('.text_reply'), class: btn_class, href: '' += render 'components/btn_base', text: t('.text_report'), class: btn_class, href: '' \ No newline at end of file diff --git a/app/views/components/_instances_btn_box.haml b/app/views/components/_instances_btn_box.haml new file mode 100644 index 00000000..854262c0 --- /dev/null +++ b/app/views/components/_instances_btn_box.haml @@ -0,0 +1,6 @@ +-# Componente botonera de moderación de Instancias + +- btn_class = 'btn btn-secondary' += render 'components/btn_base', text: t('.text_check'), class: btn_class, href: '' += render 'components/btn_base', text: t('.text_allow'), class: btn_class, href: '' += render 'components/btn_base', text: t('.text_deny'), class: btn_class, href: '' \ No newline at end of file diff --git a/app/views/components/_profiles_btn_box.haml b/app/views/components/_profiles_btn_box.haml new file mode 100644 index 00000000..2c63ce3a --- /dev/null +++ b/app/views/components/_profiles_btn_box.haml @@ -0,0 +1,7 @@ +-# Componente Botonera de Moderación de Cuentas (Remote_profile) + +- @class = 'btn-secondary' += render 'components/btn_base', text: t('.text_approve'), class: @class, href: '' += render 'components/btn_base', text: t('.text_check'), class: @class, href: '' += render 'components/btn_base', text: t('.text_deny'), class: @class, href: '' += render 'components/btn_base', text: t('.text_report'), class: @class, href: '' \ No newline at end of file diff --git a/app/views/moderation_queue/_accounts.haml b/app/views/moderation_queue/_accounts.haml index e954d2f3..e92c3a20 100644 --- a/app/views/moderation_queue/_accounts.haml +++ b/app/views/moderation_queue/_accounts.haml @@ -6,9 +6,5 @@ -# Botones de Moderación .d-flex.py-4 - - @class = 'btn-secondary' - = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_approve'), class: @class, href: '' - = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_check'), class: @class, href: '' - = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_deny'), class: @class, href: '' - = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_report'), class: @class, href: '' + = render 'components/profiles_btn_box' \ No newline at end of file diff --git a/app/views/moderation_queue/_btn_base.haml b/app/views/moderation_queue/_btn_base.haml deleted file mode 100644 index 7f6233cd..00000000 --- a/app/views/moderation_queue/_btn_base.haml +++ /dev/null @@ -1,3 +0,0 @@ --# Componente Botón general Moderación - -%button.btn.btn-lg.mx-2{ href: href, class: @class }= text diff --git a/app/views/moderation_queue/_comments.haml b/app/views/moderation_queue/_comments.haml index c5f7ae5d..d5f2b3bd 100644 --- a/app/views/moderation_queue/_comments.haml +++ b/app/views/moderation_queue/_comments.haml @@ -6,10 +6,4 @@ = render 'comment', comment: comment, profile: @remote_profile -# Botones moderación - .d-flex.py-4 - - @class = 'btn-secondary' - = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_pause'), class: @class, href: '' - = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_reject'), class: @class, href: '' - = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_accept'), class: @class, href: '' - = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_reply'), class: @class, href: '' - = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_report'), class: @class, href: '' \ No newline at end of file + = render 'components/comments_btn_box' \ No newline at end of file diff --git a/app/views/moderation_queue/_instances.haml b/app/views/moderation_queue/_instances.haml index fc249e46..26caaeca 100644 --- a/app/views/moderation_queue/_instances.haml +++ b/app/views/moderation_queue/_instances.haml @@ -5,11 +5,8 @@ = render 'moderation_queue/instance', instance: instance -# Botones moderación - .d-flex.py-4 - - btn_class = 'btn btn-secondary' - = render 'moderation_queue/btn_base', text: t('moderation_queue.instances_button_box.text_check'), class: btn_class, href: '' - = render 'moderation_queue/btn_base', text: t('moderation_queue.instances_button_box.text_allow'), class: btn_class, href: '' - = render 'moderation_queue/btn_base', text: t('moderation_queue.instances_button_box.text_deny'), class: btn_class, href: '' + .d-flex.py-5 + = render 'components/instances_btn_box' %h3.mt-5= t('moderation_queue.instances.title') %p= t('moderation_queue.instances.description') diff --git a/app/views/moderation_queue/_remote_profile.haml b/app/views/moderation_queue/_remote_profile.haml index 965f8854..ab29ae4d 100644 --- a/app/views/moderation_queue/_remote_profile.haml +++ b/app/views/moderation_queue/_remote_profile.haml @@ -14,9 +14,4 @@ %h4.my-2= t('.profile_name') + ': ' + remote_profile['name'] -# Botones de Moderación -.d-flex.py-4 - - @class = 'btn-secondary' - = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_approve'), class: @class, href: '' - = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_check'), class: @class, href: '' - = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_deny'), class: @class, href: '' - = render 'moderation_queue/btn_base', text: t('moderation_queue.profile_button_box.text_report'), class: @class, href: '' += render 'components/comments_btn_box' diff --git a/app/views/moderation_queue/index.haml b/app/views/moderation_queue/index.haml index b361c085..eae3b5a5 100644 --- a/app/views/moderation_queue/index.haml +++ b/app/views/moderation_queue/index.haml @@ -1,7 +1,7 @@ -.row.justify-content-center.mb-5 +.row.mb-5 %h1= t('.title') -.row.justify-content-center - .col-md-8 +.row + .col-md-10 - summary = t('.instances') = render 'layouts/details', summary: summary do = render 'moderation_queue/instances', site: @site, post: @post, moderation_queue: @moderation_queue diff --git a/app/views/posts/_moderation_queue.haml b/app/views/posts/_moderation_queue.haml index df17b1ff..e4a9683c 100644 --- a/app/views/posts/_moderation_queue.haml +++ b/app/views/posts/_moderation_queue.haml @@ -7,13 +7,4 @@ -# Botones moderación .d-flex.py-4 - - @class = 'btn-secondary' - = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_pause'), class: @class, href: '' - - @class = 'btn-secondary' - = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_reject'), class: @class, href: '' - - @class = 'btn-secondary' - = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_accept'), class: @class, href: '' - - @class = 'btn-secondary' - = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_reply'), class: @class, href: '' - - @class = 'btn-secondary' - = render 'moderation_queue/btn_base', text: t('moderation_queue.button_box.text_report'), class: @class, href: '' + = render 'components/comments_btn_box' diff --git a/app/views/posts/edit.haml b/app/views/posts/edit.haml index 2e46590e..a83c72af 100644 --- a/app/views/posts/edit.haml +++ b/app/views/posts/edit.haml @@ -1,5 +1,5 @@ -.row.justify-content-center - .col-md-8 +.row + .col-md-10 - summary = t('posts.edit.post') = render 'layouts/details', summary: summary do = render 'posts/form', site: @site, post: @post diff --git a/config/locales/es.yml b/config/locales/es.yml index 4aad1cc7..868f8fc6 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -36,6 +36,21 @@ es: submenu_reject: Rechazado block_lists: title: Listas de bloqueo + comments_btn_box: + text_pause: Pausa + text_reject: Rechazar + text_accept: Aceptar Publicación + text_reply: Responder + text_report: Reportar + instances_btn_box: + text_check: Moderar caso por caso + text_allow: Permitir todo + text_deny: Bloquear instancia + profiles_btn_box: + text_approve: Aprobar siempre + text_check: Revisar siempre + text_deny: Bloquear + text_report: Reportar moderation_queue: index: title: Actividades de moderación @@ -51,21 +66,6 @@ es: profile_id: ID profile_published: Publicada profile_summary: Resumen - profile_button_box: - text_approve: Aprobar siempre - text_check: Revisar siempre - text_deny: Bloquear - text_report: Reportar - button_box: - text_pause: Pausa - text_reject: Rechazar - text_accept: Aceptar Publicación - text_reply: Responder - text_report: Reportar - instances_button_box: - text_check: Moderar caso por caso - text_allow: Permitir todo - text_deny: Bloquear instancia instances: title: Mis listas de bloqueo description: Descripción de listas de bloqueo