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 8cdcd43b..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.mb-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/_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/moderation_queue/_account.haml b/app/views/moderation_queue/_account.haml index ab4fc4c7..412f0aa7 100644 --- a/app/views/moderation_queue/_account.haml +++ b/app/views/moderation_queue/_account.haml @@ -1,6 +1,6 @@ .row.no-gutters.pt-2 .col-1 - = render 'components/checkbox' + = render 'components/checkbox', id: profile['id'] .col-11 %h4 %a{href: profile['id']}= profile['preferredUsername'] diff --git a/app/views/moderation_queue/_comment.haml b/app/views/moderation_queue/_comment.haml index fea4570f..99059133 100644 --- a/app/views/moderation_queue/_comment.haml +++ b/app/views/moderation_queue/_comment.haml @@ -2,7 +2,7 @@ .flex.mx-4.my-5 .row.no-gutters .col-1 - = render 'components/checkbox' + = render 'components/checkbox', id: comment['id'] .col-11 .row.no-gutters .col-4 diff --git a/app/views/moderation_queue/_instance.haml b/app/views/moderation_queue/_instance.haml index 74bda75b..cff8a957 100644 --- a/app/views/moderation_queue/_instance.haml +++ b/app/views/moderation_queue/_instance.haml @@ -1,13 +1,13 @@ - host = instance['domain'] - host ||= instance['uri'] -- host = "https://#{host}" +- hosthttps = "https://#{host}" .row.no-gutters.pt-2 .col-1 - = render 'components/checkbox' + = render 'components/checkbox', id: host .col-11 %h4 - %a{ href: host }= instance['title'] + %a{ href: hosthttps }= instance['title'] %p= instance['description'].html_safe %p %span= t('.users') diff --git a/app/views/moderation_queue/_instances.haml b/app/views/moderation_queue/_instances.haml index d19ef8ed..c51ba74f 100644 --- a/app/views/moderation_queue/_instances.haml +++ b/app/views/moderation_queue/_instances.haml @@ -11,5 +11,5 @@ %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/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