74 lines
3.1 KiB
PHP
74 lines
3.1 KiB
PHP
@extends('admin.layouts.app')
|
|
|
|
@section('title', 'مدیریت نظرات')
|
|
|
|
@section('content')
|
|
<div class="container-fluid py-4">
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h4 class="mb-0">مدیریت نظرات</h4>
|
|
<span class="badge text-bg-primary">{{ $comments->total() }} نظر</span>
|
|
</div>
|
|
|
|
@if (session('success'))
|
|
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
|
{{ session('success') }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="بستن"></button>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="card shadow-sm">
|
|
<div class="table-responsive">
|
|
<table class="table table-hover align-middle mb-0">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>#</th>
|
|
<th>کاربر</th>
|
|
<th>مرتبط با</th>
|
|
<th>متن نظر</th>
|
|
<th>وضعیت</th>
|
|
<th>تاریخ</th>
|
|
<th class="text-center">عملیات</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse ($comments as $comment)
|
|
<tr>
|
|
<td>{{ $comments->firstItem() + $loop->index }}</td>
|
|
<td>{{ $comment->user?->name ?? 'کاربر حذفشده' }}</td>
|
|
<td>
|
|
<span
|
|
class="d-block text-muted small">{{ class_basename($comment->commentable_type) }}</span>
|
|
<span class="small">شناسه: {{ $comment->commentable_id }}</span>
|
|
</td>
|
|
<td class="text-truncate" style="max-width: 250px;">
|
|
{{ \Illuminate\Support\Str::limit($comment->body, 60) }}
|
|
</td>
|
|
<td>
|
|
@include('admin.comments.status', ['status' => $comment->status])
|
|
</td>
|
|
<td class="small text-muted">{{ $comment->created_at->format('Y/m/d') }}</td>
|
|
<td class="text-center">
|
|
<div class="btn-group btn-group-sm" role="group">
|
|
<a href="{{ route('admin.comments.show', $comment) }}"
|
|
class="btn btn-outline-secondary" title="نمایش">نمایش</a>
|
|
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="7" class="text-center text-muted py-4">هنوز نظری ثبت نشده است.</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-3">
|
|
{{ $comments->links() }}
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
|