Ideenbox-Moderation und Wochenüberblick per E-Mail (0.36.0)
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 6m49s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m19s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m29s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m39s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 9m38s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 9m25s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 7m57s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m4s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 46s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m9s
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 6m49s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m19s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m29s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m39s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 9m38s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 9m25s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 7m57s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m4s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 46s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m9s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
11c5ef5baf
commit
f9922f7308
172 changed files with 1524 additions and 363 deletions
|
|
@ -1,7 +1,7 @@
|
|||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import { Link, router, useForm, usePage } from '@inertiajs/vue3';
|
||||
import { BadgeCheck, LoaderCircle, PencilLine, Trash2 } from '@lucide/vue';
|
||||
import { BadgeCheck, EyeOff, Flag, LoaderCircle, PencilLine, Trash2 } from '@lucide/vue';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Switch } from '@/components/ui/switch';
|
||||
|
|
@ -13,14 +13,25 @@ import PersonAvatar from '@/components/PersonAvatar.vue';
|
|||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { formatDate, formatRelative } from '@/lib/format';
|
||||
import IdeaDialog from '../components/IdeaDialog.vue';
|
||||
import ModerationNotice from '../components/ModerationNotice.vue';
|
||||
import ReportDialog from '../components/ReportDialog.vue';
|
||||
import StatusBadge from '../components/StatusBadge.vue';
|
||||
import SupportButton from '../components/SupportButton.vue';
|
||||
|
||||
const props = defineProps({
|
||||
idea: { type: Object, required: true },
|
||||
statuses: { type: Object, required: true },
|
||||
reasons: { type: Object, required: true },
|
||||
});
|
||||
|
||||
// Melden
|
||||
const reporting = ref(false);
|
||||
const reportComment = ref(null);
|
||||
function report(commentId = null) {
|
||||
reportComment.value = commentId;
|
||||
reporting.value = true;
|
||||
}
|
||||
|
||||
const page = usePage();
|
||||
watch(() => page.props.flash.status, (status) => status && toast.success(status), { immediate: true });
|
||||
|
||||
|
|
@ -55,14 +66,19 @@ function remove() {
|
|||
eingereicht {{ formatRelative(idea.created_at) }}<template v-if="!idea.author"> · anonym</template>
|
||||
</span>
|
||||
</template>
|
||||
<template v-if="idea.can_edit || idea.can_manage" #actions>
|
||||
<template #actions>
|
||||
<Button v-if="idea.can_edit" variant="outline" size="sm" @click="editing = true"><PencilLine /> Bearbeiten</Button>
|
||||
<Button variant="ghost" size="sm" class="text-destructive hover:text-destructive" @click="remove"><Trash2 /> Löschen</Button>
|
||||
<Button v-if="idea.can_edit || idea.can_manage" variant="ghost" size="sm" class="text-destructive hover:text-destructive" @click="remove"><Trash2 /> Löschen</Button>
|
||||
<Button v-if="!idea.mine && !idea.can_manage" variant="ghost" size="sm" class="text-muted-foreground" :disabled="idea.reported" @click="report()">
|
||||
<Flag /> {{ idea.reported ? 'Gemeldet' : 'Melden' }}
|
||||
</Button>
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<div class="grid items-start gap-6 lg:grid-cols-12">
|
||||
<div class="grid min-w-0 gap-6 lg:col-span-8">
|
||||
<ModerationNotice v-if="idea.can_manage && idea.reports.length" :idea-id="idea.id" :reports="idea.reports" :hidden="idea.hidden" />
|
||||
<p v-else-if="idea.hidden" class="flex items-center gap-2 rounded-md border bg-muted/60 p-3 text-sm"><EyeOff class="size-4 shrink-0" /> Ihre Idee ist vorläufig ausgeblendet, weil sie gemeldet wurde. Das Gremium prüft sie.</p>
|
||||
<Panel>
|
||||
<div class="flex gap-5">
|
||||
<SupportButton :idea="idea" :disabled="idea.mine" large />
|
||||
|
|
@ -85,7 +101,7 @@ function remove() {
|
|||
|
||||
<Panel id="kommentare" :title="`Kommentare (${idea.comment_list.length})`">
|
||||
<ul v-if="idea.comment_list.length" class="-mx-5 mb-5 divide-y border-y">
|
||||
<li v-for="c in idea.comment_list" :key="c.id" class="flex gap-3 px-5 py-4" :class="{ 'bg-brand-soft/40': c.official }">
|
||||
<li v-for="c in idea.comment_list" :id="`kommentar-${c.id}`" :key="c.id" class="flex gap-3 px-5 py-4" :class="{ 'bg-brand-soft/40': c.official }">
|
||||
<PersonAvatar v-if="c.author" :person="c.author" class="size-9" />
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="flex flex-wrap items-center gap-x-2 text-sm">
|
||||
|
|
@ -93,8 +109,20 @@ function remove() {
|
|||
<span v-if="c.official" class="inline-flex items-center gap-1 text-xs font-medium text-brand-text"><BadgeCheck class="size-3.5" /> Gremium</span>
|
||||
<span class="text-xs text-muted-foreground">{{ formatRelative(c.created_at) }}</span>
|
||||
</p>
|
||||
<p class="mt-1 text-sm leading-relaxed whitespace-pre-line">{{ c.body }}</p>
|
||||
<p v-if="c.body === null" class="mt-1 flex items-center gap-1.5 text-sm text-muted-foreground italic"><EyeOff class="size-3.5" /> Vorläufig ausgeblendet – wird geprüft.</p>
|
||||
<p v-else class="mt-1 text-sm leading-relaxed whitespace-pre-line" :class="{ 'opacity-60': c.hidden }">{{ c.body }}</p>
|
||||
<ModerationNotice v-if="idea.can_manage && c.reports.length" :idea-id="idea.id" :comment-id="c.id" :reports="c.reports" :hidden="c.hidden" class="mt-2" />
|
||||
</div>
|
||||
<Button
|
||||
v-if="!c.can_delete && c.body !== null"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
class="size-7 shrink-0 text-muted-foreground"
|
||||
:disabled="c.reported"
|
||||
:aria-label="c.reported ? 'Bereits gemeldet' : 'Kommentar melden'"
|
||||
:title="c.reported ? 'Bereits gemeldet' : 'Kommentar melden'"
|
||||
@click="report(c.id)"
|
||||
><Flag class="size-3.5" /></Button>
|
||||
<Button v-if="c.can_delete" variant="ghost" size="icon" class="size-7 shrink-0 text-muted-foreground hover:text-destructive" aria-label="Kommentar löschen" @click="deleteComment(c)"><Trash2 class="size-3.5" /></Button>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
@ -138,5 +166,6 @@ function remove() {
|
|||
</div>
|
||||
|
||||
<IdeaDialog v-if="idea.can_edit" v-model:open="editing" :idea="idea" />
|
||||
<ReportDialog v-model:open="reporting" :idea-id="idea.id" :comment-id="reportComment" :reasons="reasons" />
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue