forked from eatvio/eatvio-infra
60 lines
3.8 KiB
PHP
60 lines
3.8 KiB
PHP
<div class="container px-0 mb-4 --mw-1000 reviews">
|
|
@php
|
|
$positivComments = $plan->comments()->where('grade', '>', '3');
|
|
$negativeComments = $plan->comments()->where('grade', '<=', '3');
|
|
$positiveCommmentsCount = $positivComments->count();
|
|
$negativeCommentsCount = $negativeComments->count();
|
|
@endphp
|
|
<ul class="nav nav-tabs mb-3" id="myTab" role="tablist">
|
|
<li class="nav-item" role="presentation">
|
|
<button class="nav-link active" id="positive-tab" data-bs-toggle="tab" data-bs-target="#positive" type="button" role="tab" aria-controls="positive" aria-selected="true">Положительные<span class="ms-2">{{ $positiveCommmentsCount }}</span></button>
|
|
</li>
|
|
<li class="nav-item" role="presentation">
|
|
<button class="nav-link" id="negative-tab" data-bs-toggle="tab" data-bs-target="#negative" type="button" role="tab" aria-controls="negative" aria-selected="false">Негативные<span class="ms-2">{{ $negativeCommentsCount }}</span></button>
|
|
</li>
|
|
</ul>
|
|
<div class="tab-content">
|
|
<div class="tab-pane fade show active" id="positive" role="tabpanel" aria-labelledby="positive-tab">
|
|
@foreach($positivComments->get() as $comment)
|
|
<div class="d-sm-flex justify-content-between flex-wrap flex-sm-nowrap mb-3 p-3 --bg_white --shadow --radius">
|
|
<div class="d-flex align-items-center">
|
|
<a href="#" class="d-none d-sm-block"><img src="{{ $comment->author->profile_photo_url }}" width="60px" height="60px" class="--radius_100"></a>
|
|
<div class="flex-grow-1 mx-sm-3">
|
|
<a href="#" class="--f_bold --f_main">{{ $comment->author->name }}</a>
|
|
<small class="d-block mt-1 mb-3 mb-sm-0">{{ $comment->body }}</small>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="d-flex d-sm-block align-items-center lh-1">
|
|
<div class="d-flex align-items-center">
|
|
<svg width="15" height="14" class="mx-2"><use xlink:href="#GoldStar"></use></svg>
|
|
<span class="--f_bold --f_light_gold">{{ $comment->grade }}</span>
|
|
</div>
|
|
@livewire('plan.comment.upvote', ['comment' => $comment])
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
<div class="tab-pane fade" id="negative" role="tabpanel" aria-labelledby="negative-tab">
|
|
@foreach($negativeComments->get() as $comment)
|
|
<div class="d-sm-flex justify-content-between flex-wrap flex-sm-nowrap mb-3 p-3 --bg_white --shadow --radius">
|
|
<div class="d-flex align-items-center">
|
|
<a href="#" class="d-none d-sm-block"><img src="{{ $comment->author->profile_photo_url }}" width="60px" height="60px" class="--radius_100"></a>
|
|
<div class="flex-grow-1 mx-sm-3">
|
|
<a href="#" class="--f_bold --f_main">{{ $comment->author->name }}</a>
|
|
<small class="d-block mt-1 mb-3 mb-sm-0">{{ $comment->body }}</small>
|
|
</div>
|
|
</div>
|
|
<div class="d-flex d-sm-block align-items-center lh-1">
|
|
<div class="d-flex align-items-center">
|
|
<svg width="15" height="14" class="mx-2"><use xlink:href="#GoldStar"></use></svg>
|
|
<span class="--f_bold --f_light_gold">{{ $comment->grade }}</span>
|
|
</div>
|
|
@livewire('plan.comment.upvote', ['comment' => $comment])
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
</div>
|