diff --git a/resources/views/livewire/comment.blade.php b/resources/views/livewire/comment.blade.php index 3363940..d6346b7 100644 --- a/resources/views/livewire/comment.blade.php +++ b/resources/views/livewire/comment.blade.php @@ -1,153 +1,253 @@ -
-
-
+
+ +
+ + {{-- Avatar --}} +
@if($comment->isDeletedByModerator()) - Deleted comment + Deleted comment @else - {{ $comment->user->name }} + {{ $comment->user->name }} @endif
-
-
- @if($comment->isDeletedByModerator()) - @if (Auth::check() && (Auth::user()->hasRole(\App\Enums\UserRole::ADMINISTRATOR) || Auth::user()->hasRole(\App\Enums\UserRole::MODERATOR))) -

Deleted ({{ $comment->user->name }})

- @else -

Deleted

- @endif - @else -

{{ $comment->user->name }}

- @endif - @if($comment->user->hasRole(\App\Enums\UserRole::ADMINISTRATOR)) - - @endif - @if($comment->user->hasRole(\App\Enums\UserRole::MODERATOR)) - Moderator - @endif - @if($comment->user->hasRole(\App\Enums\UserRole::SUPPORTER)) - - @endif -
-
- @if($comment->isDeletedByModerator()) -
Deleted by moderation.
- @if (Auth::check() && (Auth::user()->hasRole(\App\Enums\UserRole::ADMINISTRATOR) || Auth::user()->hasRole(\App\Enums\UserRole::MODERATOR))) -
Original comment: {!! $comment->presenter()->markdownBody() !!}
- @endif - @else - @if ($isEditing) -
-
- - - @error('editState.body') -

{{ $message }}

- @enderror -
-
- -
-
- @else -
{!! $comment->presenter()->markdownBody() !!}
- @endif - @endif -
-
- - {{ $comment->presenter()->relativeCreatedAt() }} - - @guest - - {{ $comment->likeCount() }} - - @endguest + {{-- Content --}} +
- @auth - - +
+ + + + @else +
+ {!! $comment->presenter()->markdownBody() !!} +
@endif - - @endauth - @auth - @if ($comment->depth() < 2) - @endif - @can ('update', $comment) - - @endcan +
- @can ('destroy', $comment) - - @endcan - - @can ('restore', $comment) + {{-- Footer --}} +
+ + + {{ $comment->presenter()->relativeCreatedAt() }} + + + {{-- Like --}} + @guest + + + {{ $comment->likeCount() }} + + @endguest + + @auth - @endcan - @endauth + @endauth + + {{-- Actions --}} + @auth + + @if ($comment->depth() < 2) + + @endif + + @can ('update', $comment) + + @endcan + + @can ('destroy', $comment) + + @endcan + + @can ('restore', $comment) + + @endcan + + @endauth + +
+
+ + {{-- Reply Form --}} + @if ($isReplying) + +
+
+ + + + @error('replyState.body') +

+ {{ $message }} +

+ @enderror + +
+ +
+ +
+
+ + @endif + + {{-- Replies --}} + @if ($comment->children->count()) +
+ @foreach ($comment->children as $child) + + @endforeach +
+ @endif +
+
-
- @if ($isReplying) -
-
- - - @error('replyState.body') -

{{ $message }}

- @enderror -
-
- -
-
- @endif - - @foreach ($comment->children as $child) - - @endforeach -
\ No newline at end of file diff --git a/resources/views/livewire/comments.blade.php b/resources/views/livewire/comments.blade.php index 86cfb5b..33118d3 100644 --- a/resources/views/livewire/comments.blade.php +++ b/resources/views/livewire/comments.blade.php @@ -1,57 +1,93 @@
-
-
-

Comments

+
+ + {{-- Header --}} +
+

+ Comments +

-
- -
- @auth -
-
- {{ auth()->user()->name }} -
-
-
+ + {{-- Comment Form --}} +
+ @auth +
+ {{ auth()->user()->name }} + +
+ +
- - + + + + @error('newCommentState.body') -

{{ $message }}

+

+ {{ $message }} +

@enderror
-
-
+
- @endauth + @endauth - @guest -

Log in to comment.

- @endguest -
- - -
-
- @if ($comments->isNotEmpty()) - @foreach($comments as $comment) - - @endforeach - {{ $comments->links('pagination::tailwind') }} - @else -

No comments yet.

- @endif + @guest +
+

+ Log in to join the discussion. +

-
+ @endguest + +
+ + {{-- Comments --}} +
+ @if ($comments->isNotEmpty()) + +
+ @foreach($comments as $comment) + + @endforeach +
+ +
+ {{ $comments->links('pagination::tailwind') }} +
+ + @else + +
+

+ No comments yet. +

+
+ + @endif
\ No newline at end of file