138 lines
5.9 KiB
PHP
138 lines
5.9 KiB
PHP
@extends('admin::layouts.master')
|
|
|
|
@section('title')
|
|
Page
|
|
@endsection
|
|
|
|
@section('breadcrumb')
|
|
@php
|
|
$breadcrumbData = [
|
|
[
|
|
'title' => 'Page',
|
|
'link' => 'null',
|
|
],
|
|
[
|
|
'title' => 'Dashboard',
|
|
'link' => route('dashboard'),
|
|
],
|
|
[
|
|
'title' => 'Pages',
|
|
'link' => null,
|
|
],
|
|
];
|
|
@endphp
|
|
@include('admin::layouts.partials.breadcrumb', $breadcrumbData)
|
|
@endsection
|
|
|
|
@section('content')
|
|
<!-- pages List Table -->
|
|
<div class="card">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<h4 class="card-header">List of Page</h4>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="flex-column flex-md-row">
|
|
<div class="dt-action-buttons text-end pt-3 px-3">
|
|
<div class="dt-buttons btn-group flex-wrap">
|
|
<a href="{{ route('cms.pages.create') }}"
|
|
class="btn btn-secondary create-new btn-primary d-none d-sm-inline-block text-white">
|
|
<i class="bx bx-plus me-sm-1"></i>
|
|
Add New
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card-datatable table-responsive">
|
|
<table class="datatables-users table table-hover border-top">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>S.N</th>
|
|
<th>Title With Image</th>
|
|
<th>Page</th>
|
|
<th>Display Order</th>
|
|
<th>Status</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody class="table-border-bottom-0">
|
|
@if(count($pages) > 0)
|
|
@foreach ($pages ?? [] as $page)
|
|
<tr>
|
|
<td>
|
|
#{{ $loop->iteration }}
|
|
</td>
|
|
<td>
|
|
<div class="d-flex align-items-center me-3">
|
|
<img src="{{ asset($page->image_path ? 'storage/uploads/' . $page->image_path : 'backend/uploads/images/no-Image.jpg') }}"
|
|
alt="Image" class="rounded me-3" height="40" width="60" style="object-fit: cover">
|
|
<div class="card-title mb-0">
|
|
<h6 class="mb-0 text-capitalize">{{ $page->title }}</h6>
|
|
<small class="text-muted">{{ Str::limit($page->summary, 80) }}</small>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
|
|
<td>
|
|
<span class="badge bg-label-primary text-uppercase"> {{ str_replace('_',' ',$page->code) }}</span>
|
|
</td>
|
|
<td>
|
|
{{ $page->display_order }}
|
|
</td>
|
|
<td>
|
|
<span class="badge bg-label-{{ $page->status == 'active' ? 'success' : 'danger' }}">
|
|
{{ $page->status }}
|
|
</span>
|
|
</td>
|
|
<td>
|
|
<div class="dropdown">
|
|
<button type="button" class="btn p-0 dropdown-toggle hide-arrow"
|
|
data-bs-toggle="dropdown">
|
|
<i class="bx bx-dots-vertical-rounded"></i>
|
|
</button>
|
|
<div class="dropdown-menu">
|
|
<a class="dropdown-item" href="{{ route('cms.pages.edit', ['uuid' => $page->uuid]) }}">
|
|
<i class="bx bx-edit-alt me-1"></i> Edit
|
|
</a>
|
|
@if($page->code == 'normal')
|
|
<form method="POST" action="{{ route('cms.pages.delete', ['uuid' => $page->uuid]) }}"
|
|
id="deleteForm_{{ $page->uuid }}" class="dropdown-item">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="border-0 bg-transparent deleteBtn"
|
|
style="color:inherit"><i class="bx bx-trash me-1"></i> Delete</button>
|
|
</form>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
@else
|
|
<tr>
|
|
<td colspan="7">No record found.</td>
|
|
</tr>
|
|
@endif
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="px-3">
|
|
{{ $pages->links('admin::layouts.partials.pagination') }}
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
{{-- style --}}
|
|
@push('required-styles')
|
|
@include('admin::vendor.dataTables.style')
|
|
@endpush
|
|
|
|
{{-- script --}}
|
|
@push('required-scripts')
|
|
@include('admin::vendor.dataTables.script')
|
|
@endpush
|