File Manager Lite
Dir:
/home/codewavebd/public_html/resources/views/admin/categories
Upload
[..]
index.blade.php (6.89 KB)
Edit
Rename
Del
Edit: index.blade.php
@extends('layouts.admin') @section('title', 'Categories Management') @section('page_title', 'System Categories') @section('content') <div class="row g-4"> <!-- Left Column: Categories List --> <div class="col-lg-8"> <div class="admin-card"> <h5 class="font-heading text-white mb-4"><i class="bi bi-tag text-info me-2"></i>Active Categories</h5> <div class="table-responsive mb-4"> <table class="table table-dark table-hover mb-0"> <thead> <tr class="small text-muted"> <th>Name</th> <th>Slug</th> <th>Usage Type</th> <th>Actions</th> </tr> </thead> <tbody> @forelse($categories as $category) <tr class="small border-secondary"> <td class="text-white fw-bold">{{ $category->name }}</td> <td class="text-muted font-monospace">{{ $category->slug }}</td> <td> <span class="badge bg-secondary border border-secondary text-info"> {{ ucfirst($category->type) }} Showcase </span> </td> <td> <!-- Edit Trigger --> <button class="btn btn-sm btn-outline-info rounded-pill px-3 py-1 me-1" data-bs-toggle="modal" data-bs-target="#editModal{{ $category->id }}"> Edit </button> <!-- Delete Form --> <form action="{{ route('admin.categories.destroy', $category->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this category? All related products/projects will set their category to null.')"> @csrf @method('DELETE') <button type="submit" class="btn btn-sm btn-outline-danger rounded-pill px-3 py-1">Delete</button> </form> </td> </tr> <!-- Edit Modal --> <div class="modal fade" id="editModal{{ $category->id }}" tabindex="-1" style="backdrop-filter: var(--glass-blur);"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content bg-dark border-secondary text-white"> <div class="modal-header border-secondary"> <h5 class="modal-title font-heading text-info">Edit Category</h5> <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button> </div> <form action="{{ route('admin.categories.update', $category->id) }}" method="POST" class="admin-form"> @csrf @method('PUT') <div class="modal-body p-4"> <div class="mb-3"> <label class="form-label text-secondary small">Category Name</label> <input type="text" name="name" class="form-control" value="{{ $category->name }}" required> </div> <div class="mb-3"> <label class="form-label text-secondary small">Usage Type</label> <select name="type" class="form-select" required> <option value="portfolio" @selected($category->type === 'portfolio')>Portfolio Project</option> <option value="software" @selected($category->type === 'software')>Software Product</option> </select> </div> </div> <div class="modal-footer border-secondary"> <button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancel</button> <button type="submit" class="btn btn-primary-glow">Update Category</button> </div> </form> </div> </div> </div> @empty <tr> <td colspan="4" class="text-center text-muted py-5">No categories found in system.</td> </tr> @endforelse </tbody> </table> </div> <!-- Pagination --> <div class="d-flex justify-content-center"> {{ $categories->links() }} </div> </div> </div> <!-- Right Column: Create Card --> <div class="col-lg-4"> <div class="admin-card border-info"> <h5 class="font-heading text-white border-bottom border-secondary pb-3 mb-3">Create Category</h5> <form action="{{ route('admin.categories.store') }}" method="POST" class="admin-form"> @csrf <div class="mb-3"> <label class="form-label text-secondary small">Category Name</label> <input type="text" name="name" class="form-control" placeholder="e.g. ERP Solutions" required> </div> <div class="mb-4"> <label class="form-label text-secondary small">Usage Type</label> <select name="type" class="form-select" required> <option value="portfolio">Portfolio Project</option> <option value="software">Software Product</option> </select> </div> <button type="submit" class="btn btn-primary-glow w-100 py-3">Create Category</button> </form> </div> </div> </div> @endsection
Simpan