mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 19:56: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
|
||||
.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
|
||||
|
|
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
|
||||
.col-1
|
||||
= render 'components/checkbox', id: instance.hostname
|
||||
= render 'components/checkbox', id: instance.hostname, data: { target: 'select-all.input' }
|
||||
.col-11
|
||||
%h4
|
||||
%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
|
||||
= render 'components/checkbox', id: 'all' do
|
||||
%span.sr-only= t('moderation_queue.everything')
|
||||
= render 'components/select_all', id: 'instances'
|
||||
.col-11
|
||||
-# Filtros
|
||||
= render 'components/instances_filters'
|
||||
|
||||
- if instance_moderations.count.zero?
|
||||
%h3= t('moderation_queue.nothing')
|
||||
.col-12
|
||||
- if instance_moderations.count.zero?
|
||||
%h3= t('moderation_queue.nothing')
|
||||
|
||||
- instance_moderations.each do |instance_moderation|
|
||||
%hr
|
||||
= render 'moderation_queue/instance', instance: instance_moderation.instance
|
||||
- instance_moderations.each do |instance_moderation|
|
||||
%hr
|
||||
= render 'moderation_queue/instance', instance: instance_moderation.instance
|
||||
|
||||
-# Botones moderación
|
||||
.d-flex.pb-4
|
||||
= render 'components/instances_btn_box', site: site, instance_moderation: instance_moderation
|
||||
-# Botones moderación
|
||||
.d-flex.pb-4
|
||||
= render 'components/instances_btn_box', site: site, instance_moderation: instance_moderation
|
||||
|
||||
%hr
|
||||
%h3.mt-5= t('moderation_queue.instances.title')
|
||||
%lead= t('moderation_queue.instances.description')
|
||||
= render 'components/block_lists', blocklists: @blocklists
|
||||
= render 'moderation_queue/block_instances_textarea'
|
||||
%hr
|
||||
.col-12
|
||||
%h3.mt-5= t('moderation_queue.instances.title')
|
||||
%lead= t('moderation_queue.instances.description')
|
||||
= render 'components/block_lists', blocklists: @blocklists
|
||||
= render 'moderation_queue/block_instances_textarea'
|
||||
|
|
Loading…
Reference in a new issue