chore: finalize project updates

This commit is contained in:
2026-08-22 11:42:16 +03:30
parent 7719d750e9
commit 691290c340
55 changed files with 1923 additions and 6498 deletions
+64 -86
View File
@@ -1,94 +1,72 @@
@extends('layouts.app')
@section('title', 'لیست تورها')
@section('title', 'آرشیو تورها')
@push('styles')
<link rel="stylesheet" href="{{ asset('assets/css/archive.css') }}">
@endpush
@section('content')
<div class="archive-page">
<div class="container">
{{-- استایل دکمه علاقهمندی (مناسب برای کارتها) --}}
<style>
.travel-favorite-form {
position: absolute;
top: 10px;
left: 10px;
z-index: 3;
margin: 0;
}
.travel-favorite-btn {
width: 42px;
height: 42px;
border-radius: 50%;
border: 1px solid #e0245e;
background: rgba(255, 255, 255, .95);
color: #e0245e;
display: inline-flex;
align-items: center;
justify-content: center;
text-decoration: none;
transition: all .2s ease;
}
.travel-favorite-btn:hover,
.travel-favorite-btn.active {
background: #e0245e;
color: #fff;
}
</style>
<h1>تورهای ما</h1>
<div class="row">
@forelse($tours as $tour)
@php
$isFavTour = in_array($tour->id, $favoriteTourIds ?? []);
@endphp
<div class="col-md-4 position-relative">
<x-tour :tour="$tour"/>
{{-- دکمه علاقهمندی --}}
@auth
<form action="{{ route('favorites.toggle') }}" method="POST" class="travel-favorite-form">
@csrf
<input type="hidden" name="favoritable_type" value="{{ \App\Models\Tour::class }}">
<input type="hidden" name="favoritable_id" value="{{ $tour->id }}">
<button type="submit" class="travel-favorite-btn {{ $isFavTour ? 'active' : '' }}">
<i class="fa {{ $isFavTour ? 'fa-heart' : 'far fa-heart' }}"></i>
</button>
</form>
@else
<a href="{{ route('login') }}" class="travel-favorite-btn">
<i class="far fa-heart"></i>
</a>
@endauth
{{-- هدر آرشیو --}}
<div class="archive-header">
<h4><i class="fa fa-plane mr-2"></i> آرشیو تورها</h4>
<a href="{{ route('index') }}" class="btn-back">
<i class="fa fa-home"></i> بازگشت به صفحه اصلی
</a>
</div>
@empty
<p>تور فعالی یافت نشد.</p>
@endforelse
<div class="row">
@forelse($tours as $tour)
<div class="col-md-4 col-sm-6 mb-4">
<div class="tour-card">
<div class="tour-image-wrap">
{{-- دکمه علاقه‌مندی (در صورت لاگین بودن کاربر) --}}
@auth
<form action="{{ route('favorites.toggle', $tour->id) }}" method="POST" style="position: absolute; top: 10px; right: 10px; z-index: 10;">
@csrf
<button type="submit" class="btn btn-sm" style="background: rgba(255,255,255,0.8); border-radius: 50%; border:none; padding: 5px 10px;">
<i class="fa {{ $tour->isFavoritedBy(auth()->user()) ? 'fa-heart text-danger' : 'fa-heart-o' }}"></i>
</button>
</form>
@endauth
@if($tour->image)
<img src="{{ asset('storage/' . $tour->image) }}" alt="{{ $tour->title }}">
@else
<img src="{{ asset('assets/img/exp-page/slider/2.jpg') }}" alt="بدون تصویر">
@endif
</div>
<div class="tour-body">
<h5 class="tour-title">
<a href="{{ route('tours.show', $tour->id) }}">{{ $tour->title }}</a>
</h5>
<p class="tour-desc">{{ Str::limit(strip_tags($tour->description), 80) }}</p>
<div class="tour-footer">
<span class="tour-price">{{ number_format($tour->price) }} تومان</span>
<a href="{{ route('tours.show', $tour->id) }}" class="text-primary">
جزئیات <i class="fa fa-arrow-left"></i>
</a>
</div>
</div>
</div>
</div>
@empty
<div class="col-12">
<div class="archive-empty">
<i class="fa fa-map-marker"></i>
<p>هنوز توری ثبت نشده است.</p>
</div>
</div>
@endforelse
</div>
<div class="archive-pagination">
{{ $tours->links('pagination::bootstrap-4') }}
</div>
</div>
</div>
{{ $tours->links() }}
@endsection
{{--@extends('layouts.app')--}}
{{--@section('title', 'لیست تورها')--}}
{{--@section('content')--}}
{{-- <h1>تورهای ما</h1>--}}
{{-- <div class="row">--}}
{{-- @forelse($tours as $tour)--}}
{{-- <div class="col-md-4">--}}
{{-- <x-tour :tour="$tour"/>--}}
{{-- </div>--}}
{{-- @empty--}}
{{-- <p>تور فعالی یافت نشد.</p>--}}
{{-- @endforelse--}}
{{-- </div>--}}
{{-- {{ $tours->links() }}--}}
{{--@endsection--}}