feature: user list
This commit is contained in:
@@ -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