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
|
|
@ -0,0 +1,37 @@
|
|||
<script setup>
|
||||
import { router } from '@inertiajs/vue3';
|
||||
import { Flag } from '@lucide/vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
||||
/**
|
||||
* Für das Gremium: offene Meldungen zu einer Idee oder einem Kommentar – behalten oder löschen.
|
||||
*/
|
||||
const props = defineProps({
|
||||
ideaId: { type: Number, required: true },
|
||||
commentId: { type: Number, default: null },
|
||||
reports: { type: Array, required: true },
|
||||
hidden: { type: Boolean, default: false },
|
||||
});
|
||||
|
||||
function decide(action) {
|
||||
if (action === 'remove' && !window.confirm(props.commentId ? 'Kommentar löschen?' : 'Idee samt Kommentaren löschen?')) return;
|
||||
|
||||
router.put(`/ideen/${props.ideaId}/meldungen`, { comment_id: props.commentId, action }, { preserveScroll: true });
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm" role="status">
|
||||
<p class="flex items-center gap-2 font-medium">
|
||||
<Flag class="size-4 text-destructive" />
|
||||
{{ reports.length }} {{ reports.length === 1 ? 'Meldung' : 'Meldungen' }}<template v-if="hidden"> · vorläufig ausgeblendet</template>
|
||||
</p>
|
||||
<ul class="mt-1.5 grid gap-0.5 pl-6 text-[13px] text-muted-foreground">
|
||||
<li v-for="(report, i) in reports" :key="i">{{ report.reason }}<template v-if="report.note">: „{{ report.note }}“</template></li>
|
||||
</ul>
|
||||
<div class="mt-3 flex flex-wrap gap-2 pl-6">
|
||||
<Button size="sm" variant="outline" @click="decide('keep')">In Ordnung – behalten</Button>
|
||||
<Button size="sm" variant="outline" class="text-destructive hover:text-destructive" @click="decide('remove')">Löschen</Button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
63
plugins-core/ideen/resources/js/components/ReportDialog.vue
Normal file
63
plugins-core/ideen/resources/js/components/ReportDialog.vue
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<script setup>
|
||||
import { watch } from 'vue';
|
||||
import { useForm } from '@inertiajs/vue3';
|
||||
import { LoaderCircle } from '@lucide/vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Textarea } from '@/components/ui/textarea';
|
||||
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
||||
|
||||
/**
|
||||
* Idee oder Kommentar melden. Das Gremium sieht Grund und Anmerkung, nicht den Namen.
|
||||
*/
|
||||
const props = defineProps({
|
||||
ideaId: { type: Number, required: true },
|
||||
commentId: { type: Number, default: null },
|
||||
reasons: { type: Object, required: true },
|
||||
});
|
||||
|
||||
const open = defineModel('open', { type: Boolean, default: false });
|
||||
const form = useForm({ reason: '', note: '', comment_id: null });
|
||||
|
||||
watch(open, (value) => {
|
||||
if (!value) return;
|
||||
|
||||
form.reset();
|
||||
form.clearErrors();
|
||||
form.comment_id = props.commentId;
|
||||
});
|
||||
|
||||
function submit() {
|
||||
form.post(`/ideen/${props.ideaId}/melden`, { preserveScroll: true, onSuccess: () => (open.value = false) });
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Dialog v-model:open="open">
|
||||
<DialogContent class="sm:max-w-md">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{{ commentId ? 'Kommentar melden' : 'Idee melden' }}</DialogTitle>
|
||||
<DialogDescription>Das Gremium prüft den Hinweis. Ihr Name wird dabei nicht angezeigt.</DialogDescription>
|
||||
</DialogHeader>
|
||||
<form id="report-form" class="grid gap-4" @submit.prevent="submit">
|
||||
<fieldset class="grid gap-2">
|
||||
<legend class="mb-2 text-sm font-medium">Warum?</legend>
|
||||
<label v-for="(label, key) in reasons" :key="key" class="flex cursor-pointer items-center gap-3 rounded-md border px-3 py-2 text-sm hover:bg-accent/50 has-[:checked]:border-brand has-[:checked]:bg-brand-soft">
|
||||
<input v-model="form.reason" type="radio" name="reason" :value="key" class="size-4 accent-[var(--color-brand)]" />
|
||||
{{ label }}
|
||||
</label>
|
||||
</fieldset>
|
||||
<div class="grid gap-1.5">
|
||||
<label for="report-note" class="text-sm font-medium">Anmerkung (optional)</label>
|
||||
<Textarea id="report-note" v-model="form.note" rows="2" maxlength="500" />
|
||||
</div>
|
||||
<p v-if="form.errors.reason" class="text-[13px] text-destructive">Bitte einen Grund auswählen.</p>
|
||||
</form>
|
||||
<DialogFooter>
|
||||
<Button variant="ghost" @click="open = false">Abbrechen</Button>
|
||||
<Button type="submit" form="report-form" :disabled="form.processing || !form.reason">
|
||||
<LoaderCircle v-if="form.processing" class="animate-spin" /> Melden
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</template>
|
||||
Loading…
Add table
Add a link
Reference in a new issue