This commit is contained in:
2025-04-12 23:28:09 +03:00
parent 3d4260d57e
commit 2ff11c2640
14 changed files with 1374 additions and 266 deletions
+54 -16
View File
@@ -146,26 +146,64 @@
<p class="text-muted mb-0">No reviews yet. Be the first to review this game!</p>
@else
@foreach($game->reviews as $review)
<div class="mb-4 pb-4 border-bottom border-secondary">
<div class="d-flex justify-content-between align-items-center mb-2">
<div>
<h6 class="mb-0">{{ $review->user->name }}</h6>
<small class="text-muted">{{ $review->created_at->diffForHumans() }}</small>
</div>
<div class="d-flex align-items-center">
<div class="rating-stars d-flex gap-1 me-2">
@for($i = 1; $i <= 10; $i++)
<i class="fas fa-star {{ $i <= $review->rating ? 'text-warning' : 'text-secondary' }}"></i>
@endfor
<div class="card bg-dark text-white mb-4">
<div class="card-header">
<div class="d-flex justify-content-between align-items-center">
<div class="d-flex align-items-center">
<div class="me-3">
<i class="fas fa-user-circle"></i>
</div>
<div>
<h6 class="mb-0">
<a href="{{ route('profile.show', $review->user) }}" class="text-white text-decoration-none">
{{ $review->user->name }}
</a>
</h6>
<small class="text-muted">
<i class="far fa-clock"></i> {{ $review->created_at->diffForHumans() }}
</small>
</div>
</div>
@if($review->recommended)
<span class="badge bg-success">Recommended</span>
@else
<span class="badge bg-danger">Not Recommended</span>
<div class="d-flex align-items-center">
<div class="rating-stars d-flex gap-1 me-2">
@for($i = 1; $i <= 10; $i++)
<i class="fas fa-star {{ $i <= $review->rating ? 'text-warning' : 'text-secondary' }}"></i>
@endfor
</div>
@if($review->recommended)
<span class="badge bg-success">Recommended</span>
@else
<span class="badge bg-danger">Not Recommended</span>
@endif
</div>
</div>
</div>
<div class="card-body">
<div class="review-content">
{!! nl2br(e($review->content)) !!}
</div>
</div>
<div class="card-footer bg-dark border-top border-secondary">
<div class="d-flex justify-content-between align-items-center">
<a href="{{ route('reviews.show', $review) }}" class="btn btn-link text-white p-0">
Read full review
</a>
@if(auth()->id() === $review->user_id)
<div class="d-flex gap-2">
<a href="{{ route('reviews.edit', $review) }}" class="btn btn-outline-primary btn-sm">
<i class="fas fa-edit"></i> Edit
</a>
<form action="{{ route('reviews.destroy', $review) }}" method="POST" class="d-inline">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-outline-danger btn-sm" onclick="return confirm('Are you sure you want to delete this review?')">
<i class="fas fa-trash"></i> Delete
</button>
</form>
</div>
@endif
</div>
</div>
<p class="mb-0">{{ $review->content }}</p>
</div>
@endforeach
@endif