79 lines
3.8 KiB
PHP
79 lines
3.8 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('content')
|
|
<div class="container py-4">
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h2>نظرات من</h2>
|
|
<a href="{{ route('account.index') }}" class="btn btn-outline-secondary btn-sm">بازگشت به پنل</a>
|
|
</div>
|
|
|
|
@if(session('success'))
|
|
<div class="alert alert-success">{{ session('success') }}</div>
|
|
@endif
|
|
|
|
@if($comments->isEmpty())
|
|
<div class="alert alert-info">
|
|
هنوز نظری ثبت نکردهای.
|
|
<a href="{{ route('tours.index') }}" class="alert-link">مشاهده تورها</a>
|
|
</div>
|
|
@else
|
|
<div class="card">
|
|
<div class="card-body p-0">
|
|
<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>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($comments as $comment)
|
|
<tr>
|
|
{{-- آیتم مرتبط (تور یا پرواز) --}}
|
|
<td>
|
|
@if($comment->commentable)
|
|
@if($comment->commentable instanceof \App\Models\Tour)
|
|
<a href="{{ route('tours.show', $comment->commentable) }}">
|
|
<i class="fa fa-plane"></i> {{ $comment->commentable->title }}
|
|
</a>
|
|
@else
|
|
<a href="{{ route('flights.show', $comment->commentable) }}">
|
|
<i class="fa fa-plane"></i>
|
|
{{ $comment->commentable->title ?? $comment->commentable->flight_number ?? 'پرواز' }}
|
|
</a>
|
|
@endif
|
|
@else
|
|
<span class="text-muted">حذف شده</span>
|
|
@endif
|
|
</td>
|
|
|
|
<td class="text-muted">{{ Str::limit($comment->body, 80) }}</td>
|
|
<td>{{ $comment->created_at->format('Y/m/d') }}</td>
|
|
|
|
<td>
|
|
@if($comment->status == 2)
|
|
<span class="badge bg-success">تایید شده</span>
|
|
@elseif($comment->status == 1)
|
|
<span class="badge bg-warning text-dark">در انتظار تایید</span>
|
|
@else
|
|
<span class="badge bg-danger">رد شده</span>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-3 d-flex justify-content-center">
|
|
{{ $comments->links() }}
|
|
</div>
|
|
@endif
|
|
</div>
|
|
@endsection
|