3
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('title', 'Agregar Slide')
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h2 class="mb-0">➕ Agregar Slide</h2>
|
||||
<a href="{{ route('admin.carousel.index') }}" class="btn btn-secondary shadow-sm">
|
||||
<i class="bi bi-arrow-left"></i> Volver a la Lista
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="card shadow-sm border-0">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('admin.carousel.store') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label font-weight-bold">Título</label>
|
||||
<input type="text" name="titulo" class="form-control" value="{{ old('titulo') }}">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label font-weight-bold">Subtítulo</label>
|
||||
<input type="text" name="subtitulo" class="form-control" value="{{ old('subtitulo') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label font-weight-bold">Texto del Botón</label>
|
||||
<input type="text" name="boton_texto" class="form-control" value="{{ old('boton_texto') }}">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label font-weight-bold">Enlace del Botón (URL)</label>
|
||||
<input type="text" name="boton_enlace" class="form-control" value="{{ old('boton_enlace') }}" placeholder="Ej: /eventos o https://...">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-8">
|
||||
<label class="form-label font-weight-bold">Imagen <span class="text-danger">*</span></label>
|
||||
<input type="file" name="imagen" class="form-control" required accept="image/*">
|
||||
<small class="text-muted d-block mt-1">Formatos: JPG, PNG, WEBP. Tamaño ideal: ancho de pantalla, bajo peso.</small>
|
||||
@error('imagen')
|
||||
<div class="text-danger small mt-1">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-md-2 mt-4">
|
||||
<div class="form-check form-switch fs-5 h-100 d-flex align-items-center">
|
||||
<input class="form-check-input mt-0 me-2" type="checkbox" role="switch" name="activo" id="activo" checked value="1" style="height: 25px; width: 50px;">
|
||||
<label class="form-check-label ms-2 mt-1 fs-6" for="activo">Visible</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label class="form-label font-weight-bold">Orden</label>
|
||||
<input type="number" name="orden" class="form-control" value="{{ old('orden', 0) }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-end mt-4">
|
||||
<button type="submit" class="btn btn-primary px-4 shadow-sm">
|
||||
<i class="bi bi-save me-1"></i> Guardar Slide
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,76 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('title', 'Editar Slide')
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h2 class="mb-0">✏️ Editar Slide</h2>
|
||||
<a href="{{ route('admin.carousel.index') }}" class="btn btn-secondary shadow-sm">
|
||||
<i class="bi bi-arrow-left"></i> Volver a la Lista
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="card shadow-sm border-0">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('admin.carousel.update', $carouselItem->id) }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label font-weight-bold">Título</label>
|
||||
<input type="text" name="titulo" class="form-control" value="{{ old('titulo', $carouselItem->titulo) }}">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label font-weight-bold">Subtítulo</label>
|
||||
<input type="text" name="subtitulo" class="form-control" value="{{ old('subtitulo', $carouselItem->subtitulo) }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label font-weight-bold">Texto del Botón</label>
|
||||
<input type="text" name="boton_texto" class="form-control" value="{{ old('boton_texto', $carouselItem->boton_texto) }}">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label font-weight-bold">Enlace del Botón (URL)</label>
|
||||
<input type="text" name="boton_enlace" class="form-control" value="{{ old('boton_enlace', $carouselItem->boton_enlace) }}" placeholder="Ej: /eventos o https://...">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3 mt-4 align-items-center">
|
||||
<div class="col-md-3 text-center mb-3">
|
||||
<label class="form-label font-weight-bold w-100 text-start">Imagen Actual</label>
|
||||
<img src="{{ Str::startsWith($carouselItem->imagen, 'http') ? $carouselItem->imagen : asset($carouselItem->imagen) }}"
|
||||
alt="Slide actual" class="img-thumbnail w-100 shadow-sm" style="max-height: 150px; object-fit: cover;">
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<label class="form-label font-weight-bold">Reemplazar Imagen (Opcional)</label>
|
||||
<input type="file" name="imagen" class="form-control" accept="image/*">
|
||||
<small class="text-muted d-block mt-1">Si no subís nada se conservará la actual.</small>
|
||||
@error('imagen')
|
||||
<div class="text-danger small mt-1">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="col-md-2 mt-4 text-center">
|
||||
<div class="form-check form-switch fs-5 h-100 d-flex flex-column align-items-center justify-content-center">
|
||||
<label class="form-check-label ms-2 fs-6 mb-2" for="activo">Visible</label>
|
||||
<input class="form-check-input mt-0" type="checkbox" role="switch" name="activo" id="activo" value="1" style="height: 25px; width: 50px;" {{ $carouselItem->activo ? 'checked' : '' }}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label class="form-label font-weight-bold">Orden</label>
|
||||
<input type="number" name="orden" class="form-control" value="{{ old('orden', $carouselItem->orden) }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-end mt-4">
|
||||
<button type="submit" class="btn btn-primary px-4 shadow-sm">
|
||||
<i class="bi bi-save me-1"></i> Actualizar Slide
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,83 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('title', 'Carrusel Principal - Admin OnAPB')
|
||||
|
||||
@section('content')
|
||||
<div class="mb-5 d-flex justify-content-between align-items-end">
|
||||
<div>
|
||||
<span class="text-primary fw-bold text-uppercase tracking-widest d-block mb-2">Visual Merchandising</span>
|
||||
<h1 class="display-4 fw-bold font-header mb-0">Carrusel Principal<span class="text-primary">.</span></h1>
|
||||
</div>
|
||||
<a href="{{ route('admin.carousel.create') }}" class="btn-admin-primary">
|
||||
<i class="bi bi-plus-lg me-2"></i> AGREGAR SLIDE
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="admin-card">
|
||||
@if($items->isEmpty())
|
||||
<div class="text-center py-5">
|
||||
<i class="bi bi-images text-muted mb-3" style="font-size: 3rem;"></i>
|
||||
<p class="fs-5 text-muted">No hay slides en el carrusel.</p>
|
||||
</div>
|
||||
@else
|
||||
<div class="table-responsive">
|
||||
<table class="kinetic-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 80px;">Orden</th>
|
||||
<th>Imagen</th>
|
||||
<th>Título / Subtítulo</th>
|
||||
<th>Botón de Acción</th>
|
||||
<th>Estado</th>
|
||||
<th class="text-end">Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($items as $item)
|
||||
<tr>
|
||||
<td><span class="badge bg-light text-dark fw-bold border p-2">{{ $item->orden }}</span></td>
|
||||
<td>
|
||||
<div class="bg-dark" style="width: 120px; height: 60px; overflow: hidden; border: 1px solid var(--admin-outline);">
|
||||
<img src="{{ Str::startsWith($item->imagen, 'http') ? $item->imagen : asset($item->imagen) }}"
|
||||
alt="Slide" style="width: 100%; height: 100%; object-fit: cover;">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="fw-bold d-block text-uppercase">{{ $item->titulo ?: '(SIN TÍTULO)' }}</span>
|
||||
<small class="text-muted text-uppercase tracking-tighter">{{ $item->subtitulo }}</small>
|
||||
</td>
|
||||
<td>
|
||||
@if($item->boton_texto)
|
||||
<div class="small fw-bold text-primary">{{ $item->boton_texto }}</div>
|
||||
<div class="small text-muted font-monospace" style="font-size: 0.75rem;">{{ Str::limit($item->boton_enlace, 20) }}</div>
|
||||
@else
|
||||
<span class="text-muted small">—</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($item->activo)
|
||||
<span class="badge bg-success text-white text-uppercase px-2 py-1">ACTIVO</span>
|
||||
@else
|
||||
<span class="badge bg-light text-muted border text-uppercase px-2 py-1">OCULTO</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<a href="{{ route('admin.carousel.edit', $item->id) }}" class="btn btn-sm btn-light border me-1">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
<form action="{{ route('admin.carousel.destroy', $item->id) }}" method="POST" class="d-inline delete-form confirm-submit" data-confirm-text="¿Eliminar este slide?">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user