diff --git a/CHANGELOG.md b/CHANGELOG.md index 14ed2ee..6e0c5b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ## 2026-01-11 - Restyled the thread view to mimic phpBB: compact toolbar, title row, and post layout. +- Added phpBB-style post action buttons and post author info for replies. ## 2025-12-30 - Added soft deletes with audit metadata (deleted_at/deleted_by) for forums, threads, and posts. diff --git a/app/Http/Controllers/PostController.php b/app/Http/Controllers/PostController.php index 093e0ab..74467c9 100644 --- a/app/Http/Controllers/PostController.php +++ b/app/Http/Controllers/PostController.php @@ -11,7 +11,7 @@ class PostController extends Controller { public function index(Request $request): JsonResponse { - $query = Post::query()->withoutTrashed(); + $query = Post::query()->withoutTrashed()->with('user'); $threadParam = $request->query('thread'); if (is_string($threadParam)) { @@ -45,6 +45,8 @@ class PostController extends Controller 'body' => $data['body'], ]); + $post->loadMissing('user'); + return response()->json($this->serializePost($post), 201); } @@ -81,6 +83,7 @@ class PostController extends Controller 'body' => $post->body, 'thread' => "/api/threads/{$post->thread_id}", 'user_id' => $post->user_id, + 'user_name' => $post->user?->name, 'created_at' => $post->created_at?->toIso8601String(), 'updated_at' => $post->updated_at?->toIso8601String(), ]; diff --git a/artisan b/artisan index c35e31d..95e7cc9 100644 --- a/artisan +++ b/artisan @@ -4,7 +4,7 @@ use Illuminate\Foundation\Application; use Symfony\Component\Console\Input\ArgvInput; -define('LARAVEL_START', microtime(true)); +define(constant_name: 'LARAVEL_START', value: microtime(as_float: true)); // Register the Composer autoloader... require __DIR__.'/vendor/autoload.php'; @@ -13,6 +13,6 @@ require __DIR__.'/vendor/autoload.php'; /** @var Application $app */ $app = require_once __DIR__.'/bootstrap/app.php'; -$status = $app->handleCommand(new ArgvInput); +$status = $app->handleCommand(input: new ArgvInput); exit($status); diff --git a/resources/js/index.css b/resources/js/index.css index bc9292b..ec49f0d 100644 --- a/resources/js/index.css +++ b/resources/js/index.css @@ -252,6 +252,38 @@ a { margin-bottom: 0.75rem; } +.bb-post-header-meta { + display: flex; + align-items: center; + gap: 0.6rem; +} + +.bb-post-actions { + display: inline-flex; + align-items: center; + gap: 0.35rem; +} + +.bb-post-action { + width: 44px; + height: 44px; + border-radius: 6px; + border: 1px solid #2a2f3a; + background: #20252f; + color: #c7cdd7; + display: inline-flex; + align-items: center; + justify-content: center; + font-size: 1.3rem; + transition: border-color 0.15s ease, color 0.15s ease; +} + + +.bb-post-action:hover { + color: var(--bb-accent, #f29b3f); + border-color: var(--bb-accent, #f29b3f); +} + .bb-post-body { white-space: pre-wrap; color: var(--bb-ink); diff --git a/resources/js/pages/ThreadView.jsx b/resources/js/pages/ThreadView.jsx index 1f57702..185a2a1 100644 --- a/resources/js/pages/ThreadView.jsx +++ b/resources/js/pages/ThreadView.jsx @@ -125,10 +125,29 @@ export default function ThreadView() {
- {t('thread.by')} {authorName} - {post.created_at && ( - {post.created_at.slice(0, 10)} - )} +
+ {t('thread.by')} {authorName} + {post.created_at && ( + {post.created_at.slice(0, 10)} + )} +
+
+