fix: update admin favorites views
This commit is contained in:
@@ -1,3 +1,58 @@
|
||||
<div>
|
||||
<!-- Let all your things have their places; let each part of your business have its time. - Benjamin Franklin -->
|
||||
@extends('admin.layouts.app')
|
||||
|
||||
@section('title', 'لیست علاقهمندیها')
|
||||
|
||||
@section('content')
|
||||
<div class="container-fluid py-4">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h4 class="mb-0">علاقهمندیهای کاربران</h4>
|
||||
<span class="badge text-bg-info">{{ $favorites->total() }} مورد</span>
|
||||
</div>
|
||||
|
||||
@if (session('success'))
|
||||
<div class="alert alert-success">{{ session('success') }}</div>
|
||||
@endif
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>کاربر</th>
|
||||
<th>نوع آیتم</th>
|
||||
<th>شناسه آیتم</th>
|
||||
<th>تاریخ ثبت</th>
|
||||
<th class="text-center">عملیات</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($favorites as $favorite)
|
||||
<tr>
|
||||
<td>{{ $favorite->user?->name ?? 'نامشخص' }}</td>
|
||||
<td>
|
||||
<span
|
||||
class="badge text-bg-secondary">{{ class_basename($favorite->favoritable_type) }}</span>
|
||||
</td>
|
||||
<td>{{ $favorite->favoritable_id }}</td>
|
||||
<td class="text-muted small">{{ $favorite->created_at->format('Y/m/d') }}</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="{{ route('admin.favorites.show', $favorite) }}" class="btn btn-outline-info">نمایش</a>
|
||||
<form action="{{ route('admin.favorites.destroy', $favorite) }}" method="POST"
|
||||
onsubmit="return confirm('حذف شود؟')">
|
||||
@csrf @method('DELETE')
|
||||
<button class="btn btn-outline-danger">حذف</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="5" class="text-center">موردی یافت نشد.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="mt-3">{{ $favorites->links() }}</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -1,3 +1,24 @@
|
||||
<div>
|
||||
<!-- If you do not have a consistent goal in life, you can not live it in a consistent way. - Marcus Aurelius -->
|
||||
@extends('admin.layouts.app')
|
||||
|
||||
@section('title', 'جزئیات علاقهمندی')
|
||||
|
||||
@section('content')
|
||||
<div class="container-fluid py-4">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-white">جزئیات علاقهمندی #{{ $favorite->id }}</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item"><strong>کاربر:</strong> {{ $favorite->user?->name }}</li>
|
||||
<li class="list-group-item"><strong>مدل:</strong> {{ $favorite->favoritable_type }}</li>
|
||||
<li class="list-group-item"><strong>شناسه مدل:</strong> {{ $favorite->favoritable_id }}</li>
|
||||
<li class="list-group-item"><strong>تاریخ
|
||||
ثبت:</strong> {{ $favorite->created_at->format('Y/m/d H:i') }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<a href="{{ route('admin.favorites.index') }}" class="btn btn-secondary">بازگشت</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
Reference in New Issue
Block a user