94 lines
5.1 KiB
PHP
94 lines
5.1 KiB
PHP
<x-app-layout>
|
|
<x-slot name="header">
|
|
<h2 class="font-semibold text-xl text-white leading-tight">
|
|
{{ __('Zarządzanie Użytkownikami') }}
|
|
</h2>
|
|
</x-slot>
|
|
|
|
<!-- Styl do wymuszenia powiększonych badge'y i efektu hover niezależnie od Vite/Tailwind -->
|
|
<style>
|
|
.custom-table-row:hover {
|
|
background-color: rgba(255, 255, 255, 0.05) !important;
|
|
}
|
|
.role-badge {
|
|
display: inline-block !important;
|
|
padding: 6px 20px !important;
|
|
min-width: 120px !important;
|
|
text-align: center !important;
|
|
border-radius: 6px !important;
|
|
}
|
|
</style>
|
|
|
|
<div class="py-12">
|
|
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
|
<div class="bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg border border-gray-700/50">
|
|
<div class="p-6 text-white">
|
|
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full border-collapse" style="table-layout: fixed;">
|
|
<thead>
|
|
<tr class="border-b border-gray-700 text-xs font-semibold uppercase tracking-wider text-gray-300">
|
|
<th scope="col" class="py-3.5 px-4" style="text-align: center !important; width: 25%;">Imię i nazwisko</th>
|
|
<th scope="col" class="py-3.5 px-4" style="text-align: center !important; width: 35%;">Adres e-mail</th>
|
|
<th scope="col" class="py-3.5 px-4" style="text-align: center !important; width: 25%;">Rola</th>
|
|
<th scope="col" class="py-3.5 px-4" style="text-align: center !important; width: 15%;">Akcje</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody class="divide-y divide-gray-700/60 text-sm">
|
|
@forelse($users as $user)
|
|
<tr class="custom-table-row transition-colors duration-150">
|
|
|
|
<!-- Imię i Nazwisko -->
|
|
<td class="py-4 px-4 font-medium text-white align-middle" style="text-align: center !important;">
|
|
{{ $user->name }} {{ $user->surname }}
|
|
</td>
|
|
|
|
<!-- Email (Wymuszone wycentrowanie) -->
|
|
<td class="py-4 px-4 text-gray-300 align-middle" style="text-align: center !important;">
|
|
{{ $user->email }}
|
|
</td>
|
|
|
|
<!-- Rola (Poszerzony badge z min-width 120px) -->
|
|
<td class="py-4 px-4 text-gray-300 align-middle" style="text-align: center !important;">
|
|
<div style="display: flex; justify-content: center; align-items: center; gap: 8px;">
|
|
@forelse($user->roles as $role)
|
|
<span class="role-badge text-xs font-semibold uppercase tracking-wider bg-gray-700 text-gray-100 border border-gray-600 shadow-sm">
|
|
{{ $role->name }}
|
|
</span>
|
|
@empty
|
|
<span class="text-gray-500 text-xs">brak</span>
|
|
@endforelse
|
|
</div>
|
|
</td>
|
|
|
|
<!-- Akcje -->
|
|
<td class="py-4 px-4 align-middle" style="text-align: center !important;">
|
|
<a href="{{ route('users.edit', $user) }}" class="text-indigo-400 hover:text-indigo-300 font-medium text-sm transition">
|
|
Edytuj
|
|
</a>
|
|
</td>
|
|
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="4" class="py-8 text-gray-400" style="text-align: center !important;">
|
|
Brak użytkowników do wyświetlenia.
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
@if($users->hasPages())
|
|
<div class="mt-6 pt-4 border-t border-gray-700">
|
|
{{ $users->links() }}
|
|
</div>
|
|
@endif
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|