feat: complete dynamic tours index view

This commit is contained in:
2026-08-20 12:01:57 +03:30
parent be06e60f2c
commit 1e2c2dd8fc
3 changed files with 258 additions and 1 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

+257
View File
@@ -0,0 +1,257 @@
@extends('admin.layouts.app')
@section('breadcrumb')
<div>
<h1 class="page-title fw-medium fs-18 mb-2">لیست تورها</h1>
<div>
<nav>
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item">
<a href="javascript:void(0);">تور‌ها</a>
</li>
<li class="breadcrumb-item active" aria-current="page">
لیست تورها
</li>
</ol>
</nav>
</div>
</div>
@endsection
@section('content')
<div class="container-fluid pt-4">
@if(session('success'))
<span style="color: green">{{ session('success') }}</span>
@endif
@if(session('error'))
<span style="color: red">{{ session('error') }}</span>
@endif
<div class="row">
<div class="col-xl-12">
<div class="card custom-card">
<div class="card-body p-3">
<form method="GET" action="{{ route('admin.tours.index') }}">
<div class="d-flex align-items-center justify-content-between flex-wrap gap-3">
<div class="d-flex flex-wrap gap-1 project-list-main align-items-center">
<div class="d-flex me-2">
<input class="form-control me-2"
type="search"
name="search"
placeholder="جست‌وجوی عنوان یا شهر"
value="{{ request()->input('search') }}"
aria-label="جست‌وجو">
<button class="btn btn-light" type="submit">
جست‌وجو
</button>
</div>
<select id="choices-single-default"
class="form-control"
name="sort"
onchange="this.form.submit()">
<option value="">مرتب‌سازی بر اساس</option>
<option value="newest"
@selected(request()->missing('sort') || request()->input('sort') === 'newest')>
جدیدترین
</option>
<option value="lowest"
@selected(request()->input('sort') === 'lowest')>
کمترین قیمت
</option>
<option value="highest"
@selected(request()->input('sort') === 'highest')>
بیشترین قیمت
</option>
</select>
</div>
<div class="d-flex align-items-center gap-2">
<a href="{{ route('admin.tours.trash.index') }}"
class="btn btn-danger-light d-flex align-items-center">
<i class="ri-delete-bin-3-line me-1 fw-medium align-middle"></i>
سطل زباله
</a>
<a href="{{ route('admin.tours.create') }}"
class="btn btn-primary me-2">
<i class="ri-add-line me-1 fw-medium align-middle"></i>
ایجاد تور
</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xl-12">
<div class="card custom-card">
<div class="table-responsive">
<table class="table text-nowrap table-bordered">
<thead>
<tr>
<th>تصویر</th>
<th>عنوان تور</th>
<th>مبدأ</th>
<th>مقصد</th>
<th>نوع تور</th>
<th>محدوده تور</th>
<th>شیوه برگزاری</th>
<th>تعداد حرکت‌ها</th>
<th>بازه قیمت</th>
<th>بازدید صفحه</th>
<th>تاریخ ایجاد</th>
<th>اقدامات</th>
</tr>
</thead>
<tbody>
@forelse($tours as $tour)
<tr>
<td>
<span class="avatar avatar-md avatar-square bg-light">
@if($tour->coverImage?->file)
<img src="{{ getFileUrl($tour->coverImage->file_id) }}"
class="w-100 h-100"
alt="{{ $tour->title }}">
@else
<img src="{{ asset('assets/Admin/images/tour/single-2.jpg') }}"
class="w-100 h-100"
alt="{{ $tour->title }}">
@endif
</span>
</td>
<td>
<div class="fw-medium">
{{ $tour->title }}
</div>
@if($tour->summary)
<small class="text-muted d-inline-block text-truncate"
style="max-width: 180px;">
{{ $tour->summary }}
</small>
@endif
</td>
<td>
{{ $tour->originCity?->name ?? '-' }}
</td>
<td>
{{ $tour->city?->name ?? '-' }}
</td>
<td>
@if($tour->tour_scope)
<span class="badge bg-primary-transparent">
{{ $tour->tour_scope->label() }}
</span>
@else
-
@endif
</td>
<td>
@if($tour->tour_mode)
<span class="badge bg-warning-transparent">
{{ $tour->tour_mode->label() }}
</span>
@else
-
@endif
</td>
<td>
@if($tour->tour_type)
<span class="badge bg-success-transparent">
{{ $tour->tour_type->label() }}
</span>
@else
-
@endif
</td>
<td>
<span class="badge bg-info-transparent">
{{ $tour->tour_departures_count }} حرکت
</span>
</td>
<td>
@if($tour->tour_departures_min_price === $tour->tour_departures_max_price)
{{ number_format($tour->tour_departures_min_price) }} تومان
@else
{{ number_format($tour->tour_departures_min_price) }}
-
{{ number_format($tour->tour_departures_max_price) }}
تومان
@endif
</td>
<td>
{{$tour->views_count ?? 0 }}
</td>
<td>
{{ $tour->created_at->toJalali()->format('d F Y - H:i') }}
</td>
<td>
<div class="hstack gap-2 fs-15">
<a href="{{ route('admin.tours.edit', $tour->id) }}"
class="btn btn-secondary-light btn-icon btn-sm"
title="ویرایش">
<i class="ti ti-pencil"></i>
</a>
<form action="{{ route('admin.tours.destroy', $tour->id) }}"
method="POST"
class="d-inline"
onsubmit="return confirm('از حذف این تور مطمئن هستید؟')">
@csrf
@method('DELETE')
<button type="submit"
class="btn btn-icon btn-sm btn-danger-light"
title="حذف">
<i class="ri-delete-bin-line"></i>
</button>
</form>
</div>
</td>
</tr>
@empty
<tr>
<td colspan="11" class="text-center text-muted py-4">
هیچ توری یافت نشد.
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="d-flex justify-content-end mt-3">
{{ $tours->links() }}
</div>
</div>
@endsection
+1 -1
View File
@@ -57,7 +57,7 @@
<!-- Right: Trash Button -->
<div class="d-flex align-items-center gap-2">
<a href="{{ route('admin.users.trash') }}" class="btn btn-danger-light d-flex align-items-center">
<a href="{{ route('admin.users.trash.index') }}" class="btn btn-danger-light d-flex align-items-center">
<i class="ri-delete-bin-3-line me-1 fw-medium align-middle"></i>
سطل زباله
</a>