feat: forum rich-text editor, emoji picker, mentions, discover nav, feed, uploads, profile
Forum: - TipTap WYSIWYG editor with full toolbar - @emoji-mart/react emoji picker (consistent with tweets) - @mention autocomplete with user search API - Fix PHP 8.4 parse errors in Blade templates - Fix thread data display (paginator items) - Align forum page widths to max-w-5xl Discover: - Extract shared _nav.blade.php partial - Add missing nav links to for-you page - Add Following link for authenticated users Feed/Posts: - Post model, controllers, policies, migrations - Feed page components (PostComposer, FeedCard, etc) - Post reactions, comments, saves, reports, sharing - Scheduled publishing support - Link preview controller Profile: - Profile page components (ProfileHero, ProfileTabs) - Profile API controller Uploads: - Upload wizard enhancements - Scheduled publish picker - Studio status bar and readiness checklist
This commit is contained in:
@@ -1,74 +1,37 @@
|
||||
@extends('layouts.nova')
|
||||
|
||||
@php
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Str;
|
||||
$threadsData = collect($subtopics->items())->map(fn ($sub) => [
|
||||
'topic_id' => (int) ($sub->topic_id ?? $sub->id ?? 0),
|
||||
'topic' => $sub->topic ?? $sub->title ?? 'Untitled',
|
||||
'discuss' => $sub->discuss ?? null,
|
||||
'num_posts' => (int) ($sub->num_posts ?? 0),
|
||||
'uname' => $sub->uname ?? 'Unknown',
|
||||
'last_update' => $sub->last_update ?? $sub->post_date ?? null,
|
||||
'is_pinned' => $sub->is_pinned ?? false,
|
||||
])->values();
|
||||
|
||||
$paginationData = (isset($subtopics) && method_exists($subtopics, 'currentPage'))
|
||||
? [
|
||||
'current_page' => $subtopics->currentPage(),
|
||||
'last_page' => $subtopics->lastPage(),
|
||||
'per_page' => $subtopics->perPage(),
|
||||
'total' => $subtopics->total(),
|
||||
] : null;
|
||||
|
||||
$forumCategoryProps = json_encode([
|
||||
'category' => ['id' => $category->id ?? null, 'name' => $category->name ?? '', 'slug' => $category->slug ?? ''],
|
||||
'threads' => $threadsData,
|
||||
'pagination' => $paginationData,
|
||||
'isAuthenticated' => auth()->check(),
|
||||
], JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE);
|
||||
@endphp
|
||||
|
||||
@section('content')
|
||||
<div class="legacy-page">
|
||||
<div class="mb-6">
|
||||
<a href="{{ route('forum.index') }}" class="text-sm text-sky-300 hover:text-sky-200">← Back to forum</a>
|
||||
<h1 class="mt-2 text-2xl font-semibold text-white">{{ $topic->topic ?? $topic->title ?? 'Topic' }}</h1>
|
||||
@if (!empty($topic->discuss))
|
||||
<p class="mt-1 text-sm text-zinc-300">{!! Str::limit(strip_tags((string) $topic->discuss), 220) !!}</p>
|
||||
@endif
|
||||
@if (isset($category) && auth()->check())
|
||||
<div class="mt-3">
|
||||
<a href="{{ route('forum.thread.create', ['category' => $category->slug]) }}" class="rounded bg-sky-600 px-3 py-2 text-xs font-medium text-white hover:bg-sky-500">New thread</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="overflow-hidden rounded-lg border border-white/10 bg-zinc-900/70">
|
||||
<div class="border-b border-white/10 px-4 py-3 text-sm font-semibold text-zinc-100">Threads</div>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="min-w-full divide-y divide-white/10 text-sm">
|
||||
<thead class="bg-zinc-800/60 text-zinc-300">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left font-medium">Thread</th>
|
||||
<th class="px-4 py-3 text-center font-medium">Posts</th>
|
||||
<th class="px-4 py-3 text-center font-medium">By</th>
|
||||
<th class="px-4 py-3 text-right font-medium">Last Update</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-white/10 text-zinc-100">
|
||||
@forelse (($subtopics ?? []) as $sub)
|
||||
@php
|
||||
$id = (int) ($sub->topic_id ?? $sub->id ?? 0);
|
||||
$title = $sub->topic ?? $sub->title ?? 'Untitled';
|
||||
@endphp
|
||||
<tr class="hover:bg-white/5">
|
||||
<td class="px-4 py-3 align-top">
|
||||
<a class="font-medium text-sky-300 hover:text-sky-200" href="{{ route('forum.thread.show', ['thread' => $id, 'slug' => Str::slug($title)]) }}">{{ $title }}</a>
|
||||
@if (!empty($sub->discuss))
|
||||
<div class="mt-1 text-xs text-zinc-400">{!! Str::limit(strip_tags((string) $sub->discuss), 180) !!}</div>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center text-zinc-300">{{ $sub->num_posts ?? 0 }}</td>
|
||||
<td class="px-4 py-3 text-center text-zinc-300">{{ $sub->uname ?? 'Unknown' }}</td>
|
||||
<td class="px-4 py-3 text-right text-zinc-400">
|
||||
@if (!empty($sub->last_update))
|
||||
{{ Carbon::parse($sub->last_update)->format('d.m.Y H:i') }}
|
||||
@elseif (!empty($sub->post_date))
|
||||
{{ Carbon::parse($sub->post_date)->format('d.m.Y H:i') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="4" class="px-4 py-6 text-center text-zinc-400">No threads in this section yet.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (isset($subtopics) && method_exists($subtopics, 'links'))
|
||||
<div class="mt-4">{{ $subtopics->withQueryString()->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
<div id="forum-category-root"></div>
|
||||
<script type="application/json" id="forum-category-props">{!! $forumCategoryProps !!}</script>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
@vite(['resources/js/entry-forum.jsx'])
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user