feature: user list
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
<form action="{{ route('user.update_password') }}" method="POST">
|
||||
@csrf
|
||||
<div class="space-y-6">
|
||||
@if(Auth::user()->first_login == \App\Models\User::FIRST_LOGIN_TRUE)
|
||||
@if(Auth::user()->first_login == config('constants.FIRST_LOGIN_TRUE'))
|
||||
<div class="p-4 bg-amber-50/70 border border-amber-100 text-amber-800 rounded-2xl text-xs font-medium leading-relaxed flex items-start gap-2 shadow-sm">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="w-5 h-5 shrink-0 text-amber-600">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
|
||||
@@ -63,7 +63,7 @@
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-3 pt-4">
|
||||
@if(Auth::user()->first_login != \App\Models\User::FIRST_LOGIN_TRUE)
|
||||
@if(Auth::user()->first_login != config('constants.FIRST_LOGIN_TRUE'))
|
||||
<a href="{{ route('user.dashboard') }}" class="cursor-pointer flex-1 flex items-center justify-center h-[46px] rounded-xl border border-gray-200 bg-white hover:bg-gray-50 text-gray-600 text-[14px] font-bold shadow-sm transition-all duration-200">Hủy bỏ</a>
|
||||
@endif
|
||||
<button type="submit" class="cursor-pointer flex-1 flex items-center justify-center h-[46px] rounded-xl bg-[#3462f7] hover:bg-[#254edb] text-white text-[14px] font-bold shadow-md shadow-blue-500/10 transition-all duration-200">Xác nhận đổi mật khẩu</button>
|
||||
|
||||
@@ -2,17 +2,19 @@
|
||||
@if(count($rankers) > 0)
|
||||
<div class="flex flex-col">
|
||||
@foreach($rankers as $item)
|
||||
@php
|
||||
$deptVal = $item->departments;
|
||||
if (is_numeric($deptVal)) {
|
||||
$idx = ((int)$deptVal) - 1;
|
||||
$teamName = config('constants.DEPARTMENTS')[$idx] ?? 'Team';
|
||||
} else {
|
||||
$teamName = $deptVal ?? 'Team';
|
||||
}
|
||||
@endphp
|
||||
<x-ranking-item
|
||||
rank="{{ $item->rank }}"
|
||||
name="{{ $item->name }}"
|
||||
team="{{ match((int) $item->departments) {
|
||||
1 => 'Dev Team',
|
||||
2 => 'HR Team',
|
||||
3 => 'Sale Team',
|
||||
4 => 'Board Team',
|
||||
5 => 'Marketing Team',
|
||||
default => 'Team'
|
||||
} }}"
|
||||
team="{{ $teamName }}"
|
||||
avatar="{{ $item->avatar ?? 'https://api.dicebear.com/7.x/notionists/svg?seed=' . urlencode($item->name) . '&backgroundColor=bfdbfe' }}"
|
||||
score="{{ $item->score }}"
|
||||
unit="thẻ"
|
||||
@@ -30,17 +32,19 @@
|
||||
@if($currentUserRankItem)
|
||||
<div class="mt-auto">
|
||||
<div class="my-3 border-t border-dashed border-gray-100 mx-2"></div>
|
||||
@php
|
||||
$currDeptVal = $currentUserRankItem->departments;
|
||||
if (is_numeric($currDeptVal)) {
|
||||
$idx = ((int)$currDeptVal) - 1;
|
||||
$currTeamName = config('constants.DEPARTMENTS')[$idx] ?? 'Team';
|
||||
} else {
|
||||
$currTeamName = $currDeptVal ?? 'Team';
|
||||
}
|
||||
@endphp
|
||||
<x-ranking-item
|
||||
rank="{{ $currentUserRankItem->rank > 0 ? $currentUserRankItem->rank : '-' }}"
|
||||
name="{{ $currentUserRankItem->name }}"
|
||||
team="{{ match((int) $currentUserRankItem->departments) {
|
||||
1 => 'Dev Team',
|
||||
2 => 'HR Team',
|
||||
3 => 'Sale Team',
|
||||
4 => 'Board Team',
|
||||
5 => 'Marketing Team',
|
||||
default => 'Team'
|
||||
} }}"
|
||||
team="{{ $currTeamName }}"
|
||||
avatar="{{ $currentUserRankItem->avatar ?? 'https://api.dicebear.com/7.x/notionists/svg?seed=' . urlencode($currentUserRankItem->name) . '&backgroundColor=bfdbfe' }}"
|
||||
score="{{ $currentUserRankItem->score }}"
|
||||
unit="thẻ"
|
||||
|
||||
Reference in New Issue
Block a user