From 2e71275f5bd898ed991937e67e9f07b4b3118d86 Mon Sep 17 00:00:00 2001 From: Sli Date: Tue, 25 Feb 2025 15:35:01 +0100 Subject: [PATCH] Connect calendar moderation with outside moderation --- .../com/components/ics-calendar-index.ts | 24 +++++++++++++++++++ com/templates/com/news_list.jinja | 12 ++++++++++ 2 files changed, 36 insertions(+) diff --git a/com/static/bundled/com/components/ics-calendar-index.ts b/com/static/bundled/com/components/ics-calendar-index.ts index 21019a4c..036d6b2d 100644 --- a/com/static/bundled/com/components/ics-calendar-index.ts +++ b/com/static/bundled/com/components/ics-calendar-index.ts @@ -96,6 +96,14 @@ export class IcsCalendar extends inheritHtmlElement("div") { news_id: id, }, }); + this.dispatchEvent( + new CustomEvent("calendar-moderate", { + bubbles: true, + detail: { + id: id, + }, + }), + ); await this.refreshEvents(); } @@ -106,6 +114,14 @@ export class IcsCalendar extends inheritHtmlElement("div") { news_id: id, }, }); + this.dispatchEvent( + new CustomEvent("calendar-remove", { + bubbles: true, + detail: { + id: id, + }, + }), + ); await this.refreshEvents(); } @@ -116,6 +132,14 @@ export class IcsCalendar extends inheritHtmlElement("div") { news_id: id, }, }); + this.dispatchEvent( + new CustomEvent("calendar-delete", { + bubbles: true, + detail: { + id: id, + }, + }), + ); await this.refreshEvents(); } diff --git a/com/templates/com/news_list.jinja b/com/templates/com/news_list.jinja index 620e2916..b52324ed 100644 --- a/com/templates/com/news_list.jinja +++ b/com/templates/com/news_list.jinja @@ -180,6 +180,18 @@