Globale Live-Suche, Kontaktkarten-Personensuche, neue Beitragsansicht, Termine mit Seitenleiste, Demo-Inhalte, Plugin-Upload-Fix
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m24s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m26s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m41s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m46s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m31s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m16s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m18s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m14s
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m24s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m26s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m41s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m46s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m31s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m16s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m18s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m14s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9b06e65802
commit
b276e1c6d0
211 changed files with 3580 additions and 1072 deletions
|
|
@ -4,12 +4,14 @@ import { Link } from '@inertiajs/vue3';
|
|||
import { CalendarDays, MapPin, Video } from '@lucide/vue';
|
||||
import EmptyState from '@/components/EmptyState.vue';
|
||||
import EventDateBlock from '../components/EventDateBlock.vue';
|
||||
import DashboardSidebar from '@/components/DashboardSidebar.vue';
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { formatEventRange, formatMonthYear } from '@/lib/format';
|
||||
|
||||
const props = defineProps({
|
||||
events: { type: Object, required: true },
|
||||
sidebar: { type: Array, default: () => [] },
|
||||
});
|
||||
|
||||
// Nach Monaten gruppieren – laufende Termine erscheinen im aktuellen Monat.
|
||||
|
|
@ -37,30 +39,42 @@ const groups = computed(() => {
|
|||
<AppLayout title="Termine">
|
||||
<PageHeader title="Termine" description="Veranstaltungen, Fortbildungen und Treffen." />
|
||||
|
||||
<div v-if="groups.length" class="grid max-w-4xl gap-8">
|
||||
<section v-for="group in groups" :key="group.label">
|
||||
<h2 class="mb-3 text-sm font-semibold text-muted-foreground">{{ group.label }}</h2>
|
||||
<ul class="divide-y rounded-lg border bg-card">
|
||||
<li v-for="event in group.events" :key="event.id">
|
||||
<Link :href="`/termine/${event.id}`" class="group flex items-center gap-4 p-4 transition-colors hover:bg-accent/60">
|
||||
<EventDateBlock :date="event.starts_at" class="w-14" />
|
||||
<div class="min-w-0 flex-1">
|
||||
<h3 class="text-[15px] font-semibold group-hover:underline">{{ event.title }}</h3>
|
||||
<p class="mt-0.5 text-[13px] text-muted-foreground">{{ formatEventRange(event) }}</p>
|
||||
<p v-if="event.location || event.online_url" class="mt-0.5 flex items-center gap-1.5 text-[13px] text-muted-foreground">
|
||||
<MapPin v-if="event.location" class="size-3.5" />
|
||||
<Video v-else class="size-3.5" />
|
||||
{{ event.location || 'Online' }}
|
||||
</p>
|
||||
</div>
|
||||
<img v-if="event.thumb_url" :src="event.thumb_url" alt="" loading="lazy" class="hidden h-16 w-28 shrink-0 rounded-md object-cover sm:block" />
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
<div v-else class="max-w-4xl rounded-lg border border-dashed bg-card">
|
||||
<EmptyState :icon="CalendarDays" title="Keine anstehenden Termine" text="Neue Termine erscheinen hier, sobald sie eingetragen sind." />
|
||||
<div class="grid gap-6 lg:grid-cols-12">
|
||||
<div class="min-w-0" :class="sidebar.length ? 'lg:col-span-8 xl:col-span-9' : 'lg:col-span-12'">
|
||||
<div v-if="groups.length" class="grid gap-8">
|
||||
<section v-for="group in groups" :key="group.label">
|
||||
<h2 class="mb-3 text-sm font-semibold text-muted-foreground">
|
||||
{{ group.label }}
|
||||
</h2>
|
||||
<ul class="divide-y rounded-lg border bg-card">
|
||||
<li v-for="event in group.events" :key="event.id">
|
||||
<Link :href="`/termine/${event.id}`" class="group flex items-center gap-4 p-4 transition-colors hover:bg-accent/60">
|
||||
<EventDateBlock :date="event.starts_at" class="w-14" />
|
||||
<div class="min-w-0 flex-1">
|
||||
<h3 class="text-[15px] font-semibold group-hover:underline">
|
||||
{{ event.title }}
|
||||
</h3>
|
||||
<p class="mt-0.5 text-[13px] text-muted-foreground">
|
||||
{{ formatEventRange(event) }}
|
||||
</p>
|
||||
<p v-if="event.location || event.online_url" class="mt-0.5 flex items-center gap-1.5 text-[13px] text-muted-foreground">
|
||||
<MapPin v-if="event.location" class="size-3.5" />
|
||||
<Video v-else class="size-3.5" />
|
||||
{{ event.location || 'Online' }}
|
||||
</p>
|
||||
</div>
|
||||
<img v-if="event.thumb_url" :src="event.thumb_url" alt="" loading="lazy" class="hidden h-16 w-28 shrink-0 rounded-md object-cover sm:block" />
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
<div v-else class="rounded-lg border border-dashed bg-card">
|
||||
<EmptyState :icon="CalendarDays" title="Keine anstehenden Termine" text="Neue Termine erscheinen hier, sobald sie eingetragen sind." />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<DashboardSidebar v-if="sidebar.length" :widgets="sidebar" class="lg:col-span-4 xl:col-span-3" />
|
||||
</div>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
|
|
|||
31
plugins-core/events/src/EventSearch.php
Normal file
31
plugins-core/events/src/EventSearch.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Events;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Search\GlobalSearch;
|
||||
use Inhaus\Plugins\Events\Models\Event;
|
||||
|
||||
/** Suchquelle für die globale Suche: anstehende Termine zuerst, dann vergangene */
|
||||
class EventSearch
|
||||
{
|
||||
/**
|
||||
* @return list<array<string, mixed>>
|
||||
*/
|
||||
public function __invoke(User $user, string $search, int $limit): array
|
||||
{
|
||||
$query = Event::query()->visibleTo($user)->where('is_published', true);
|
||||
GlobalSearch::whereTerms($query, ['title', 'description', 'location'], $search);
|
||||
|
||||
return $query->orderByRaw('COALESCE(ends_at, starts_at) < ?', [now()])->orderBy('starts_at')->limit($limit)->get()->map(fn (Event $event) => [
|
||||
'title' => $event->title,
|
||||
'url' => '/termine/'.$event->id,
|
||||
'excerpt' => GlobalSearch::excerpt($event->description, $search),
|
||||
'meta' => collect([
|
||||
$event->all_day ? $event->starts_at->translatedFormat('j. F Y') : $event->starts_at->translatedFormat('j. F Y, H:i').' Uhr',
|
||||
$event->location,
|
||||
])->filter()->implode(' · '),
|
||||
'image' => $event->imageUrl('thumb'),
|
||||
])->all();
|
||||
}
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ use App\Pagebuilder\Blocks;
|
|||
use App\Pagebuilder\BlockType;
|
||||
use App\Pagebuilder\Field;
|
||||
use App\Plugins\Plugin;
|
||||
use App\Search\GlobalSearch;
|
||||
use App\Support\Abilities;
|
||||
use App\Support\Navigation;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
|
@ -19,6 +20,8 @@ class EventsPlugin extends Plugin
|
|||
{
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->make(GlobalSearch::class)->add('events', 'Termine', 'calendar-days', fn (...$args) => app(EventSearch::class)(...$args), sort: 20);
|
||||
|
||||
$this->app->make(Navigation::class)->add('events', 'Termine', '/termine', active: 'events.*', sort: 30);
|
||||
$this->app->make(Abilities::class)->define('events.manage', 'Termine verwalten', 'Termine');
|
||||
Gate::policy(Event::class, EventPolicy::class);
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@
|
|||
|
||||
namespace Inhaus\Plugins\Events\Http\Controllers;
|
||||
|
||||
use App\Dashboard\Widgets;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Support\Branding;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response as HttpResponse;
|
||||
use Inertia\Inertia;
|
||||
use Inertia\Response;
|
||||
|
|
@ -13,12 +15,14 @@ use Inhaus\Plugins\Events\Models\Event;
|
|||
|
||||
class EventController extends Controller
|
||||
{
|
||||
public function index(): Response
|
||||
public function index(Request $request, Widgets $widgets): Response
|
||||
{
|
||||
return Inertia::render('events::Index', [
|
||||
'events' => EventResource::collection(
|
||||
Event::query()->upcoming()->visibleTo(request()->user())->limit(200)->get()
|
||||
Event::query()->upcoming()->visibleTo($request->user())->limit(200)->get()
|
||||
),
|
||||
// Seitenleiste der Startseite (ohne die Termin-Kachel selbst)
|
||||
'sidebar' => $widgets->sidebar($request->user(), $request, except: ['events.upcoming']),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue