Files
sam-manage/resources/views/tenants/partials/modal-users.blade.php
hskwon b32f6cfcf0 feat: 테넌트 정보 모달 팝업 기능 추가
- 테넌트 row 클릭 시 모달 팝업 표시
- 컨텍스트 메뉴 (우클릭) 지원
- 탭 구조: 구독정보, 사용자, 부서, 역할, 메뉴
- 메뉴 탭 트리 구조 접기/펼치기 기능
- 삭제된 테넌트 경고 배너 (삭제일, 삭제자 표시)
- 복원 버튼으로 즉시 복원 및 모달 새로고침
- 액션 버튼 (수정/삭제) 클릭 시 모달 미표시
2025-11-27 19:11:32 +09:00

86 lines
5.0 KiB
PHP

{{-- 테넌트 모달 - 사용자 --}}
<div class="space-y-4">
{{-- 헤더 --}}
<div class="flex items-center justify-between">
<h3 class="text-sm font-medium text-gray-700">소속 사용자 목록</h3>
<span class="text-xs text-gray-500"> {{ $users->count() }}</span>
</div>
@if($users->count() > 0)
{{-- 사용자 테이블 --}}
<div class="overflow-hidden border border-gray-200 rounded-lg">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">이름</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">이메일</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">부서</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">역할</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">상태</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">가입일</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@foreach($users as $user)
<tr class="hover:bg-gray-50">
<td class="px-4 py-2 whitespace-nowrap">
<span class="text-sm font-medium text-gray-900 cursor-pointer hover:text-blue-600"
data-context-menu="user"
data-entity-id="{{ $user->id }}"
data-entity-name="{{ $user->name }}">
{{ $user->name }}
</span>
</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">
{{ $user->email }}
</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">
{{ $user->department?->name ?? '-' }}
</td>
<td class="px-4 py-2 whitespace-nowrap">
@if($user->roles && $user->roles->count() > 0)
<div class="flex flex-wrap gap-1">
@foreach($user->roles->take(2) as $role)
<span class="px-1.5 py-0.5 text-xs bg-blue-100 text-blue-800 rounded">
{{ $role->name }}
</span>
@endforeach
@if($user->roles->count() > 2)
<span class="px-1.5 py-0.5 text-xs bg-gray-100 text-gray-600 rounded">
+{{ $user->roles->count() - 2 }}
</span>
@endif
</div>
@else
<span class="text-xs text-gray-400">-</span>
@endif
</td>
<td class="px-4 py-2 whitespace-nowrap">
@if($user->is_active)
<span class="px-2 py-0.5 text-xs font-semibold rounded-full bg-green-100 text-green-800">
활성
</span>
@else
<span class="px-2 py-0.5 text-xs font-semibold rounded-full bg-gray-100 text-gray-800">
비활성
</span>
@endif
</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">
{{ $user->created_at?->format('Y-m-d') ?? '-' }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@else
{{-- 상태 --}}
<div class="text-center py-8 text-gray-500">
<svg class="w-12 h-12 mx-auto mb-4 text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z" />
</svg>
<p>등록된 사용자가 없습니다.</p>
</div>
@endif
</div>