Gruppen 1.2.0: Detailseite im einheitlichen Seitenkopf
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b29f6ada71
commit
e7e92c5624
5 changed files with 37 additions and 38 deletions
2
dist/pages/Post.js
vendored
2
dist/pages/Post.js
vendored
|
|
@ -1 +1 @@
|
|||
import{n as e}from"../chunks/loader-circle-CxzeMpQS.js";import{i as t,t as n}from"../chunks/PostCard-ClNPcHNo.js";import{Fragment as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createElementVNode as s,createTextVNode as c,createVNode as l,onMounted as u,openBlock as d,renderList as f,toDisplayString as p,unref as m,withCtx as h}from"vue";import{Link as g,router as _}from"@inertiajs/vue3";import{AppLayout as v,Button as y,http as b,toast as x}from"@inhaus/ui";var S=e({name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]}),C={class:`ih:mx-auto ih:grid ih:max-w-4xl ih:gap-4`},w={key:0,class:`ih:rounded-md ih:border ih:border-destructive/30 ih:bg-destructive/5 ih:p-3 ih:text-sm`},T={class:`ih:flex ih:items-center ih:gap-2 ih:font-medium`},E={class:`ih:mt-1 ih:list-disc ih:pl-6 ih:text-muted-foreground`},D={__name:`Post`,props:{group:{type:Object,required:!0},post:{type:Object,required:!0},comments:{type:Array,required:!0},reactions:{type:Array,required:!0},reports:{type:Array,default:()=>[]}},setup(e){let D=e;u(()=>{(location.hash&&document.querySelector(location.hash))?.scrollIntoView({block:`center`})});async function O(){await b.post(`/gruppen/beitraege/${D.post.id}/meldungen-erledigt`),x.success(`Meldungen erledigt`),_.reload()}return(u,b)=>(d(),i(m(v),{title:`Beitrag in ${e.group.name}`},{default:h(()=>[s(`div`,C,[l(m(g),{href:e.group.url,class:`ih:inline-flex ih:items-center ih:gap-1 ih:text-sm ih:font-medium ih:text-muted-foreground ih:hover:text-foreground`},{default:h(()=>[l(m(S),{class:`ih:size-4`}),c(` `+p(e.group.name),1)]),_:1},8,[`href`]),e.reports.length?(d(),o(`div`,w,[s(`p`,T,[l(m(t),{class:`ih:size-4 ih:text-destructive`}),c(` `+p(e.reports.length)+` `+p(e.reports.length===1?`Meldung`:`Meldungen`),1)]),s(`ul`,E,[(d(!0),o(r,null,f(e.reports,e=>(d(),o(`li`,{key:e.id},p(e.comment_id?`Kommentar: `:``)+p(e.reason),1))),128))]),l(m(y),{size:`sm`,variant:`outline`,class:`ih:mt-2`,onClick:O},{default:h(()=>[...b[1]||=[c(`In Ordnung – erledigt`,-1)]]),_:1})])):a(``,!0),l(n,{post:e.post,reactions:e.reactions,"full-comments":e.comments,onDeleted:b[0]||=t=>m(_).visit(e.group.url)},null,8,[`post`,`reactions`,`full-comments`])])]),_:1},8,[`title`]))}};export{D as default};
|
||||
import{i as e,t}from"../chunks/PostCard-ClNPcHNo.js";import{Fragment as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createElementVNode as o,createTextVNode as s,createVNode as c,onMounted as l,openBlock as u,renderList as d,toDisplayString as f,unref as p,withCtx as m}from"vue";import{router as h}from"@inertiajs/vue3";import{AppLayout as g,Button as _,PageHeader as v,http as y,toast as b}from"@inhaus/ui";var x={class:`ih:mx-auto ih:grid ih:max-w-4xl ih:gap-4`},S={key:0,class:`ih:rounded-md ih:border ih:border-destructive/30 ih:bg-destructive/5 ih:p-3 ih:text-sm`},C={class:`ih:flex ih:items-center ih:gap-2 ih:font-medium`},w={class:`ih:mt-1 ih:list-disc ih:pl-6 ih:text-muted-foreground`},T={__name:`Post`,props:{group:{type:Object,required:!0},post:{type:Object,required:!0},comments:{type:Array,required:!0},reactions:{type:Array,required:!0},reports:{type:Array,default:()=>[]}},setup(T){let E=T;l(()=>{(location.hash&&document.querySelector(location.hash))?.scrollIntoView({block:`center`})});async function D(){await y.post(`/gruppen/beitraege/${E.post.id}/meldungen-erledigt`),b.success(`Meldungen erledigt`),h.reload()}return(l,y)=>(u(),r(p(g),{title:`Beitrag in ${T.group.name}`},{default:m(()=>[c(p(v),{title:`Beitrag`,breadcrumbs:[{label:`Gruppen`,href:`/gruppen`},{label:T.group.name,href:T.group.url}]},null,8,[`breadcrumbs`]),o(`div`,x,[T.reports.length?(u(),a(`div`,S,[o(`p`,C,[c(p(e),{class:`ih:size-4 ih:text-destructive`}),s(` `+f(T.reports.length)+` `+f(T.reports.length===1?`Meldung`:`Meldungen`),1)]),o(`ul`,w,[(u(!0),a(n,null,d(T.reports,e=>(u(),a(`li`,{key:e.id},f(e.comment_id?`Kommentar: `:``)+f(e.reason),1))),128))]),c(p(_),{size:`sm`,variant:`outline`,class:`ih:mt-2`,onClick:D},{default:m(()=>[...y[1]||=[s(`In Ordnung – erledigt`,-1)]]),_:1})])):i(``,!0),c(t,{post:T.post,reactions:T.reactions,"full-comments":T.comments,onDeleted:y[0]||=e=>p(h).visit(T.group.url)},null,8,[`post`,`reactions`,`full-comments`])])]),_:1},8,[`title`]))}};export{T as default};
|
||||
2
dist/pages/Show.js
vendored
2
dist/pages/Show.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"slug": "gruppen",
|
||||
"name": "Gruppen",
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.0",
|
||||
"description": "Diskussionsgruppen wie bei Facebook: offen, geschlossen (Beitritt auf Anfrage) oder privat (nur auf Einladung). Beiträge mit Fotos, Dateien und Umfragen, Reaktionen, Kommentare mit Antworten, Anpinnen, Melden und Moderation.",
|
||||
"author": "Loheide",
|
||||
"namespace": "Inhaus\\Plugins\\Gruppen\\",
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<script setup>
|
||||
import { onMounted } from 'vue';
|
||||
import { Link, router } from '@inertiajs/vue3';
|
||||
import { ChevronLeft, Flag } from '@lucide/vue';
|
||||
import { AppLayout, Button, http, toast } from '@inhaus/ui';
|
||||
import { router } from '@inertiajs/vue3';
|
||||
import { Flag } from '@lucide/vue';
|
||||
import { AppLayout, Button, PageHeader, http, toast } from '@inhaus/ui';
|
||||
import PostCard from '../components/PostCard.vue';
|
||||
|
||||
const props = defineProps({
|
||||
|
|
@ -27,8 +27,8 @@ async function resolve() {
|
|||
|
||||
<template>
|
||||
<AppLayout :title="`Beitrag in ${group.name}`">
|
||||
<PageHeader title="Beitrag" :breadcrumbs="[{ label: 'Gruppen', href: '/gruppen' }, { label: group.name, href: group.url }]" />
|
||||
<div class="ih:mx-auto ih:grid ih:max-w-4xl ih:gap-4">
|
||||
<Link :href="group.url" class="ih:inline-flex ih:items-center ih:gap-1 ih:text-sm ih:font-medium ih:text-muted-foreground ih:hover:text-foreground"><ChevronLeft class="ih:size-4" /> {{ group.name }}</Link>
|
||||
<div v-if="reports.length" class="ih:rounded-md ih:border ih:border-destructive/30 ih:bg-destructive/5 ih:p-3 ih:text-sm">
|
||||
<p class="ih:flex ih:items-center ih:gap-2 ih:font-medium"><Flag class="ih:size-4 ih:text-destructive" /> {{ reports.length }} {{ reports.length === 1 ? 'Meldung' : 'Meldungen' }}</p>
|
||||
<ul class="ih:mt-1 ih:list-disc ih:pl-6 ih:text-muted-foreground"><li v-for="r in reports" :key="r.id">{{ r.comment_id ? 'Kommentar: ' : '' }}{{ r.reason }}</li></ul>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<script setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { Link, router, usePage } from '@inertiajs/vue3';
|
||||
import { router, usePage } from '@inertiajs/vue3';
|
||||
import { Bell, BellOff, Check, EyeOff, Flag, Globe, LoaderCircle, Lock, LogOut, PencilLine, Trash2, UserMinus, UserPlus, Users, X } from '@lucide/vue';
|
||||
import { AppLayout, Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, EmptyState, PersonAvatar, http, toast } from '@inhaus/ui';
|
||||
import { AppLayout, Button, PageHeader, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, EmptyState, PersonAvatar, http, toast } from '@inhaus/ui';
|
||||
import GroupDialog from '../components/GroupDialog.vue';
|
||||
import PeopleSelect from '../components/PeopleSelect.vue';
|
||||
import PostCard from '../components/PostCard.vue';
|
||||
|
|
@ -59,40 +59,39 @@ const canInvite = computed(() => props.can.post && (props.group.privacy === 'ope
|
|||
|
||||
<template>
|
||||
<AppLayout :title="group.name">
|
||||
<!-- Kopf mit Titelbild -->
|
||||
<header class="ih:overflow-hidden ih:rounded-xl ih:border ih:bg-card ih:shadow-xs">
|
||||
<div class="ih:h-36 ih:bg-brand ih:bg-cover ih:bg-center ih:sm:h-52" :style="group.cover_url ? { backgroundImage: `url(${group.cover_url})` } : {}" />
|
||||
<div class="ih:flex ih:flex-wrap ih:items-end ih:gap-4 ih:p-5">
|
||||
<div class="ih:min-w-0 ih:flex-1">
|
||||
<p class="ih:mb-1 ih:text-[13px]"><Link href="/gruppen" class="ih:text-muted-foreground ih:hover:underline">Gruppen</Link></p>
|
||||
<h1 class="ih:text-2xl ih:font-semibold ih:tracking-tight">{{ group.name }}</h1>
|
||||
<p class="ih:mt-1 ih:flex ih:flex-wrap ih:items-center ih:gap-x-3 ih:gap-y-1 ih:text-sm ih:text-muted-foreground">
|
||||
<span class="ih:inline-flex ih:items-center ih:gap-1" :title="group.privacy_hint"><component :is="icons[group.privacy]" class="ih:size-4" /> {{ group.privacy_label }}e Gruppe</span>
|
||||
<span class="ih:inline-flex ih:items-center ih:gap-1"><Users class="ih:size-4" /> {{ group.members_count }} {{ group.members_count === 1 ? 'Mitglied' : 'Mitglieder' }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="ih:flex ih:flex-wrap ih:gap-2">
|
||||
<template v-if="status === 'active'">
|
||||
<Button v-if="canInvite" @click="inviting = true"><UserPlus /> Einladen</Button>
|
||||
<Button variant="outline" size="icon" :aria-label="membership.notify === 'all' ? 'Benachrichtigungen ausschalten' : 'Benachrichtigungen einschalten'" :title="membership.notify === 'all' ? 'Sie werden über neue Beiträge benachrichtigt' : 'Keine Benachrichtigungen'" @click="act('/benachrichtigungen', { notify: membership.notify === 'all' ? 'off' : 'all' }, 'put')">
|
||||
<component :is="membership.notify === 'all' ? Bell : BellOff" />
|
||||
</Button>
|
||||
<Button v-if="can.admin" variant="outline" @click="editing = true"><PencilLine /> Bearbeiten</Button>
|
||||
<Button variant="ghost" class="ih:text-muted-foreground" @click="leave"><LogOut /> Verlassen</Button>
|
||||
</template>
|
||||
<Button v-else-if="status === 'pending'" variant="outline" disabled>Beitritt angefragt</Button>
|
||||
<Button v-else-if="status === 'invited'" @click="act('/beitreten')"><Check /> Einladung annehmen</Button>
|
||||
<Button v-else-if="group.privacy !== 'secret'" @click="act('/beitreten')">{{ group.privacy === 'open' ? 'Beitreten' : 'Beitritt anfragen' }}</Button>
|
||||
<Button v-if="can.admin && status !== 'active'" variant="outline" @click="editing = true"><PencilLine /> Bearbeiten</Button>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="ih:flex ih:gap-1 ih:border-t ih:px-3" role="tablist">
|
||||
<PageHeader :title="group.name" :breadcrumbs="[{ label: 'Gruppen', href: '/gruppen' }]">
|
||||
<template #description>
|
||||
<span class="ih:flex ih:flex-wrap ih:items-center ih:gap-x-3 ih:gap-y-1">
|
||||
<span class="ih:inline-flex ih:items-center ih:gap-1" :title="group.privacy_hint"><component :is="icons[group.privacy]" class="ih:size-4" /> {{ group.privacy_label }}e Gruppe</span>
|
||||
<span class="ih:inline-flex ih:items-center ih:gap-1"><Users class="ih:size-4" /> {{ group.members_count }} {{ group.members_count === 1 ? 'Mitglied' : 'Mitglieder' }}</span>
|
||||
</span>
|
||||
</template>
|
||||
<template #actions>
|
||||
<template v-if="status === 'active'">
|
||||
<Button v-if="canInvite" @click="inviting = true"><UserPlus /> Einladen</Button>
|
||||
<Button variant="outline" size="icon" :aria-label="membership.notify === 'all' ? 'Benachrichtigungen ausschalten' : 'Benachrichtigungen einschalten'" :title="membership.notify === 'all' ? 'Sie werden über neue Beiträge benachrichtigt' : 'Keine Benachrichtigungen'" @click="act('/benachrichtigungen', { notify: membership.notify === 'all' ? 'off' : 'all' }, 'put')">
|
||||
<component :is="membership.notify === 'all' ? Bell : BellOff" />
|
||||
</Button>
|
||||
<Button v-if="can.admin" variant="outline" @click="editing = true"><PencilLine /> Bearbeiten</Button>
|
||||
<Button variant="ghost" class="ih:text-muted-foreground" @click="leave"><LogOut /> Verlassen</Button>
|
||||
</template>
|
||||
<Button v-else-if="status === 'pending'" variant="outline" disabled>Beitritt angefragt</Button>
|
||||
<Button v-else-if="status === 'invited'" @click="act('/beitreten')"><Check /> Einladung annehmen</Button>
|
||||
<Button v-else-if="group.privacy !== 'secret'" @click="act('/beitreten')">{{ group.privacy === 'open' ? 'Beitreten' : 'Beitritt anfragen' }}</Button>
|
||||
<Button v-if="can.admin && status !== 'active'" variant="outline" @click="editing = true"><PencilLine /> Bearbeiten</Button>
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<!-- Titelbild und Reiter unter dem Seitenkopf -->
|
||||
<div class="ih:overflow-hidden ih:rounded-xl ih:border ih:bg-card ih:shadow-xs">
|
||||
<div v-if="group.cover_url" class="ih:h-36 ih:bg-cover ih:bg-center ih:sm:h-52" :style="{ backgroundImage: `url(${group.cover_url})` }" />
|
||||
<nav class="ih:flex ih:gap-1 ih:px-3" :class="group.cover_url ? 'ih:border-t' : ''" role="tablist">
|
||||
<button v-for="t in [{ key: 'beitraege', label: 'Beiträge' }, { key: 'mitglieder', label: 'Mitglieder' }, { key: 'info', label: 'Info' }]" :key="t.key" type="button" role="tab" :aria-selected="activeTab === t.key" class="ih:relative ih:px-3 ih:py-3 ih:text-sm ih:font-medium" :class="activeTab === t.key ? 'ih:text-foreground' : 'ih:text-muted-foreground ih:hover:text-foreground'" @click="activeTab = t.key">
|
||||
{{ t.label }}<span v-if="t.key === 'mitglieder' && members?.pending.length" class="ih:ml-1 ih:rounded-full ih:bg-brand ih:px-1.5 ih:text-[11px] ih:text-brand-foreground">{{ members.pending.length }}</span>
|
||||
<span v-if="activeTab === t.key" class="ih:absolute ih:inset-x-2 ih:bottom-0 ih:h-[3px] ih:rounded-t-full ih:bg-brand" />
|
||||
</button>
|
||||
</nav>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
<div class="ih:mt-6 ih:grid ih:items-start ih:gap-6 ih:lg:grid-cols-[minmax(0,1fr)_20rem]">
|
||||
<div class="ih:grid ih:min-w-0 ih:gap-4">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue