Initial commit
This commit is contained in:
3
resources/views/livewire/tools/coments.blade.php
Normal file
3
resources/views/livewire/tools/coments.blade.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<div>
|
||||
{{-- The Master doesn't talk, he acts. --}}
|
||||
</div>
|
||||
51
resources/views/livewire/tools/home-comments.blade.php
Normal file
51
resources/views/livewire/tools/home-comments.blade.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<div>
|
||||
|
||||
<div>
|
||||
@foreach ($comments->other as $other_comment)
|
||||
<div class="mx-10">
|
||||
<div>
|
||||
|
||||
@if ($other_comment->status == 1)
|
||||
<div class="">
|
||||
<div>
|
||||
<div
|
||||
class="p-5 rounded @if ($other_comment->type == 1) bg-gray-400 @else bg-gray-200 @endif flex flex-col gap-3 m-3">
|
||||
<div>
|
||||
<h4> name : {{ $other_comment->name }}</h4>
|
||||
<p> message : {{ $other_comment->message }}</p>
|
||||
</div>
|
||||
<div x-data="{ reply_id: 0 }">
|
||||
<button @click="reply_id='{{ $other_comment->id }}'"
|
||||
class="p-2 bg-blue-300 ">reply</button>
|
||||
<div @click.outside="reply_id=0" x-show="reply_id=='{{ $other_comment->id }}'"
|
||||
class="flex flex-col gap-5">
|
||||
<form>
|
||||
<div>
|
||||
<input wire:model="comment_name_reply" class="border p-1"
|
||||
placeholder="name">
|
||||
<input wire:model="comment_message_reply" class="border p-1"
|
||||
placeholder="message">
|
||||
<button @click="reply_id=0" type="button"
|
||||
wire:click="reply({{ $other_comment->id }},{{ $comment->id }})"
|
||||
class="bg-green-300 p-2 rounded"> reply </button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
<div>
|
||||
@livewire('tools.home-comments', ['comments' => $other_comment, 'comment' => $comment, 'blog_id' => $blog_id], key($other_comment->id))
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
83
resources/views/livewire/tools/panel-comments.blade.php
Normal file
83
resources/views/livewire/tools/panel-comments.blade.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<div>
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
@foreach ($comments->other as $another_comment)
|
||||
<div class="mx-10">
|
||||
<div>
|
||||
<div x-show="(( (status==comment_status) && comment_seen==1)||(status=='new' && (comment_seen==0 || parent_reply>0))) || status=='all'"
|
||||
class="p-5 rounded @if ($another_comment->type == 1)
|
||||
bg-gray-400
|
||||
@else
|
||||
bg-gray-200
|
||||
@endif flex flex-col gap-3 m-3">
|
||||
<div>
|
||||
<h4> name : {{ $another_comment->name }}</h4>
|
||||
<p> message : {{ $another_comment->message }}</p>
|
||||
<div class="flex gap-2" x-data="{ comment_status: '{{ $another_comment->status }}', comment_seen: '{{ $another_comment->seen }}' }">
|
||||
{{-- <button class="p-2 mt-3 rounded bg-green-500">edit</button> --}}
|
||||
@if ($another_comment->type == 1)
|
||||
{{-- answer --}}
|
||||
<button wire:click="delete_comment({{ $another_comment->id }})"
|
||||
class="p-2 mt-3 rounded bg-red-500">delete</button>
|
||||
@else
|
||||
{{-- reply --}}
|
||||
<button
|
||||
@click="comment_seen==0?parent_reply=parent_reply-1:'',comment_status=1,comment_seen=1 "
|
||||
wire:click="comment_status({{ $another_comment->id }},{{ true }},{{ $comment->id }})"
|
||||
x-show="comment_status==0||comment_seen==0"
|
||||
class="p-2 mt-3 rounded bg-green-500">accept</button>
|
||||
<button
|
||||
@click="comment_seen==0?parent_reply=parent_reply-1:'',comment_status=0,comment_seen=1"
|
||||
wire:click="comment_status({{ $another_comment->id }},{{ true }},{{ $comment->id }})"
|
||||
x-show="comment_status==1||comment_seen==0"
|
||||
class="p-2 mt-3 rounded bg-red-500">reject</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@if ($another_comment->type != 1)
|
||||
<div>
|
||||
<button @click="answer_id='{{ $another_comment->id }}'"
|
||||
class="bg-green-300 p-1 rounded"> answer </button>
|
||||
|
||||
<div>
|
||||
<div @click.outside="answer_id=0"
|
||||
x-show="answer_id=='{{ $another_comment->id }}'"
|
||||
class="flex flex-col gap-5">
|
||||
<form>
|
||||
<div>
|
||||
<input wire:model="comment_message" class="border p-1"
|
||||
placeholder="message">
|
||||
<button type="button"
|
||||
wire:click="answer({{ $another_comment->id }})"
|
||||
@click="answer_id=0" class="bg-green-300 p-1 rounded"> answer
|
||||
</button>
|
||||
<button @click="answer_id=0" class="bg-red-300 p-1 rounded"> close
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@livewire('tools.panel-comments', ['comments' => $another_comment, 'comment' => $comment, 'blog_id' => $blog_id], key($another_comment->id))
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user