mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 19:26:21 +00:00
feat: poder seleccionar todas las instancias
This commit is contained in:
parent
e78f71f25a
commit
761d68604b
5 changed files with 34 additions and 18 deletions
11
app/javascript/controllers/select_all_controller.js
Normal file
11
app/javascript/controllers/select_all_controller.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import { Controller } from "stimulus";
|
||||||
|
|
||||||
|
export default class extends Controller {
|
||||||
|
static targets = ["toggle", "input"];
|
||||||
|
|
||||||
|
toggle(event = undefined) {
|
||||||
|
this.inputTargets.forEach(input => {
|
||||||
|
input.checked = this.toggleTarget.checked;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
-# Componente Checkbox
|
-# Componente Checkbox
|
||||||
.custom-control.custom-checkbox
|
.custom-control.custom-checkbox
|
||||||
%input.custom-control-input{ type: 'checkbox', id: id, name: id, class: local_assigns[:class] }
|
%input.custom-control-input{ type: 'checkbox', id: id, name: id, **local_assigns }
|
||||||
%label.custom-control-label{ for: id }= yield
|
%label.custom-control-label{ for: id }= yield
|
||||||
|
|
4
app/views/components/_select_all.haml
Normal file
4
app/views/components/_select_all.haml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
-#
|
||||||
|
@param id [String]
|
||||||
|
= render 'components/checkbox', id: id, data: { action: 'select-all#toggle', target: 'select-all.toggle' } do
|
||||||
|
%span.sr-only= t('.label')
|
|
@ -1,6 +1,6 @@
|
||||||
.row.no-gutters.pt-2
|
.row.no-gutters.pt-2
|
||||||
.col-1
|
.col-1
|
||||||
= render 'components/checkbox', id: instance.hostname
|
= render 'components/checkbox', id: instance.hostname, data: { target: 'select-all.input' }
|
||||||
.col-11
|
.col-11
|
||||||
%h4
|
%h4
|
||||||
%a{ href: instance.uri }= instance.content['title']
|
%a{ href: instance.uri }= instance.content['title']
|
||||||
|
|
|
@ -1,24 +1,25 @@
|
||||||
.row.no-gutters.pt-2
|
.row.no-gutters.pt-2{ data: { controller: 'select-all' } }
|
||||||
.col-1.d-flex.align-items-center
|
.col-1.d-flex.align-items-center
|
||||||
= render 'components/checkbox', id: 'all' do
|
= render 'components/select_all', id: 'instances'
|
||||||
%span.sr-only= t('moderation_queue.everything')
|
|
||||||
.col-11
|
.col-11
|
||||||
-# Filtros
|
-# Filtros
|
||||||
= render 'components/instances_filters'
|
= render 'components/instances_filters'
|
||||||
|
|
||||||
- if instance_moderations.count.zero?
|
.col-12
|
||||||
%h3= t('moderation_queue.nothing')
|
- if instance_moderations.count.zero?
|
||||||
|
%h3= t('moderation_queue.nothing')
|
||||||
|
|
||||||
- instance_moderations.each do |instance_moderation|
|
- instance_moderations.each do |instance_moderation|
|
||||||
%hr
|
%hr
|
||||||
= render 'moderation_queue/instance', instance: instance_moderation.instance
|
= render 'moderation_queue/instance', instance: instance_moderation.instance
|
||||||
|
|
||||||
-# Botones moderación
|
-# Botones moderación
|
||||||
.d-flex.pb-4
|
.d-flex.pb-4
|
||||||
= render 'components/instances_btn_box', site: site, instance_moderation: instance_moderation
|
= render 'components/instances_btn_box', site: site, instance_moderation: instance_moderation
|
||||||
|
|
||||||
%hr
|
%hr
|
||||||
%h3.mt-5= t('moderation_queue.instances.title')
|
.col-12
|
||||||
%lead= t('moderation_queue.instances.description')
|
%h3.mt-5= t('moderation_queue.instances.title')
|
||||||
= render 'components/block_lists', blocklists: @blocklists
|
%lead= t('moderation_queue.instances.description')
|
||||||
= render 'moderation_queue/block_instances_textarea'
|
= render 'components/block_lists', blocklists: @blocklists
|
||||||
|
= render 'moderation_queue/block_instances_textarea'
|
||||||
|
|
Loading…
Reference in a new issue