Update show-usuarios.blade.php

This commit is contained in:
Lizandro Guarnizo
2026-04-18 13:58:16 -05:00
parent 22f322155b
commit 9a418caf39
@@ -76,7 +76,7 @@
</x-slot>
<x-slot name="tbody">
@foreach ($usuarios as $usuario)
<tr wire:key="usuario-{{ $usuario->id }}" class="border-gray-200 text-left hover:bg-purple-50 transition-colors" x-data="{ openOption: false, openDetails: false }">
<tr wire:key="usuario-{{ $usuario->id }}" class="border-gray-200 text-left hover:bg-purple-50 transition-colors" x-data="{ openOption: false, openDetails: false, menuX: 0, menuY: 0, toggleMenu(btn){ const r = btn.getBoundingClientRect(); menuX = r.right - 160; menuY = r.bottom + 4; openOption = !openOption; } }">
@if (auth()->user()->rol_id == 5)
<td>{{ $usuario->subvendedor_relacion->name ?? 'N/A' }}</td>
@@ -142,14 +142,14 @@
</td>
@if (auth()->user()->rol->nombre == 'super')
<td class="relative">
<button x-on:click="openOption=!openOption" class="p-1 rounded-lg hover:bg-gray-100">
<td>
<button @click="toggleMenu($el)" class="p-1 rounded-lg hover:bg-gray-100">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 cursor-pointer">
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
</svg>
</button>
<div x-cloak x-show="openOption" @click.away="openOption = false" class="absolute right-0 top-8 z-20 bg-white text-center w-[10rem] rounded-xl border border-gray-200 shadow-xl">
<div x-cloak x-show="openOption" @click.away="openOption = false" :style="`position:fixed;top:${menuY}px;left:${menuX}px;`" class="z-50 bg-white text-center w-[10rem] rounded-xl border border-gray-200 shadow-xl">
<button x-on:click="openOption=false" wire:click="editar({{ $usuario->id }})" class="text-gray-600 w-full py-1.5 text-sm hover:bg-gray-50 border-b border-gray-100 hover:rounded-t-xl">Editar</button>
<button x-on:click="openOption=false" wire:click="editarPassword({{ $usuario->id }})" class="text-gray-600 w-full py-1.5 text-sm hover:bg-gray-50 border-b border-gray-100">Editar contraseña</button>
<button x-on:click="openOption=false" wire:click="saldo({{ $usuario->id }})" class="text-gray-600 w-full py-1.5 text-sm hover:bg-gray-50 border-b border-gray-100">Agregar saldo</button>
@@ -160,14 +160,14 @@
</div>
</td>
@elseif (Auth::user()->subvendedor && $config->subvendedor)
<td class="relative">
<button x-on:click="openOption=!openOption" class="p-1 rounded-lg hover:bg-gray-100">
<td>
<button @click="toggleMenu($el)" class="p-1 rounded-lg hover:bg-gray-100">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 cursor-pointer">
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
</svg>
</button>
<div x-cloak x-show="openOption" @click.away="openOption = false" class="absolute right-0 top-8 z-20 bg-white text-center w-[10rem] rounded-xl border border-gray-200 shadow-xl">
<div x-cloak x-show="openOption" @click.away="openOption = false" :style="`position:fixed;top:${menuY}px;left:${menuX}px;`" class="z-50 bg-white text-center w-[10rem] rounded-xl border border-gray-200 shadow-xl">
<button x-on:click="openOption=false" wire:click="editar({{ $usuario->id }})" class="text-gray-600 w-full py-1.5 text-sm hover:bg-gray-50 border-b border-gray-100 hover:rounded-t-xl">Editar</button>
<button x-on:click="openOption=false" wire:click="editarPassword({{ $usuario->id }})" class="text-gray-600 w-full py-1.5 text-sm hover:bg-gray-50 border-b border-gray-100">Editar contraseña</button>
@if ($usuario->subvendedor)