diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index ef36c3be..240e61a5 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -572,7 +572,7 @@ $bezier: cubic-bezier(0.75, 0, 0.25, 1); position: absolute; left: 97%; bottom: 3%; - transform: rotate(60deg); + transform: rotate(180deg); } &[open] { & > summary { @@ -584,4 +584,6 @@ $bezier: cubic-bezier(0.75, 0, 0.25, 1); } - +hr { + border-bottom: 1px solid #dee2e6; +} \ No newline at end of file diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f673ee83..eca479fe 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -32,6 +32,7 @@ class ApplicationController < ActionController::Base @moderation_queue = YAML.safe_load(File.read(Rails.root.join('db', 'seeds', 'moderation_queue.yaml'))) @remote_profile = YAML.safe_load(File.read(Rails.root.join('db', 'seeds', 'remote_profile.yaml'))) @instances = YAML.safe_load(File.read(Rails.root.join('db', 'seeds', 'instances.yaml'))) + @blocklists= YAML.safe_load(File.read(Rails.root.join('db', 'seeds', 'blocklists.yml'))) @moderation_queue.each do |activity| activity['attributedTo'] = @remote_profile end diff --git a/app/views/components/_block_list.haml b/app/views/components/_block_list.haml new file mode 100644 index 00000000..c2af3262 --- /dev/null +++ b/app/views/components/_block_list.haml @@ -0,0 +1,6 @@ +-# Componente Listas de bloqueo de Instancias +.card.mt-3.mb-3 + .card-body + .d-flex.flex-row + = render 'components/checkbox', id: blocklist["id"] do + %span.h4= blocklist["title"] diff --git a/app/views/components/_block_lists.haml b/app/views/components/_block_lists.haml index 7d9d741d..1e9cd76f 100644 --- a/app/views/components/_block_lists.haml +++ b/app/views/components/_block_lists.haml @@ -1,6 +1,2 @@ --# Componente Listas de bloqueo de Instancias -.card.mt-3 - .card-body - .d-flex.flex-row - = render 'components/checkbox' - %h4.ml-5= t('.title') +- @blocklists.each do |blocklist| + = render 'components/block_list', blocklist: blocklist diff --git a/app/views/components/_btn_base.haml b/app/views/components/_btn_base.haml index 2985d646..7fa507ca 100644 --- a/app/views/components/_btn_base.haml +++ b/app/views/components/_btn_base.haml @@ -1,3 +1,3 @@ -# Componente Botón general Moderación -%button.btn.btn-lg.mx-2{ href: href, class: local_assigns[:class] }= text +%button.btn{ href: href, class: local_assigns[:class] }= text diff --git a/app/views/components/_checkbox.haml b/app/views/components/_checkbox.haml index 3444720e..27f9a776 100644 --- a/app/views/components/_checkbox.haml +++ b/app/views/components/_checkbox.haml @@ -1,3 +1,4 @@ -# Componente Checkbox -.custom-control.custom-checkbox.p-0 - %input{ type: 'checkbox', id: local_assigns[:id], class: local_assigns[:class] } +.custom-control.custom-checkbox + %input.custom-control-input{ type: 'checkbox', id: id, name: id, class: local_assigns[:class] } + %label.custom-control-label{ for: id }= yield diff --git a/app/views/components/_comments_btn_box.haml b/app/views/components/_comments_btn_box.haml index 0487c3db..8b8d7268 100644 --- a/app/views/components/_comments_btn_box.haml +++ b/app/views/components/_comments_btn_box.haml @@ -1,9 +1,8 @@ -# 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 +- btn_class = 'btn-secondary py-1 px-2' += 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/moderation_queue/_account.haml b/app/views/moderation_queue/_account.haml index 85fe96d5..412f0aa7 100644 --- a/app/views/moderation_queue/_account.haml +++ b/app/views/moderation_queue/_account.haml @@ -1,2 +1,7 @@ -%a{href: profile['id']}= profile['preferredUsername'] -=profile['summary'].html_safe \ No newline at end of file +.row.no-gutters.pt-2 + .col-1 + = render 'components/checkbox', id: profile['id'] + .col-11 + %h4 + %a{href: profile['id']}= profile['preferredUsername'] + =profile['summary'].html_safe diff --git a/app/views/moderation_queue/_accounts.haml b/app/views/moderation_queue/_accounts.haml index e92c3a20..9a6738bd 100644 --- a/app/views/moderation_queue/_accounts.haml +++ b/app/views/moderation_queue/_accounts.haml @@ -2,9 +2,10 @@ = render 'components/profiles_filters' - @moderation_queue.map{ |c| c['attributedTo'] }.uniq.each do |remote_profile| + %hr = render 'account', profile: remote_profile -# Botones de Moderación -.d-flex.py-4 +.d-flex.pb-4 = render 'components/profiles_btn_box' - \ No newline at end of file + diff --git a/app/views/moderation_queue/_block_instances_textarea.haml b/app/views/moderation_queue/_block_instances_textarea.haml index 0c0f55ca..9b388a0d 100644 --- a/app/views/moderation_queue/_block_instances_textarea.haml +++ b/app/views/moderation_queue/_block_instances_textarea.haml @@ -1,4 +1,5 @@ .form-group - .d-flex.flex-column.mt-5 - %textarea.mb-3{ name: '', id: '', placeholder: t('moderation_queue.instances.custom_block') } - %button.col.btn.btn-secondary{ type: 'submit' }= t('moderation_queue.instances.submit') + = label_tag "custom_blocklist", t('moderation_queue.instances.custom_block') + = text_area_tag "custom_blocklist", nil, class: 'form-control' + %button.btn.btn-secondary.mt-3{ type: 'submit' }= t('moderation_queue.instances.submit') + diff --git a/app/views/moderation_queue/_comment.haml b/app/views/moderation_queue/_comment.haml index fea4570f..a066f845 100644 --- a/app/views/moderation_queue/_comment.haml +++ b/app/views/moderation_queue/_comment.haml @@ -1,13 +1,15 @@ -# Componente Comentario -.flex.mx-4.my-5 +.flex.mx-4.my-4 .row.no-gutters .col-1 - = render 'components/checkbox' + = render 'components/checkbox', id: comment['id'] .col-11 .row.no-gutters - .col-4 - %p= comment['published'].to_datetime.strftime(t('date.format')) - .col-8 + .col-5.col-sm-3.col-lg-4 + %p + %span= comment['published'].to_datetime.strftime(t('date.format')) + %span= comment['published'].to_datetime.strftime(t('time.format')) + .col-7.col-sm-9.col-lg-8 %dl %dt.d-inline.mr-2= t('.source_profile') %dd.d-inline @@ -17,9 +19,14 @@ .row.no-gutters .col.p-0 %p - %span.mr-3= t('.reply_to') + %span= t('.reply_to') %span %a{ href: comment['inReplyTo'] }= comment['inReplyTo'] .row.no-gutters .col.p-0 - %p= comment['content'].html_safe + - if comment['summary'] + - summary = comment['summary'] + = render 'layouts/details', summary: summary do + %p= comment['content'].html_safe + - else + %p= comment['content'].html_safe diff --git a/app/views/moderation_queue/_comments.haml b/app/views/moderation_queue/_comments.haml index d51909a3..0e6ce334 100644 --- a/app/views/moderation_queue/_comments.haml +++ b/app/views/moderation_queue/_comments.haml @@ -2,7 +2,9 @@ = render 'components/comments_filters' - moderation_queue.each do |comment| + %hr = render 'comment', comment: comment, profile: comment['attributedTo'] -# Botones moderación - = render 'components/comments_btn_box', comment: comment \ No newline at end of file + .d-flex.justify-content-center + = render 'components/comments_btn_box', comment: comment \ No newline at end of file diff --git a/app/views/moderation_queue/_instance.haml b/app/views/moderation_queue/_instance.haml index eb5d6581..cff8a957 100644 --- a/app/views/moderation_queue/_instance.haml +++ b/app/views/moderation_queue/_instance.haml @@ -1,11 +1,16 @@ - host = instance['domain'] - host ||= instance['uri'] -- host = "https://#{host}" +- hosthttps = "https://#{host}" -%a{ href: host }= instance['title'] -%p= instance['description'].html_safe -%p - %span= t('.users') - %span - = instance.dig('usage', 'users', 'active_month') - = instance.dig('stats', 'user_count') +.row.no-gutters.pt-2 + .col-1 + = render 'components/checkbox', id: host + .col-11 + %h4 + %a{ href: hosthttps }= instance['title'] + %p= instance['description'].html_safe + %p + %span= t('.users') + %span + = instance.dig('usage', 'users', 'active_month') + = instance.dig('stats', 'user_count') diff --git a/app/views/moderation_queue/_instances.haml b/app/views/moderation_queue/_instances.haml index c34bc022..1accf60d 100644 --- a/app/views/moderation_queue/_instances.haml +++ b/app/views/moderation_queue/_instances.haml @@ -2,13 +2,15 @@ = render 'components/instances_filters' - @instances.each do |instance| + %hr = render 'moderation_queue/instance', instance: instance -# Botones moderación - .d-flex.py-5 + .d-flex.pb-4 = render 'components/instances_btn_box' +%hr %h3.mt-5= t('moderation_queue.instances.title') %lead= t('moderation_queue.instances.description') -= render 'components/block_lists' += render 'components/block_lists', blocklists: @blocklists = render 'moderation_queue/block_instances_textarea' diff --git a/app/views/moderation_queue/index.haml b/app/views/moderation_queue/index.haml index 982a41c8..ab98ee30 100644 --- a/app/views/moderation_queue/index.haml +++ b/app/views/moderation_queue/index.haml @@ -6,9 +6,11 @@ - summary = t('.instances') = render 'layouts/details', summary: summary do = render 'moderation_queue/instances', site: @site, post: @post, moderation_queue: @moderation_queue + %hr - summary = t('.accounts') = render 'layouts/details', summary: summary do = render 'moderation_queue/accounts', site: @site, post: @post, moderation_queue: @moderation_queue + %hr - summary = t('.comments') = render 'layouts/details', summary: summary do = render 'moderation_queue/comments', 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 6921acbb..2be35f7f 100644 --- a/app/views/posts/_moderation_queue.haml +++ b/app/views/posts/_moderation_queue.haml @@ -5,5 +5,5 @@ = render 'moderation_queue/comment', comment: comment, profile: comment['attributedTo'] -# Botones moderación - .d-flex.py-4 + .d-flex = render 'components/comments_btn_box' diff --git a/config/locales/en.yml b/config/locales/en.yml index d6a15d4b..1b4f2d86 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -48,58 +48,59 @@ en: time: am: am pm: pm + format: '%-I:%M %p' components: - instances_filters: - text_show: Show - text_checked: With the checked - instances_checked_submenu: - submenu_case: Check case by case - submenu_allow: Allow everything - submenu_reject: Reject - instances_show_submenu: - submenu_allow: Allow - submenu_reject: Reject - comments_filters: - text_show: Sho - text_checked: With the checked - comments_checked_submenu: - submenu_pause: Pause - submenu_accept: Accept - submenu_reject: Reject - comments_show_submenu: - submenu_pause: Pause - submenu_accept: Accept - submenu_report: Report - submenu_reject: Reject - profiles_filters: - text_show: Show - text_checked: With the checked - profiles_checked_submenu: - submenu_pause: Pause - submenu_accept: Accept - submenu_reject: Reject - submenu_block: Block - profiles_show_submenu: - submenu_accept: Accept - submenu_block: Block - submenu_reject: Reject - block_lists: - title: Block lists - comments_btn_box: - text_pause: Pause - text_reject: Reject - text_accept: Accept - text_reply: Reply - text_report: Report - instances_btn_box: - text_check: Check case by case - text_allow: Allow everything - text_deny: Block instance - profiles_btn_box: - text_approve: Always approve - text_check: Always check - text_deny: Block - text_report: Report + instances_filters: + text_show: Show + text_checked: With selected + instances_checked_submenu: + submenu_case: Check case by case + submenu_allow: Allow everything + submenu_reject: Reject + instances_show_submenu: + submenu_allow: Allow + submenu_reject: Reject + comments_filters: + text_show: Show + text_checked: With selected + comments_checked_submenu: + submenu_pause: Pause + submenu_accept: Accept + submenu_reject: Reject + comments_show_submenu: + submenu_pause: Pause + submenu_accept: Accept + submenu_report: Report + submenu_reject: Reject + profiles_filters: + text_show: Show + text_checked: With selected + profiles_checked_submenu: + submenu_pause: Pause + submenu_accept: Accept + submenu_reject: Reject + submenu_block: Block + profiles_show_submenu: + submenu_accept: Accept + submenu_block: Block + submenu_reject: Reject + block_lists: + title: Block lists + comments_btn_box: + text_pause: Pause + text_reject: Reject + text_accept: Accept + text_reply: Reply + text_report: Report + instances_btn_box: + text_check: Check case by case + text_allow: Allow everything + text_deny: Block instance + profiles_btn_box: + text_approve: Always approve + text_check: Always check + text_deny: Block + text_report: Report moderation_queue: index: title: Moderation diff --git a/config/locales/es.yml b/config/locales/es.yml index 65df27bf..e277f76b 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -48,6 +48,7 @@ es: time: am: am pm: pm + format: '%-H:%M' components: instances_filters: text_show: Ver diff --git a/db/seeds/blocklists.yml b/db/seeds/blocklists.yml new file mode 100644 index 00000000..d9f9dd6f --- /dev/null +++ b/db/seeds/blocklists.yml @@ -0,0 +1,5 @@ +--- +- id: gardenfence + title: Gardenfence +- id: lista + title: Lista