Add empleado, borrado del seeder, cambios esteticos y middleware.
This commit is contained in:
@@ -20,9 +20,15 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<a href="{{ route('suppliers.create') }}" class="w-full md:w-auto text-center px-5 py-3 text-sm font-bold text-neon-lime dark:text-neutral-900 bg-neutral-950 dark:bg-neon-lime rounded-lg hover:bg-neutral-900/80 hover:dark:bg-[#b3e600] transition-colors uppercase tracking-wide">
|
||||
+ Nuevo Proveedor
|
||||
</a>
|
||||
@if(auth()->user()->role === 'admin')
|
||||
<a href="{{ route('suppliers.create') }}" class="w-full md:w-auto text-center px-5 py-3 text-sm font-bold text-neon-lime dark:text-neutral-900 bg-neutral-950 dark:bg-neon-lime rounded-lg hover:bg-neutral-900/80 hover:dark:bg-[#b3e600] transition-colors uppercase tracking-wide">
|
||||
+ Nuevo Proveedor
|
||||
</a>
|
||||
@else
|
||||
<span title="Acceso denegado" class="w-full md:w-auto text-center px-5 py-3 text-sm font-bold text-gray-500 dark:text-neutral-500 bg-gray-300 dark:bg-neutral-800 border border-gray-400 dark:border-neutral-700 rounded-lg cursor-not-allowed pointer-events-none select-none uppercase tracking-wide">
|
||||
+ Nuevo Proveedor
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg border border-gray-400 dark:border-neutral-800 w-full">
|
||||
@@ -60,25 +66,54 @@
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-right flex items-center justify-end gap-3">
|
||||
<!-- Ver Más -->
|
||||
<a href="{{ route('suppliers.show', $supplier) }}" title="Ver Más" class="font-semibold p-2 text-green-700 dark:text-green-400 border-2 border-green-700 rounded-lg hover:bg-green-700 dark:hover:bg-green-600 dark:hover:border-green-600 hover:text-white dark:hover:text-white transition-colors">
|
||||
<svg class="size-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke="currentColor" stroke-width="2" d="M21 12c0 1.2-4.03 6-9 6s-9-4.8-9-6c0-1.2 4.03-6 9-6s9 4.8 9 6Z"/>
|
||||
<path stroke="currentColor" stroke-width="2" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/>
|
||||
</svg>
|
||||
</a>
|
||||
|
||||
<!-- Hacer Pedido -->
|
||||
<a href="{{ route('suppliers.order', $supplier) }}" title="Hacer Pedido" class="font-semibold p-2 text-green-600 dark:text-green-400 border-2 border-green-600 rounded-lg hover:bg-green-600 hover:text-white dark:hover:text-white transition-colors">
|
||||
<svg class="size-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path fill-rule="evenodd" d="M12 4a8 8 0 0 0-6.895 12.06l.569 1.167-1.076 2.872 3.018-1.045 1.18.528A8 8 0 1 0 12 4Zm5.1 10.3c-.28-.14-1.65-.815-1.905-.909-.255-.094-.44-.14-.625.14-.185.28-.72 1.054-.882 1.265-.162.21-.324.234-.604.094-.28-.14-1.178-.435-2.246-1.385-.83-.739-1.39-1.65-1.552-1.93-.162-.28-.017-.432.123-.57.126-.125.28-.328.42-.493.14-.165.187-.28.28-.468.093-.188.047-.35-.023-.491-.07-.14-.625-1.508-.857-2.064-.225-.544-.454-.47-.625-.478-.162-.008-.348-.01-.533-.01-.185 0-.485.07-.74.35-.255.28-.972.95-.972 2.316 0 1.366.995 2.687 1.133 2.874.138.188 1.956 2.986 4.74 4.153.662.277 1.18.442 1.583.565.665.204 1.27.175 1.745.106.531-.077 1.65-.674 1.882-1.325.232-.651.232-1.21.162-1.325-.07-.116-.255-.186-.535-.326Z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
</a>
|
||||
<a href="{{ route('suppliers.edit', $supplier) }}" title="Editar" class="font-semibold p-2 text-blue-700 dark:text-blue-400 border-2 border-blue-700 rounded-lg hover:bg-blue-700 hover:text-white dark:hover:text-white transition-colors">
|
||||
<svg class="size-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m14.304 4.844 2.852 2.852M7 7H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-4.5m2.409-9.91a2.017 2.017 0 0 1 0 2.853l-6.844 6.844L8 14l.713-3.565 6.844-6.844a2.015 2.015 0 0 1 2.852 0Z"/>
|
||||
</svg>
|
||||
</a>
|
||||
<form action="{{route('suppliers.destroy', $supplier)}}" method="post" class="delete-form">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button title="Eliminar" type="submit" class="w-full sm:w-auto p-2 font-bold dark:font-medium text-red-600 dark:text-red-400 border-2 border-red-600 rounded-lg hover:bg-red-600 hover:text-white dark:hover:text-white transition-colors">
|
||||
|
||||
<!-- Editar -->
|
||||
@if(auth()->user()->role === 'admin')
|
||||
<a href="{{ route('suppliers.edit', $supplier) }}" title="Editar" class="font-semibold p-2 text-blue-800 dark:text-blue-400 border-2 border-blue-800 rounded-lg hover:bg-blue-800 hover:text-white dark:hover:text-white transition-colors">
|
||||
<svg class="size-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m14.304 4.844 2.852 2.852M7 7H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-4.5m2.409-9.91a2.017 2.017 0 0 1 0 2.853l-6.844 6.844L8 14l.713-3.565 6.844-6.844a2.015 2.015 0 0 1 2.852 0Z"/>
|
||||
</svg>
|
||||
</a>
|
||||
@else
|
||||
<span title="Acceso denegado" class="font-semibold p-2 text-gray-400 dark:text-neutral-500 border-2 border-gray-300 dark:border-neutral-700 rounded-lg bg-gray-100 dark:bg-neutral-800/30 cursor-not-allowed pointer-events-none select-none">
|
||||
<svg class="size-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m14.304 4.844 2.852 2.852M7 7H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-4.5m2.409-9.91a2.017 2.017 0 0 1 0 2.853l-6.844 6.844L8 14l.713-3.565 6.844-6.844a2.015 2.015 0 0 1 2.852 0Z"/>
|
||||
</svg>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
<!-- Eliminar -->
|
||||
@if(auth()->user()->role === 'admin')
|
||||
<form action="{{route('suppliers.destroy', $supplier)}}" method="post" class="delete-form">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button title="Eliminar" type="submit" class="w-full sm:w-auto p-2 font-bold dark:font-medium text-red-600 dark:text-red-400 border-2 border-red-600 rounded-lg hover:bg-red-600 hover:text-white dark:hover:text-white transition-colors">
|
||||
<svg class="size-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 7h14m-9 3v8m4-8v8M10 3h4a1 1 0 0 1 1 1v3H9V4a1 1 0 0 1 1-1ZM6 7h12v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7Z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<span title="Acceso denegado" class="p-2 font-bold dark:font-medium text-gray-400 dark:text-neutral-500 border-2 border-gray-300 dark:border-neutral-700 rounded-lg bg-gray-100 dark:bg-neutral-800/30 cursor-not-allowed pointer-events-none select-none">
|
||||
<svg class="size-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 7h14m-9 3v8m4-8v8M10 3h4a1 1 0 0 1 1 1v3H9V4a1 1 0 0 1 1-1ZM6 7h12v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7Z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
</span>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<x-layout title="Lauck - Detalle de Proveedor">
|
||||
<x-section-header subtitle="Proveedores" title="Detalle de " highlight="Proveedor" />
|
||||
|
||||
<div class="w-full max-w-4xl mx-auto bg-gray-200 dark:bg-panel-bg border border-neutral-400 dark:border-neutral-800 rounded-xl p-8 shadow-lg relative">
|
||||
<div class="flex justify-between items-start mb-6">
|
||||
<div>
|
||||
<h3 class="text-2xl font-bold text-neutral-900 dark:text-white">{{ $supplier->name }}</h3>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400">Registrado el: {{ $supplier->created_at->format('d/m/Y H:i') }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{{ route('suppliers.index') }}" class="text-sm font-bold text-gray-500 hover:text-white transition-colors">Volver al listado</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 bg-gray-300 dark:bg-neutral-800 p-6 rounded-lg border border-gray-400 dark:border-neutral-700">
|
||||
<div>
|
||||
<p class="text-xs text-gray-500 uppercase tracking-wider mb-1">Nombre / Razón Social</p>
|
||||
<p class="text-lg font-bold text-neutral-900 dark:text-white">{{ $supplier->name }}</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p class="text-xs text-gray-500 uppercase tracking-wider mb-1">Teléfono / WhatsApp</p>
|
||||
@if($supplier->phone)
|
||||
<p class="text-lg font-bold text-neutral-900 dark:text-white font-mono">{{ $supplier->phone }}</p>
|
||||
@else
|
||||
<p class="text-lg text-gray-500 italic">No registrado</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p class="text-xs text-gray-500 uppercase tracking-wider mb-1">Correo Electrónico</p>
|
||||
@if($supplier->email)
|
||||
<p class="text-base font-semibold text-neutral-900 dark:text-white font-mono">{{ $supplier->email }}</p>
|
||||
@else
|
||||
<p class="text-base text-gray-500 italic">No registrado</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p class="text-xs text-gray-500 uppercase tracking-wider mb-1">Dirección</p>
|
||||
@if($supplier->address)
|
||||
<p class="text-base font-semibold text-neutral-900 dark:text-white">{{ $supplier->address }}</p>
|
||||
@else
|
||||
<p class="text-base text-gray-500 italic">No registrada</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-8 flex justify-end gap-4">
|
||||
@if(auth()->user()->role === 'admin')
|
||||
<a href="{{ route('suppliers.order', $supplier) }}" class="px-6 py-2.5 text-sm font-bold text-white bg-green-600 hover:bg-green-700 rounded-lg transition-colors">
|
||||
Hacer Pedido
|
||||
</a>
|
||||
<a href="{{ route('suppliers.edit', $supplier) }}" class="px-6 py-2.5 text-sm font-bold text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors">
|
||||
Editar Proveedor
|
||||
</a>
|
||||
@else
|
||||
<span title="Acceso denegado" class="px-6 py-2.5 text-sm font-bold text-gray-400 bg-gray-300 dark:bg-neutral-800 border border-gray-400 dark:border-neutral-700 rounded-lg cursor-not-allowed pointer-events-none">
|
||||
Hacer Pedido
|
||||
</span>
|
||||
<span title="Acceso denegado" class="px-6 py-2.5 text-sm font-bold text-gray-400 bg-gray-300 dark:bg-neutral-800 border border-gray-400 dark:border-neutral-700 rounded-lg cursor-not-allowed pointer-events-none">
|
||||
Editar Proveedor
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</x-layout>
|
||||
Reference in New Issue
Block a user