mirror of
https://github.com/ae-utbm/sith.git
synced 2025-02-27 01:47:14 +00:00
Synchronize calendar moderation and news list moderation
This commit is contained in:
parent
07028c8dd8
commit
10701ccdfa
@ -10,6 +10,8 @@ const AlertState = {
|
||||
PUBLISHED: 2,
|
||||
// biome-ignore lint/style/useNamingConvention: this feels more like an enum
|
||||
DELETED: 3,
|
||||
// biome-ignore lint/style/useNamingConvention: this feels more like an enum
|
||||
DISPLAYED: 4, // When published at page generation
|
||||
};
|
||||
exportToHtml("AlertState", AlertState);
|
||||
|
||||
|
@ -57,8 +57,8 @@
|
||||
{# the news-moderated is received when a moderation alert is deleted or moderated #}
|
||||
@news-moderated.window="dispatchModeration($event)"
|
||||
{% if alpineState %}
|
||||
x-modelable="{{ alpineState }}"
|
||||
x-model="state"
|
||||
x-model="{{ alpineState }}"
|
||||
x-modelable="state"
|
||||
{% endif %}
|
||||
>
|
||||
<template x-if="state === AlertState.PENDING">
|
||||
|
@ -59,17 +59,15 @@
|
||||
class="news_event"
|
||||
{%- if not date.news.is_published -%}
|
||||
x-data="{newsState: AlertState.PENDING}"
|
||||
{% else %}
|
||||
x-data="{newsState: AlertState.DISPLAYED}"
|
||||
{%- endif -%}
|
||||
>
|
||||
{% if not date.news.is_published %}
|
||||
{# if a non published news is in the object list,
|
||||
the logged user is either an admin or the news author #}
|
||||
{{ news_moderation_alert(date.news, user, "newsState") }}
|
||||
{% endif %}
|
||||
{# if a non published news is in the object list,
|
||||
the logged user is either an admin or the news author #}
|
||||
{{ news_moderation_alert(date.news, user, "newsState") }}
|
||||
<div
|
||||
{% if not date.news.is_published -%}
|
||||
x-show="newsState !== AlertState.DELETED"
|
||||
{%- endif -%}
|
||||
x-show="newsState !== AlertState.DELETED"
|
||||
>
|
||||
<header class="row gap">
|
||||
{% if date.news.club.logo %}
|
||||
@ -191,7 +189,7 @@
|
||||
$refs.calendar.refreshEvents($event);
|
||||
}
|
||||
"
|
||||
@calendar-remove="$dispatch('news-moderated', {newsId: $event.detail.id, state: AlertState.DELETED})"
|
||||
@calendar-delete="$dispatch('news-moderated', {newsId: $event.detail.id, state: AlertState.DELETED})"
|
||||
@calendar-unpublish="$dispatch('news-moderated', {newsId: $event.detail.id, state: AlertState.PENDING})"
|
||||
@calendar-publish="$dispatch('news-moderated', {newsId: $event.detail.id, state: AlertState.PUBLISHED})"
|
||||
locale="{{ get_language() }}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user