File Manager Lite
Dir:
/home/codewavebd/public_html/resources/views/admin/testimonials
Upload
[..]
index.blade.php (10.46 KB)
Edit
Rename
Del
Edit: index.blade.php
@extends('layouts.admin') @section('title', 'Testimonials Management') @section('page_title', 'Client Testimonials') @section('content') <div class="row g-4"> <!-- Left Column: Testimonial List --> <div class="col-lg-8"> <div class="admin-card"> <h5 class="font-heading text-white mb-4"><i class="bi bi-chat-square-quote text-info me-2"></i>Active Reviews</h5> <div class="table-responsive mb-4"> <table class="table table-dark table-hover mb-0"> <thead> <tr class="small text-muted"> <th>Client Info</th> <th>Company / Role</th> <th>Review Quote</th> <th>Rating</th> <th>Actions</th> </tr> </thead> <tbody> @forelse($testimonials as $test) <tr class="small border-secondary"> <td class="text-white fw-bold">{{ $test->client_name }}</td> <td>{{ $test->client_role }} • <span class="text-info">{{ $test->company_name }}</span></td> <td>{{ Str::limit($test->review, 50) }}</td> <td><span class="text-warning">{" . str_repeat('★', $test->rating) . "}</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="#editTestModal{{ $test->id }}"> Edit </button> <!-- Delete Form --> <form action="{{ route('admin.testimonials.destroy', $test->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this testimonial?')"> @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="editTestModal{{ $test->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 Testimonial</h5> <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button> </div> <form action="{{ route('admin.testimonials.update', $test->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">Client Full Name</label> <input type="text" name="client_name" class="form-control" value="{{ $test->client_name }}" required> </div> <div class="row"> <div class="col-md-6 mb-3"> <label class="form-label text-secondary small">Client Role</label> <input type="text" name="client_role" class="form-control" value="{{ $test->client_role }}"> </div> <div class="col-md-6 mb-3"> <label class="form-label text-secondary small">Company Name</label> <input type="text" name="company_name" class="form-control" value="{{ $test->company_name }}"> </div> </div> <div class="row"> <div class="col-md-6 mb-3"> <label class="form-label text-secondary small">Rating Stars</label> <select name="rating" class="form-select"> <option value="5" @selected($test->rating === 5)>5 Stars</option> <option value="4" @selected($test->rating === 4)>4 Stars</option> <option value="3" @selected($test->rating === 3)>3 Stars</option> </select> </div> <div class="col-md-6 mb-3"> <label class="form-label text-secondary small">Status</label> <select name="status" class="form-select"> <option value="active" @selected($test->status === 'active')>Active</option> <option value="inactive" @selected($test->status === 'inactive')>Inactive</option> </select> </div> </div> <div class="mb-3"> <label class="form-label text-secondary small">Review Quote Text</label> <textarea name="review" rows="3" class="form-control" required>{{ $test->review }}</textarea> </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 Testimonial</button> </div> </form> </div> </div> </div> @empty <tr> <td colspan="5" class="text-center text-muted py-5">No testimonials found.</td> </tr> @endforelse </tbody> </table> </div> <!-- Pagination --> <div class="d-flex justify-content-center"> {{ $testimonials->links() }} </div> </div> </div> <!-- Right Column: Create Panel --> <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 Review</h5> <form action="{{ route('admin.testimonials.store') }}" method="POST" class="admin-form"> @csrf <div class="mb-3"> <label class="form-label text-secondary small">Client Full Name</label> <input type="text" name="client_name" class="form-control" placeholder="e.g. Rahat Chowdhury" required> </div> <div class="row"> <div class="col-md-6 mb-3"> <label class="form-label text-secondary small">Client Role</label> <input type="text" name="client_role" class="form-control" placeholder="e.g. CTO"> </div> <div class="col-md-6 mb-3"> <label class="form-label text-secondary small">Company Name</label> <input type="text" name="company_name" class="form-control" placeholder="e.g. Apex Group"> </div> </div> <div class="row"> <div class="col-md-6 mb-3"> <label class="form-label text-secondary small">Rating Stars</label> <select name="rating" class="form-select"> <option value="5">5 Stars</option> <option value="4">4 Stars</option> <option value="3">3 Stars</option> </select> </div> <div class="col-md-6 mb-3"> <label class="form-label text-secondary small">Status</label> <select name="status" class="form-select"> <option value="active">Active</option> <option value="inactive">Inactive</option> </select> </div> </div> <div class="mb-4"> <label class="form-label text-secondary small">Review Quote Text</label> <textarea name="review" rows="4" class="form-control" placeholder="Type customer feedback text here..." required></textarea> </div> <button type="submit" class="btn btn-primary-glow w-100 py-3">Create Testimonial</button> </form> </div> </div> </div> @endsection
Simpan