5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 00:36:21 +00:00

feat: poder seleccionar todas las instancias

This commit is contained in:
f 2024-02-26 17:03:18 -03:00
parent e78f71f25a
commit 761d68604b
No known key found for this signature in database
5 changed files with 34 additions and 18 deletions

View 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;
});
}
}

View file

@ -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

View 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')

View file

@ -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']

View file

@ -1,11 +1,11 @@
.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'
.col-12
- if instance_moderations.count.zero? - if instance_moderations.count.zero?
%h3= t('moderation_queue.nothing') %h3= t('moderation_queue.nothing')
@ -18,6 +18,7 @@
= render 'components/instances_btn_box', site: site, instance_moderation: instance_moderation = render 'components/instances_btn_box', site: site, instance_moderation: instance_moderation
%hr %hr
.col-12
%h3.mt-5= t('moderation_queue.instances.title') %h3.mt-5= t('moderation_queue.instances.title')
%lead= t('moderation_queue.instances.description') %lead= t('moderation_queue.instances.description')
= render 'components/block_lists', blocklists: @blocklists = render 'components/block_lists', blocklists: @blocklists