137 lines
9.2 KiB
PHP
137 lines
9.2 KiB
PHP
<x-slot:breadcrumbParent>System</x-slot:breadcrumbParent>
|
|
<x-slot:breadcrumb>Benutzer</x-slot:breadcrumb>
|
|
|
|
<div>
|
|
|
|
<div class="mbx-page-header">
|
|
<div class="mbx-page-title">
|
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
<circle cx="6.5" cy="5" r="3" stroke="currentColor" stroke-width="1.3"/>
|
|
<path d="M1 14c0-3 2.5-5 5.5-5s5.5 2 5.5 5" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"/>
|
|
<path d="M12 7.5v4M10 9.5h4" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"/>
|
|
</svg>
|
|
Benutzer
|
|
<span class="mbx-total-badge">{{ $users->count() }}</span>
|
|
</div>
|
|
<div class="mbx-page-actions">
|
|
<div class="mbx-search-wrap">
|
|
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" style="flex-shrink:0;color:var(--mw-t4)">
|
|
<circle cx="5.5" cy="5.5" r="4" stroke="currentColor" stroke-width="1.2"/>
|
|
<path d="M9 9l2.5 2.5" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
|
|
</svg>
|
|
<input type="text" wire:model.live.debounce.250ms="search"
|
|
class="mbx-search-input" placeholder="Name oder E-Mail …">
|
|
</div>
|
|
<button wire:click="$dispatch('openModal',{component:'ui.system.modal.user-create-modal'})"
|
|
class="mbx-btn-primary">
|
|
<svg width="11" height="11" viewBox="0 0 11 11" fill="none"><path d="M5.5 1v9M1 5.5h9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>
|
|
Benutzer
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mbx-sections">
|
|
<div class="mbx-section">
|
|
|
|
{{-- Role filter --}}
|
|
<div style="display:flex;align-items:center;gap:6px;padding:10px 14px;border-bottom:1px solid var(--mw-b1);flex-wrap:wrap">
|
|
<span style="font-size:10.5px;color:var(--mw-t4)">Rolle:</span>
|
|
<button wire:click="$set('filterRole','')"
|
|
style="padding:3px 10px;border-radius:5px;font-size:10.5px;border:1px solid {{ $filterRole === '' ? 'var(--mw-vbd)' : 'var(--mw-b2)' }};background:{{ $filterRole === '' ? 'var(--mw-vbg)' : 'transparent' }};color:{{ $filterRole === '' ? 'var(--mw-v2)' : 'var(--mw-t4)' }};cursor:pointer;font-weight:{{ $filterRole === '' ? '600' : '400' }}">
|
|
Alle
|
|
</button>
|
|
@foreach($roles as $role)
|
|
<button wire:click="$set('filterRole','{{ $role->value }}')"
|
|
style="padding:3px 10px;border-radius:5px;font-size:10.5px;border:1px solid {{ $filterRole === $role->value ? 'var(--mw-vbd)' : 'var(--mw-b2)' }};background:{{ $filterRole === $role->value ? 'var(--mw-vbg)' : 'transparent' }};color:{{ $filterRole === $role->value ? 'var(--mw-v2)' : 'var(--mw-t4)' }};cursor:pointer;font-weight:{{ $filterRole === $role->value ? '600' : '400' }}">
|
|
{{ $role->label() }}
|
|
</button>
|
|
@endforeach
|
|
</div>
|
|
|
|
@if($users->isEmpty())
|
|
<div style="padding:32px 16px;text-align:center">
|
|
<svg width="28" height="28" viewBox="0 0 16 16" fill="none" style="color:var(--mw-t4);margin:0 auto 10px;display:block">
|
|
<circle cx="6.5" cy="5" r="3" stroke="currentColor" stroke-width="1.3"/>
|
|
<path d="M1 14c0-3 2.5-5 5.5-5s5.5 2 5.5 5" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"/>
|
|
</svg>
|
|
<div style="font-size:12.5px;color:var(--mw-t3)">Keine Benutzer gefunden</div>
|
|
</div>
|
|
@else
|
|
<div class="mbx-table-wrap">
|
|
<table class="mbx-table">
|
|
<thead>
|
|
<tr>
|
|
<th class="mbx-th">Benutzer</th>
|
|
<th class="mbx-th">E-Mail</th>
|
|
<th class="mbx-th" style="width:100px">Rolle</th>
|
|
<th class="mbx-th" style="width:80px">Status</th>
|
|
<th class="mbx-th" style="width:130px">Letzter Login</th>
|
|
<th class="mbx-th mbx-th-right" style="width:80px">Aktionen</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($users as $user)
|
|
<tr class="mbx-tr">
|
|
<td class="mbx-td">
|
|
<div style="display:flex;align-items:center;gap:9px">
|
|
<div style="width:28px;height:28px;border-radius:50%;background:var(--mw-vbg);border:1px solid var(--mw-vbd);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;color:var(--mw-v2);flex-shrink:0">
|
|
{{ strtoupper(substr($user->name, 0, 2)) }}
|
|
</div>
|
|
<div>
|
|
<div style="font-size:12.5px;font-weight:500;color:var(--mw-t1)">{{ $user->name }}</div>
|
|
@if($user->id === auth()->id())
|
|
<div style="font-size:10px;color:var(--mw-t4)">Du</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td class="mbx-td mbx-td-muted" style="font-family:monospace;font-size:11.5px">{{ $user->email }}</td>
|
|
<td class="mbx-td">
|
|
<span class="{{ $user->role?->badgeClass() ?? 'mbx-badge-mute' }}">
|
|
{{ $user->role?->label() ?? '—' }}
|
|
</span>
|
|
</td>
|
|
<td class="mbx-td">
|
|
@if($user->is_active)
|
|
<span class="mbx-badge-ok">Aktiv</span>
|
|
@else
|
|
<span class="mbx-badge-warn">Inaktiv</span>
|
|
@endif
|
|
</td>
|
|
<td class="mbx-td mbx-td-muted" style="font-size:11px">
|
|
{{ $user->last_login_at?->diffForHumans() ?? '—' }}
|
|
</td>
|
|
<td class="mbx-td">
|
|
<div class="mbx-actions">
|
|
<button wire:click="$dispatch('openModal',{component:'ui.system.modal.user-edit-modal',arguments:{userId:{{ $user->id }}}})"
|
|
class="mbx-act-btn" title="Bearbeiten">
|
|
<svg width="12" height="12" viewBox="0 0 13 13" fill="none"><path d="M9 2l2 2-7 7H2V9l7-7Z" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/></svg>
|
|
</button>
|
|
@if($user->id !== auth()->id())
|
|
<button wire:click="toggleActive({{ $user->id }})"
|
|
class="mbx-act-btn" title="{{ $user->is_active ? 'Deaktivieren' : 'Aktivieren' }}">
|
|
@if($user->is_active)
|
|
<svg width="12" height="12" viewBox="0 0 13 13" fill="none"><circle cx="6.5" cy="6.5" r="5.5" stroke="currentColor" stroke-width="1.2"/><path d="M4 6.5l2 2 3-3" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
|
@else
|
|
<svg width="12" height="12" viewBox="0 0 13 13" fill="none"><circle cx="6.5" cy="6.5" r="5.5" stroke="currentColor" stroke-width="1.2"/><path d="M4.5 4.5l4 4M8.5 4.5l-4 4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>
|
|
@endif
|
|
</button>
|
|
<button wire:click="$dispatch('openModal',{component:'ui.system.modal.user-delete-modal',arguments:{userId:{{ $user->id }}}})"
|
|
class="mbx-act-btn mbx-act-danger" title="Löschen">
|
|
<svg width="12" height="12" viewBox="0 0 13 13" fill="none"><path d="M2 3h9M5 3V2h3v1M3.5 3l.5 8h5l.5-8" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
|
</button>
|
|
@endif
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@endif
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|