mejoras en la gestión de proyectos y documentos: se añaden nuevos campos y validaciones para optimizar la organización y el seguimiento de los mismos.
This commit is contained in:
@@ -7,11 +7,11 @@
|
||||
</button>
|
||||
|
||||
<div x-show="open" @click.outside="open = false"
|
||||
class="absolute bg-white shadow-lg rounded-lg p-4 mt-2 min-w-[200px] z-10">
|
||||
class="absolute bg-white shadow-lg rounded-lg p-4 mt-2 min-w-[200px] z-10">
|
||||
@foreach($available_columns as $key => $label)
|
||||
<label class="flex items-center gap-2 mb-2">
|
||||
<input type="checkbox" wire:model.live="columns.{{ $key }}"
|
||||
class="rounded border-gray-300">
|
||||
class="rounded border-gray-300">
|
||||
{{ $label }}
|
||||
</label>
|
||||
@endforeach
|
||||
@@ -61,120 +61,96 @@
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200">
|
||||
@foreach($users as $user)
|
||||
<tr>
|
||||
@if($columns['full_name'])
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<a href="{{ route('users.show', $user) }}" class="flex items-center hover:text-blue-600 hover:underline group">
|
||||
<!-- Foto del usuario -->
|
||||
@if($user->profile_photo_path)
|
||||
<div class="mr-3 flex-shrink-0">
|
||||
<img src="{{ asset('storage/' . $user->profile_photo_path) }}"
|
||||
alt="{{ $user->full_name }}"
|
||||
class="w-8 h-8 rounded-full object-cover transition-transform group-hover:scale-110">
|
||||
</div>
|
||||
@else
|
||||
<div class="w-8 h-8 rounded-full bg-gray-100 mr-3 flex items-center justify-center transition-colors group-hover:bg-blue-100">
|
||||
<flux:icon.user variant="solid" class="size-4" />
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Nombre completo con efecto hover -->
|
||||
<span class="group-hover:text-blue-600 transition-colors">
|
||||
{{ $user->full_name }}
|
||||
@if(!$user->is_active)
|
||||
<span class="text-xs text-red-500 ml-2">(Inactivo)</span>
|
||||
@endif
|
||||
</span>
|
||||
<!-- Iteramos dinámicamente sobre las columnas disponibles -->
|
||||
@foreach($available_columns as $key => $label)
|
||||
@if($columns[$key])
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
@switch($key)
|
||||
@case('full_name')
|
||||
<a href="{{ route('users.show', $user) }}" class="flex items-center hover:text-blue-600 hover:underline group">
|
||||
@if($user->profile_photo_path)
|
||||
<div class="mr-3 flex-shrink-0">
|
||||
<img src="{{ asset('storage/' . $user->profile_photo_path) }}"
|
||||
alt="{{ $user->full_name }}"
|
||||
class="w-8 h-8 rounded-full object-cover transition-transform group-hover:scale-110">
|
||||
</div>
|
||||
@else
|
||||
<div class="w-8 h-8 rounded-full bg-gray-100 mr-3 flex items-center justify-center transition-colors group-hover:bg-blue-100">
|
||||
<flux:icon.user variant="solid" class="size-4" />
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<span class="group-hover:text-blue-600 transition-colors">
|
||||
{{ $user->full_name }}
|
||||
@if(!$user->is_active)
|
||||
<span class="text-xs text-red-500 ml-2">(Inactivo)</span>
|
||||
@endif
|
||||
</span>
|
||||
</a>
|
||||
@break
|
||||
|
||||
@case('email')
|
||||
<div class="flex items-center gap-2">
|
||||
<svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
{{ $user->email }}
|
||||
</div>
|
||||
@break
|
||||
|
||||
@case('phone')
|
||||
<div class="flex items-center gap-2">
|
||||
<svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"/>
|
||||
</svg>
|
||||
{{ $user->phone ?? 'N/A' }}
|
||||
</div>
|
||||
@break
|
||||
|
||||
@case('access_start')
|
||||
{{ $user->access_start?->format('d/m/Y') ?? 'N/A' }}
|
||||
@break
|
||||
|
||||
@case('created_at')
|
||||
{{ $user->created_at->format('d/m/Y H:i') }}
|
||||
@break
|
||||
|
||||
@case('is_active')
|
||||
{{ $user->is_active ? 'Activo' : 'Inactivo' }}
|
||||
@break
|
||||
|
||||
@default
|
||||
{{ $user->$key ?? 'N/A' }}
|
||||
@endswitch
|
||||
</td>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<!-- Acciones -->
|
||||
<div class="flex items-center gap-2">
|
||||
<!-- Botón Editar -->
|
||||
<a href="{{ route('users.edit', $user) }}"
|
||||
class="text-blue-600 hover:text-blue-900"
|
||||
title="Editar usuario">
|
||||
<flux:icon.pencil class="size-5"/>
|
||||
</a>
|
||||
</td>
|
||||
@endif
|
||||
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
@if($columns['username'])
|
||||
{{ $user->username }}
|
||||
@else
|
||||
N/A
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
@if($columns['email'])
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
{{ $user->email }}
|
||||
</div>
|
||||
@else
|
||||
N/A
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
@if($columns['phone'])
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"/>
|
||||
</svg>
|
||||
{{ $user->phone ?? 'N/A' }}
|
||||
</div>
|
||||
@else
|
||||
N/A
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
@if($columns['access_start'])
|
||||
{{ $user->access_start?->format('d/m/Y') }}
|
||||
@else
|
||||
N/A
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
@if($columns['created_at'])
|
||||
{{ $user->created_at->format('d/m/Y H:i') }}
|
||||
@else
|
||||
N/A
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
@if($columns['is_active'])
|
||||
{{ $user->is_active ? 'Activo' : 'Inactivo' }}
|
||||
@else
|
||||
N/A
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<!-- Acciones -->
|
||||
<div class="flex items-center gap-2">
|
||||
<!-- Botón Editar -->
|
||||
<a href="{{ route('users.edit', $user) }}"
|
||||
class="text-blue-600 hover:text-blue-900"
|
||||
title="Editar usuario">
|
||||
<flux:icon.pencil class="size-5"/>
|
||||
</a>
|
||||
|
||||
<!-- Botón Eliminar -->
|
||||
<button wire:click="confirmDelete({{ $user->id }})"
|
||||
class="text-red-600 hover:text-red-900"
|
||||
title="Eliminar usuario">
|
||||
<flux:icon.trash class="size-5"/>
|
||||
</button>
|
||||
<!-- Botón Eliminar -->
|
||||
<button wire:click="confirmDelete({{ $user->id }})"
|
||||
class="text-red-600 hover:text-red-900"
|
||||
title="Eliminar usuario">
|
||||
<flux:icon.trash class="size-5"/>
|
||||
</button>
|
||||
|
||||
<flux:button size="sm" icon="trash" variant="ghost" inset />
|
||||
</div>
|
||||
<flux:button size="sm" icon="trash" variant="ghost" inset />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
Reference in New Issue
Block a user