5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 10:16:22 +00:00

feat: recordar el estado del details

This commit is contained in:
f 2024-02-29 16:27:48 -03:00
parent 3ba23a8b8c
commit cbba822f31
No known key found for this signature in database
3 changed files with 27 additions and 8 deletions

View file

@ -0,0 +1,17 @@
import { Controller } from "stimulus";
export default class extends Controller {
static targets = [];
connect() {
const state = window.sessionStorage.getItem(this.element.id);
if (state === "open") {
this.element.setAttribute("open", true);
}
}
store(event = undefined) {
window.sessionStorage.setItem(this.element.id, event.newState);
}
}

View file

@ -1,6 +1,11 @@
-# Detail Cola de Moderación
-#
Detail Cola de Moderación
%details.details.py-2
@param :id [String] El ID opcional sirve para mantener el historial de
cuál estaba abierto y recuperarlo al cargar la página
@param :summary [String] El resumen
%details.details.py-2{ id: local_assigns[:id], data: { controller: 'details', action: 'toggle->details#store' } }
%summary
.row
.col-11.pr-2

View file

@ -3,14 +3,11 @@
%h1= t('.title')
.row
.col
- summary = t('.instances')
= render 'layouts/details', summary: summary do
= render 'layouts/details', id: 'summary', summary: t('.instances') do
= render 'moderation_queue/instances', site: @site, instance_moderations: @instance_moderations, fediblock_states: @site.fediblock_states
%hr
- summary = t('.accounts')
= render 'layouts/details', summary: summary do
= render 'layouts/details', id: 'accounts', summary: t('.accounts') do
= render 'moderation_queue/accounts', site: @site, post: @post, actor_moderations: @actor_moderations
%hr
- summary = t('.comments')
= render 'layouts/details', summary: summary do
= render 'layouts/details', id: 'comments', summary: t('.comments') do
= render 'moderation_queue/comments', site: @site, post: @post, moderation_queue: @moderation_queue