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
@@ -1,3 +0,0 @@
<div>
<!-- Simplicity is the ultimate sophistication. - Leonardo da Vinci -->
</div>
+139 -3
View File
@@ -1,3 +1,139 @@
<div>
<!-- An unexamined life is not worth living. - Socrates -->
</div>
@extends('layouts.app')
@section('title', 'نظرات من')
@section('content')
{{-- =====================
سربرگ صفحه (Page Header)
===================== --}}
<div class="account-page-header mb-4 d-flex justify-content-between align-items-center flex-wrap gap-3">
<div>
<h4 class="mb-1 fw-bold">
<i class="fa fa-comments text-primary me-1"></i>
نظرات من
</h4>
<p class="text-muted small mb-0">
دیدگاه‌هایی که برای تورها و پروازها ثبت کرده‌اید
</p>
</div>
<div>
<a href="{{ route('tours.index') }}" class="btn btn-sm btn-outline-primary">
<i class="fa fa-suitcase me-1"></i>
مشاهده تورها
</a>
</div>
</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
{{-- =====================
لیست نظرات
===================== --}}
@forelse ($comments as $comment)
<div class="card shadow-sm app-comment-card mb-3 border-0 rounded-4">
<div class="card-body">
{{-- بالای کارت: عنوان تور/پرواز + وضعیت --}}
<div class="d-flex justify-content-between align-items-start flex-wrap gap-2 mb-2">
<div class="d-flex align-items-center gap-2">
{{-- آیکون تور یا پرواز بر اساس نوع محتوا --}}
@if ($comment->commentable instanceof \App\Models\Tour)
<span class="app-icon-circle bg-primary-subtle text-primary">
<i class="fa fa-suitcase"></i>
</span>
@else
<span class="app-icon-circle bg-info-subtle text-info">
<i class="fa fa-plane"></i>
</span>
@endif
<div>
<h6 class="mb-0 fw-bold">
{{ $comment->commentable?->title ?? 'مورد حذف‌شده' }}
</h6>
<small class="text-muted">
{{ class_basename($comment->commentable_type) }}
</small>
</div>
</div>
{{-- وضعیت نظر --}}
@include('admin.comments.status', ['status' => $comment->status])
</div>
{{-- متن نظر --}}
<p class="card-text text-muted mb-0">
{{ $comment->body }}
</p>
{{-- تاریخ ثبت --}}
<div class="d-flex justify-content-between align-items-center mt-3 pt-3 border-top small text-muted">
<span>
<i class="fa fa-calendar me-1"></i>
{{ $comment->created_at->format('Y/m/d H:i') }}
</span>
{{-- دکمه حذف نظر --}}
@if (Route::has('account.comments.destroy'))
<form action="{{ route('account.comments.destroy', $comment) }}" method="POST"
onsubmit="return confirm('نظر شما حذف شود؟')">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-link btn-sm text-danger p-0">
<i class="fa fa-trash me-1"></i>
حذف
</button>
</form>
@endif
</div>
</div>
</div>
@empty
<div class="card border-0 shadow-sm rounded-4">
<div class="card-body text-center py-5">
<div class="app-empty-icon mx-auto mb-3">
<i class="fa fa-comment-slash"></i>
</div>
<h5 class="fw-bold mb-1">هنوز نظری ثبت نکرده‌اید</h5>
<p class="text-muted mb-3">
بعد از خرید یا رزرو تور و پرواز، می‌توانید نظر خود را ثبت کنید.
</p>
<a href="{{ route('tours.index') }}" class="btn btn-primary">
<i class="fa fa-suitcase me-1"></i>
مشاهده تورها
</a>
</div>
</div>
@endforelse
{{-- =====================
صفحه‌بندی
===================== --}}
<div class="mt-4">
{{ $comments->links() }}
</div>
@endsection
@@ -1,3 +1,120 @@
<div>
<!-- If you do not have a consistent goal in life, you can not live it in a consistent way. - Marcus Aurelius -->
</div>
@extends('layouts.app')
@section('content')
<div class="container py-5">
<div class="row g-4">
<!-- ====== سایدبار پروفایل ====== -->
<div class="col-lg-3 col-md-4">
<div class="profile-sidebar text-center">
<img src="{{ $user->image ? asset('storage/'.$user->image) : asset('assets/img/default.png') }}"
class="profile-avatar mb-3" alt="تصویر پروفایل">
<h5 class="profile-name">{{ $user->first_name }} {{ $user->last_name }}</h5>
<p class="profile-username">@ {{ $user->username }}</p>
<hr class="my-3">
<div class="d-flex justify-content-around small">
<div><strong>{{ $user->favorites->count() }}</strong><br><span style="color:#6c757d;">علاقه‌مندی</span></div>
<div><strong>{{ $user->comments->count() }}</strong><br><span style="color:#6c757d;">کامنت</span></div>
</div>
</div>
</div>
<!-- ====== محتوای اصلی ====== -->
<div class="col-lg-9 col-md-8">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item"><a class="nav-link active" data-toggle="tab" href="#edit">ویرایش پروفایل</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#comments">کامنت‌های من</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#favorites">علاقه‌مندی‌ها</a></li>
</ul>
<div class="tab-content pt-4">
<!-- تب ویرایش پروفایل -->
<div class="tab-pane active" id="edit">
<div class="form-card">
<form action="{{ route('account.edit-profile.post') }}" method="POST"
enctype="multipart/form-data">
@csrf
<div class="row">
<div class="col-md-6 mb-3">
<label class="form-label">نام</label>
<input type="text" name="first_name" class="form-control"
value="{{ old('first_name', $user->first_name) }}">
@error('first_name') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="col-md-6 mb-3">
<label class="form-label">نام خانوادگی</label>
<input type="text" name="last_name" class="form-control"
value="{{ old('last_name', $user->last_name) }}">
@error('last_name') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="col-md-6 mb-3">
<label class="form-label">نام کاربری</label>
<input type="text" name="username" class="form-control"
value="{{ old('username', $user->username) }}">
@error('username') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="col-md-6 mb-3">
<label class="form-label">ایمیل</label>
<input type="email" name="email" class="form-control"
value="{{ old('email', $user->email) }}">
@error('email') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="col-md-12 mb-3">
<label class="form-label">تصویر پروفایل</label>
<input type="file" name="image" class="form-control">
</div>
<div class="col-md-12 mb-4">
<label class="form-label">رمز عبور جدید <small class="text-muted">(اختیاری)</small></label>
<input type="password" name="password" class="form-control">
@error('password') <small class="text-danger">{{ $message }}</small> @enderror
</div>
</div>
<button type="submit" class="btn btn-save">ذخیره تغییرات</button>
</form>
</div>
</div>
<!-- تب کامنت‌ها -->
<div class="tab-pane" id="comments">
@forelse($user->comments as $comment)
<div class="comment-box mb-3">
<div>{{ $comment->content }}</div>
<small>{{ $comment->created_at ? $comment->created_at->format('Y/m/d') : '' }}</small>
</div>
@empty
<p class="text-muted">هنوز کامنتی ثبت نکرده‌اید.</p>
@endforelse
</div>
<!-- تب علاقه‌مندی‌ها -->
<div class="tab-pane" id="favorites">
@forelse($user->favorites as $fav)
<span class="favorite-item">
<i class="fa fa-heart"></i>
{{ $fav->favoritable->title ?? 'مورد علاقه‌مند' }}
</span>
@empty
<p class="text-muted">هنوز موردی به علاقه‌مندی‌ها اضافه نکرده‌اید.</p>
@endforelse
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('.nav-tabs a').click(function (e) {
e.preventDefault();
$(this).tab('show');
});
});
</script>
@endsection
+12 -4
View File
@@ -26,14 +26,22 @@
@endif
</div>
<div class="card-footer bg-transparent border-0 d-flex justify-content-between">
<a href="{{route('tours.index')}}" class="btn btn-sm btn-primary">مشاهده</a>
<div
class="card-footer bg-transparent border-0 d-flex justify-content-between align-items-center">
@if($favorite->favoritable_type === \App\Models\Tour::class)
<a href="{{ route('tours.show', $item->id) }}" class="btn btn-sm btn-primary">مشاهده
تور</a>
@endif
<form action="{{ route('favorites.toggle') }}" method="POST">
@csrf
<input type="hidden" name="favoritable_type" value="{{ $favorite->favoritable_type }}">
<input type="hidden" name="favoritable_type"
value="{{ $favorite->favoritable_type }}">
<input type="hidden" name="favoritable_id" value="{{ $favorite->favoritable_id }}">
<button class="btn btn-sm btn-danger">حذف</button>
<button type="submit" class="btn btn-sm btn-outline-danger">
از علاقه‌مندی‌ها حذف شود
</button>
</form>
</div>
</div>