first&last

This commit is contained in:
sbb45
2026-03-20 15:47:17 +05:00
commit d6441abdd2
230 changed files with 20367 additions and 0 deletions
@@ -0,0 +1,15 @@
<div class="card"><div class="card-body">
<form wire:submit="save" class="space-y-4">
<div class="grid gap-4 md:grid-cols-2">
<div><label class="text-sm font-medium">Имя</label><input wire:model.defer="name" class="mt-1 w-full rounded-xl border border-slate-300 px-3 py-2"></div>
<div><label class="text-sm font-medium">Email</label><input wire:model.defer="email" type="email" class="mt-1 w-full rounded-xl border border-slate-300 px-3 py-2"></div>
<div><label class="text-sm font-medium">Роль</label><select wire:model.defer="role" class="mt-1 w-full rounded-xl border border-slate-300 px-3 py-2"><option value="admin">Админ</option><option value="manager">Менеджер</option><option value="technician">Техник</option><option value="client">Клиент</option></select></div>
<div><label class="text-sm font-medium">Отдел</label><select wire:model.defer="departmentId" class="mt-1 w-full rounded-xl border border-slate-300 px-3 py-2"><option value="">Не выбран</option>@foreach($departments as $item)<option value="{{ $item->id }}">{{ $item->name }}</option>@endforeach</select></div>
<div><label class="text-sm font-medium">Телефон</label><input wire:model.defer="phone" class="mt-1 w-full rounded-xl border border-slate-300 px-3 py-2"></div>
<div><label class="text-sm font-medium">Пароль</label><input wire:model.defer="password" type="password" class="mt-1 w-full rounded-xl border border-slate-300 px-3 py-2"></div>
<div><label class="text-sm font-medium">Подтверждение пароля</label><input wire:model.defer="password_confirmation" type="password" class="mt-1 w-full rounded-xl border border-slate-300 px-3 py-2"></div>
<div class="md:col-span-2"><label class="inline-flex items-center gap-2"><input wire:model.defer="isActive" type="checkbox" class="rounded"> <span class="text-sm">Активен</span></label></div>
</div>
<div class="flex justify-end gap-2"><a href="{{ route('users.index') }}" class="rounded-xl border border-slate-300 px-4 py-2">Отмена</a><button class="rounded-xl bg-slate-900 text-white px-4 py-2">Сохранить</button></div>
</form>
</div></div>
@@ -0,0 +1,23 @@
<div class="space-y-4">
<div class="card"><div class="card-body flex items-start justify-between gap-3">
<div>
<h1 class="text-xl font-semibold">{{ $user->name }}</h1>
<p class="text-sm text-slate-500">{{ $user->email }} {{ $user->role->label() }}</p>
<p class="text-sm text-slate-500 mt-1">{{ $user->department?->name ?? 'Без отдела' }}</p>
</div>
@if(auth()->user()->isAdmin())
<a href="{{ route('users.edit', $user) }}" class="rounded-xl border border-slate-300 px-3 py-2 text-sm">Редактировать</a>
@endif
</div></div>
<div class="grid gap-4 md:grid-cols-3">
<div class="card"><div class="card-body"><p class="text-sm text-slate-500">Назначено заявок</p><p class="text-2xl font-semibold mt-1">{{ $assigned }}</p></div></div>
<div class="card"><div class="card-body"><p class="text-sm text-slate-500">Решено заявок</p><p class="text-2xl font-semibold mt-1">{{ $resolved }}</p></div></div>
<div class="card"><div class="card-body"><p class="text-sm text-slate-500">Средний рейтинг</p><p class="text-2xl font-semibold mt-1">{{ $avgRating }}</p></div></div>
</div>
<div class="grid gap-4 lg:grid-cols-2">
<div class="card"><div class="card-body"><h2 class="text-lg font-semibold">Последние заявки</h2><div class="space-y-2 mt-3">@foreach($recentRequests as $item)<a href="{{ route('requests.show', $item) }}" class="block rounded-lg border border-slate-200 px-3 py-2 hover:bg-slate-50 text-sm">{{ $item->ticket_number }} {{ $item->title }}</a>@endforeach</div></div></div>
<div class="card"><div class="card-body"><h2 class="text-lg font-semibold">Активность</h2><div class="space-y-2 mt-3">@foreach($activities as $item)<div class="rounded-lg border border-slate-200 px-3 py-2 text-sm">{{ $item->description }}<p class="text-xs text-slate-500 mt-1">{{ $item->created_at?->format('d.m.Y H:i') }}</p></div>@endforeach</div></div></div>
</div>
</div>
@@ -0,0 +1,33 @@
<div class="space-y-4">
<div class="flex flex-wrap items-center gap-2 justify-between">
<div class="flex flex-wrap gap-2">
<input wire:model.live.debounce.300ms="search" class="rounded-xl border border-slate-300 px-3 py-2" placeholder="Поиск пользователей">
<select wire:model.live="role" class="rounded-xl border border-slate-300 px-3 py-2"><option value="">Все роли</option><option value="admin">Админ</option><option value="manager">Менеджер</option><option value="technician">Техник</option><option value="client">Клиент</option></select>
<select wire:model.live="status" class="rounded-xl border border-slate-300 px-3 py-2"><option value="">Все статусы</option><option value="active">Активные</option><option value="inactive">Неактивные</option></select>
</div>
@if(auth()->user()->isAdmin())
<a href="{{ route('users.create') }}" class="rounded-xl bg-slate-900 text-white px-4 py-2 text-sm">Создать пользователя</a>
@endif
</div>
<div class="card overflow-hidden">
<table class="min-w-full text-sm">
<thead class="bg-slate-50"><tr><th class="px-3 py-2 text-left">Пользователь</th><th class="px-3 py-2 text-left">Роль</th><th class="px-3 py-2 text-left">Отдел</th><th class="px-3 py-2 text-left">Статус</th><th class="px-3 py-2 text-left">Последний вход</th><th class="px-3 py-2"></th></tr></thead>
<tbody>
@forelse($users as $user)
<tr class="border-t border-slate-100">
<td class="px-3 py-2"><p class="font-medium">{{ $user->name }}</p><p class="text-xs text-slate-500">{{ $user->email }}</p></td>
<td class="px-3 py-2">{{ $user->role->label() }}</td>
<td class="px-3 py-2">{{ $user->department?->name ?? '—' }}</td>
<td class="px-3 py-2">{!! $user->is_active ? '<span class="text-emerald-600">Активен</span>' : '<span class="text-rose-600">Неактивен</span>' !!}</td>
<td class="px-3 py-2">{{ $user->last_login_at?->format('d.m.Y H:i') ?? '—' }}</td>
<td class="px-3 py-2 text-right"><a href="{{ route('users.show', $user) }}" class="text-sm text-slate-700 hover:underline">Открыть</a></td>
</tr>
@empty
<tr><td colspan="6" class="px-3 py-8 text-center text-slate-500">Нет пользователей</td></tr>
@endforelse
</tbody>
</table>
<div class="p-4">{{ $users->links() }}</div>
</div>
</div>