70 lines
2.8 KiB
PHP
70 lines
2.8 KiB
PHP
@extends('layouts.nova')
|
|
|
|
@php
|
|
use Carbon\Carbon;
|
|
use Illuminate\Support\Str;
|
|
@endphp
|
|
|
|
@section('content')
|
|
@php
|
|
$headerTitle = data_get($topic ?? null, 'topic')
|
|
?? data_get($topic ?? null, 'title')
|
|
?? data_get($thread ?? null, 'title')
|
|
?? 'Thread';
|
|
$headerDesc = data_get($topic ?? null, 'discuss')
|
|
?? data_get($thread ?? null, 'content');
|
|
@endphp
|
|
|
|
<div class="legacy-page">
|
|
<div class="mb-6">
|
|
<a href="{{ route('legacy.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">{{ $headerTitle }}</h1>
|
|
@if (!empty($headerDesc))
|
|
<p class="mt-1 text-sm text-zinc-300">{!! Str::limit(strip_tags((string) $headerDesc), 260) !!}</p>
|
|
@endif
|
|
</div>
|
|
|
|
<div class="space-y-4">
|
|
@forelse (($posts ?? []) as $post)
|
|
@php
|
|
$authorName = $post->uname ?? data_get($post, 'user.name') ?? 'Anonymous';
|
|
$authorId = $post->user_id ?? data_get($post, 'user.id');
|
|
$postBody = $post->message ?? $post->content ?? '';
|
|
$postedAt = $post->post_date ?? $post->created_at ?? null;
|
|
@endphp
|
|
|
|
<article class="overflow-hidden rounded-lg border border-white/10 bg-zinc-900/70">
|
|
<header class="flex items-center justify-between border-b border-white/10 px-4 py-3">
|
|
<div class="text-sm font-semibold text-zinc-100">{{ $authorName }}</div>
|
|
<div class="text-xs text-zinc-400">
|
|
@if (!empty($postedAt))
|
|
{{ Carbon::parse($postedAt)->format('d.m.Y H:i') }}
|
|
@endif
|
|
</div>
|
|
</header>
|
|
|
|
<div class="px-4 py-4">
|
|
<div class="prose prose-invert max-w-none text-sm leading-6">
|
|
{!! $postBody !!}
|
|
</div>
|
|
|
|
@if (!empty($authorId))
|
|
<div class="mt-4 text-xs text-zinc-500">
|
|
User ID: {{ $authorId }}
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</article>
|
|
@empty
|
|
<div class="rounded-lg border border-white/10 bg-zinc-900/70 px-4 py-6 text-center text-zinc-400">
|
|
No posts yet.
|
|
</div>
|
|
@endforelse
|
|
</div>
|
|
|
|
@if (isset($posts) && method_exists($posts, 'links'))
|
|
<div class="mt-4">{{ $posts->withQueryString()->links() }}</div>
|
|
@endif
|
|
</div>
|
|
@endsection
|