180 lines
4.3 KiB
PHP
180 lines
4.3 KiB
PHP
<div class="col-md-6 col-lg-3">
|
|
|
|
<div class="flight-item">
|
|
|
|
{{-- Flight Image --}}
|
|
<div class="flight-img">
|
|
|
|
@if($flight->file?->path)
|
|
|
|
<img
|
|
src="{{ asset('storage/' . $flight->file->path) }}"
|
|
alt="{{ $flight->title }}"
|
|
>
|
|
|
|
@else
|
|
|
|
<img
|
|
src="{{ asset('assets/img/flight/01.jpg') }}"
|
|
alt="{{ $flight->title }}"
|
|
>
|
|
|
|
@endif
|
|
|
|
|
|
{{-- Favorite --}}
|
|
@if(auth()->check())
|
|
|
|
<form
|
|
action="{{ route('account.favorites.toggle', [
|
|
'type' => 'flight',
|
|
'id' => $flight->id
|
|
]) }}"
|
|
method="POST"
|
|
>
|
|
@csrf
|
|
|
|
<button
|
|
type="submit"
|
|
class="add-wishlist border-0 bg-transparent"
|
|
>
|
|
<i class="far fa-heart"></i>
|
|
</button>
|
|
</form>
|
|
|
|
@else
|
|
|
|
<a
|
|
href="{{ route('auth.login.index') }}"
|
|
class="add-wishlist"
|
|
>
|
|
<i class="far fa-heart"></i>
|
|
</a>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
|
|
{{-- Flight Content --}}
|
|
<div class="flight-content">
|
|
|
|
{{-- Title --}}
|
|
<div class="flight-title">
|
|
|
|
<div class="flight-title-info">
|
|
|
|
{{-- Airline Logo --}}
|
|
@if($flight->airline?->file?->path)
|
|
|
|
<img
|
|
src="{{ asset('storage/' . $flight->airline->file->path) }}"
|
|
alt="{{ $flight->airline->name }}"
|
|
>
|
|
|
|
@else
|
|
|
|
<img
|
|
src="{{ asset('assets/img/flight/airline-1.png') }}"
|
|
alt="{{ $flight->airline?->name ?? 'Airline' }}"
|
|
>
|
|
|
|
@endif
|
|
|
|
|
|
<h4>
|
|
<a href="{{ route('flights.show', $flight->id) }}">
|
|
|
|
{{ $flight->departureAirport?->city?->name ?? '-' }}
|
|
|
|
<i class="far fa-exchange"></i>
|
|
|
|
{{ $flight->arrivalAirport?->city?->name ?? '-' }}
|
|
|
|
</a>
|
|
</h4>
|
|
|
|
</div>
|
|
|
|
|
|
{{-- Date --}}
|
|
<p class="flight-date">
|
|
|
|
<i class="far fa-calendar-days"></i>
|
|
|
|
{{ $flight->departure_time?->toJalali()->format('Y/m/d H:i') ?? '-' }}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
{{-- Flight Type --}}
|
|
<div class="mb-2">
|
|
|
|
@if($flight->flight_type === \App\Enums\FlightType::DEPARTURE)
|
|
|
|
<span class="badge bg-primary">
|
|
یکطرفه
|
|
</span>
|
|
|
|
@elseif($flight->flight_type === \App\Enums\FlightType::RETURN)
|
|
|
|
<span class="badge bg-info">
|
|
برگشت
|
|
</span>
|
|
|
|
@elseif($flight->flight_type === \App\Enums\FlightType::ROUNDTRIP)
|
|
|
|
<span class="badge bg-warning">
|
|
رفت و برگشت
|
|
</span>
|
|
|
|
@else
|
|
|
|
<span class="badge bg-secondary">
|
|
نامشخص
|
|
</span>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
|
|
{{-- Bottom --}}
|
|
<div class="flight-bottom">
|
|
|
|
{{-- Price --}}
|
|
<div class="flight-price">
|
|
|
|
از
|
|
|
|
<span>
|
|
{{ number_format($flight->price) }}
|
|
تومان
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
{{-- Details --}}
|
|
<div class="flight-text-btn">
|
|
|
|
<a href="{{ route('flights.show', $flight->id) }}">
|
|
|
|
نمایش جزئیات
|
|
|
|
<i class="fas fa-arrow-left"></i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|