Files
sam-manage/resources/views/roles/partials/table.blade.php
hskwon 2846d6c034 style: 관리자 패널 UI 개선 및 스크럼 모달 통합
- 테이블 헤더 스타일 통일 (menus, roles, permissions, boards 등)
- 권한 매트릭스 체크박스/버튼 크기 20x20으로 표준화
- 스크럼 항목 추가/수정 모달 통합 (코드 중복 제거)
- daily-logs API URL 경로 수정 (/pm/ 제거)
- 타임존 Asia/Seoul로 변경
- flow-tester 액션 아이콘 크기 조정
2025-12-03 16:47:57 +09:00

87 lines
4.5 KiB
PHP

@php
$tenantId = session('selected_tenant_id');
$isAllTenants = !$tenantId || $tenantId === 'all';
@endphp
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-3 py-2 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider whitespace-nowrap">ID</th>
@if($isAllTenants)
<th class="px-3 py-2 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider whitespace-nowrap">테넌트</th>
@endif
<th class="px-3 py-2 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider whitespace-nowrap">역할 이름</th>
<th class="px-3 py-2 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider whitespace-nowrap">Guard</th>
<th class="px-3 py-2 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider whitespace-nowrap">설명</th>
<th class="px-3 py-2 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider whitespace-nowrap">권한 </th>
<th class="px-3 py-2 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider whitespace-nowrap">생성일</th>
<th class="px-3 py-2 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider whitespace-nowrap">액션</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@forelse($roles as $role)
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
{{ $role->id }}
</td>
@if($isAllTenants)
<td class="px-6 py-4 whitespace-nowrap">
@if($role->tenant)
<span class="px-2 py-1 text-xs font-medium bg-gray-100 text-gray-600 rounded cursor-pointer hover:bg-gray-200"
data-context-menu="tenant"
data-entity-id="{{ $role->tenant->id }}"
data-entity-name="{{ $role->tenant->company_name }}"
title="우클릭하여 메뉴 열기">
{{ $role->tenant->company_name }}
</span>
@else
<span class="px-2 py-1 text-xs font-medium bg-gray-100 text-gray-400 rounded">미지정</span>
@endif
</td>
@endif
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm font-medium text-gray-900">{{ $role->name }}</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-center">
<span class="px-2 py-1 text-xs font-medium rounded {{ $role->guard_name === 'api' ? 'bg-blue-100 text-blue-700' : 'bg-green-100 text-green-700' }}">
{{ strtoupper($role->guard_name ?? '-') }}
</span>
</td>
<td class="px-6 py-4">
<div class="text-sm text-gray-500">{{ $role->description ?? '-' }}</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-center text-gray-900">
{{ $role->permissions_count ?? 0 }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{{ $role->created_at?->format('Y-m-d') ?? '-' }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<a href="{{ route('roles.edit', $role->id) }}"
class="text-blue-600 hover:text-blue-900 mr-3">
수정
</a>
<button onclick="confirmDelete({{ $role->id }}, '{{ $role->name }}')"
class="text-red-600 hover:text-red-900">
삭제
</button>
</td>
</tr>
@empty
<tr>
<td colspan="{{ $isAllTenants ? 8 : 7 }}" class="px-6 py-12 text-center text-gray-500">
등록된 역할이 없습니다.
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<!-- 페이지네이션 -->
@include('partials.pagination', [
'paginator' => $roles,
'target' => '#role-table',
'includeForm' => '#filterForm'
])