From 2480c5b309b64bdee0f81f6248562794ea4a91fc Mon Sep 17 00:00:00 2001 From: w33b Date: Sat, 18 Apr 2026 16:28:50 +0200 Subject: [PATCH] Redo user comments list --- app/Livewire/UserComments.php | 2 +- .../views/livewire/user-comments.blade.php | 197 ++++++++---------- resources/views/profile/comments.blade.php | 10 +- 3 files changed, 88 insertions(+), 121 deletions(-) diff --git a/app/Livewire/UserComments.php b/app/Livewire/UserComments.php index 3fcc377..05ac74c 100644 --- a/app/Livewire/UserComments.php +++ b/app/Livewire/UserComments.php @@ -38,7 +38,7 @@ class UserComments extends Component $comments = Comment::where('user_id', $this->model->id) ->when($this->commentSearch != '', fn ($query) => $query->where('body', 'like', '%'.$this->commentSearch.'%')) ->orderBy($orderby, $orderdirection) - ->paginate(10); + ->paginate(6); return view('livewire.user-comments', [ 'comments' => $comments, diff --git a/resources/views/livewire/user-comments.blade.php b/resources/views/livewire/user-comments.blade.php index 59078f6..5d2de66 100644 --- a/resources/views/livewire/user-comments.blade.php +++ b/resources/views/livewire/user-comments.blade.php @@ -1,130 +1,101 @@ -
-
- -
-
+
+
- -
- -
-
- -
+ +
- - -
- -
-
-
- - -
-
-
- -
- -
+ +
+ +
+
+ + +
-
-
-
-
-
-
- -
- -
+ +
+ @forelse ($comments as $comment) -
Comment
+ @php + $model = $comment->commentable; + $episode = $model instanceof \App\Models\Episode + ? $model + : $model->episodes->first(); + + $url = route('hentai.index', ['title' => $model->slug]); + @endphp + + + +
+ +
+ + +
+
- - @foreach ($comments as $comment) -
+ +
- -
- @if($comment->commentable_type == \App\Models\Episode::class) - @php $episode = \App\Models\Episode::find($comment->commentable_id); @endphp - - @elseif($comment->commentable_type == \App\Models\Hentai::class) - @php - $hentai = \App\Models\Hentai::find($comment->commentable_id); - $episode = $hentai->episodes->first(); - @endphp - - @endif -
- - -
- {!! $comment->presenter()->markdownBody() !!} - -
- -
- - {{ $comment->presenter()->relativeCreatedAt() }} - -
+ +
+ {!! $comment->presenter()->markdownBody() !!}
- @endforeach + + +
+ + + {{ $comment->presenter()->relativeCreatedAt() }} + + + + View comment + +
+
+ + @empty +
+
+

No results

+

(╥﹏╥)

+
-
+ @endforelse
- {{ $comments->links('pagination::tailwind') }} + + +
+ {{ $comments->links('pagination::tailwind') }} +
+
diff --git a/resources/views/profile/comments.blade.php b/resources/views/profile/comments.blade.php index 5d9b79c..596bccf 100644 --- a/resources/views/profile/comments.blade.php +++ b/resources/views/profile/comments.blade.php @@ -1,7 +1,6 @@ @include('partials.head') -
@include('layouts.navigation') @@ -9,13 +8,11 @@
@include('user.partials.background')
-
+ class="relative max-w-[120rem] mx-auto sm:px-6 lg:px-8 space-y-6 pt-20 mt-[65px] flex flex-row justify-center md:justify-normal"> +
@include('profile.partials.sidebar') -
- +
-
@@ -23,5 +20,4 @@ @include('layouts.footer')
-