mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 20:56:22 +00:00
feat: recordar el estado del details
This commit is contained in:
parent
3ba23a8b8c
commit
cbba822f31
3 changed files with 27 additions and 8 deletions
17
app/javascript/controllers/details_controller.js
Normal file
17
app/javascript/controllers/details_controller.js
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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
|
%summary
|
||||||
.row
|
.row
|
||||||
.col-11.pr-2
|
.col-11.pr-2
|
||||||
|
|
|
@ -3,14 +3,11 @@
|
||||||
%h1= t('.title')
|
%h1= t('.title')
|
||||||
.row
|
.row
|
||||||
.col
|
.col
|
||||||
- summary = t('.instances')
|
= render 'layouts/details', id: 'summary', summary: t('.instances') do
|
||||||
= render 'layouts/details', summary: summary do
|
|
||||||
= render 'moderation_queue/instances', site: @site, instance_moderations: @instance_moderations, fediblock_states: @site.fediblock_states
|
= render 'moderation_queue/instances', site: @site, instance_moderations: @instance_moderations, fediblock_states: @site.fediblock_states
|
||||||
%hr
|
%hr
|
||||||
- summary = t('.accounts')
|
= render 'layouts/details', id: 'accounts', summary: t('.accounts') do
|
||||||
= render 'layouts/details', summary: summary do
|
|
||||||
= render 'moderation_queue/accounts', site: @site, post: @post, actor_moderations: @actor_moderations
|
= render 'moderation_queue/accounts', site: @site, post: @post, actor_moderations: @actor_moderations
|
||||||
%hr
|
%hr
|
||||||
- summary = t('.comments')
|
= render 'layouts/details', id: 'comments', summary: t('.comments') do
|
||||||
= render 'layouts/details', summary: summary do
|
|
||||||
= render 'moderation_queue/comments', site: @site, post: @post, moderation_queue: @moderation_queue
|
= render 'moderation_queue/comments', site: @site, post: @post, moderation_queue: @moderation_queue
|
||||||
|
|
Loading…
Reference in a new issue