File: /home/u756937133/domains/swingersnest.com/public_html/resources/views/admin/pages/index.blade.php
@extends('layouts.admin')
@section('title', 'Pages - Admin Panel')
@section('content')
<div class="mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<div>
<h1 class="text-3xl font-extrabold text-secondary">Pages Management</h1>
<p class="text-sm text-gray-600 mt-1">Create and manage unlimited dynamic pages with custom slugs, SEO settings, and templates</p>
</div>
<a href="{{ route(($routePrefix ?? 'admin') . '.pages.create') }}" class="bg-[#FF8FA3] hover:bg-[#FF7A91] text-white px-6 py-2.5 rounded-xl font-semibold transition-colors flex items-center gap-2 shadow-md hover:shadow-lg">
<i class="ri-file-add-line text-lg"></i>
<span>Create New Page</span>
</a>
</div>
@if(session('success'))
<div class="mb-4 rounded-lg bg-green-100 border border-green-400 text-green-700 px-4 py-3">
{{ session('success') }}
</div>
@endif
<div class="overflow-hidden rounded-lg border border-gray-200 bg-white shadow-sm text-gray-900">
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">Title</th>
<th class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">Slug</th>
<th class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">Template</th>
<th class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">Status</th>
<th class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">Updated</th>
<th class="px-6 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
@forelse ($pages as $page)
<tr class="hover:bg-gray-50">
<td class="px-6 py-4">
<div class="text-sm font-medium text-gray-900">{{ $page->title }}</div>
</td>
<td class="px-6 py-4">
<div class="text-sm text-gray-500">
<code class="text-xs bg-gray-100 px-2 py-1 rounded">{{ $page->slug }}</code>
</div>
</td>
<td class="px-6 py-4">
<span class="inline-flex rounded-full bg-blue-100 px-2 py-1 text-xs font-semibold text-blue-800">Template {{ $page->template ?? 1 }}</span>
</td>
<td class="px-6 py-4">
@if($page->is_active)
<span class="inline-flex rounded-full bg-green-100 px-2 py-1 text-xs font-semibold text-green-800">Active</span>
@else
<span class="inline-flex rounded-full bg-gray-100 px-2 py-1 text-xs font-semibold text-gray-800">Inactive</span>
@endif
</td>
<td class="px-6 py-4">
<div class="text-sm text-gray-500">{{ $page->updated_at->format('M d, Y') }}</div>
</td>
<td class="px-6 py-4 text-right text-sm font-medium">
<div class="flex items-center justify-end gap-2">
@if($page->is_active)
<a href="{{ url('/' . $page->slug) }}" target="_blank" class="text-green-600 hover:text-green-800" title="View Page">
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/>
</svg>
</a>
@endif
<a href="{{ route(($routePrefix ?? 'admin') . '.pages.edit', $page) }}" class="text-primary hover:text-primary-dark" title="Edit Page">
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/>
</svg>
</a>
<form action="{{ route(($routePrefix ?? 'admin') . '.pages.destroy', $page) }}" method="POST" class="inline" onsubmit="return confirm('Are you sure you want to delete this page?');">
@csrf
@method('DELETE')
<button type="submit" class="text-red-600 hover:text-red-800" title="Delete Page">
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>
</svg>
</button>
</form>
</div>
</td>
</tr>
@empty
<tr>
<td colspan="6" class="px-6 py-12 text-center text-sm text-gray-500">
No pages found. <a href="{{ route(($routePrefix ?? 'admin') . '.pages.create') }}" class="text-primary hover:underline">Create your first page</a>
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
@endsection