- 테이블 헤더 스타일 통일 (menus, roles, permissions, boards 등) - 권한 매트릭스 체크박스/버튼 크기 20x20으로 표준화 - 스크럼 항목 추가/수정 모달 통합 (코드 중복 제거) - daily-logs API URL 경로 수정 (/pm/ 제거) - 타임존 Asia/Seoul로 변경 - flow-tester 액션 아이콘 크기 조정
94 lines
6.1 KiB
PHP
94 lines
6.1 KiB
PHP
<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">순번</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">URL</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>
|
|
<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">
|
|
@php
|
|
$permissionTypes = ['view', 'create', 'update', 'delete', 'approve', 'export', 'manage'];
|
|
@endphp
|
|
@forelse($menus as $index => $menu)
|
|
<tr class="menu-row"
|
|
data-menu-id="{{ $menu->id }}"
|
|
data-parent-id="{{ $menu->parent_id ?? '' }}"
|
|
data-depth="{{ $menu->depth ?? 0 }}">
|
|
<td class="px-3 py-2 whitespace-nowrap text-sm text-gray-900 text-center">
|
|
{{ $index + 1 }}
|
|
</td>
|
|
<td class="px-3 py-2 whitespace-nowrap">
|
|
<div class="flex items-center gap-1.5" style="padding-left: {{ (($menu->depth ?? 0) * 1.25) }}rem;">
|
|
{{-- 트리 구조 표시 --}}
|
|
@if(($menu->depth ?? 0) > 0)
|
|
<span class="text-gray-300 text-xs font-mono flex-shrink-0">└─</span>
|
|
@endif
|
|
|
|
{{-- 폴더/아이템 아이콘 (폴더는 클릭으로 접기/펼치기) --}}
|
|
@if($menu->has_children)
|
|
<button type="button"
|
|
onclick="toggleChildren({{ $menu->id }})"
|
|
class="toggle-btn flex items-center text-blue-500 hover:text-blue-700 focus:outline-none"
|
|
data-menu-id="{{ $menu->id }}">
|
|
<svg class="w-4 h-4 transform transition-transform flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" />
|
|
</svg>
|
|
<svg class="w-3 h-3 ml-0.5 transform transition-transform chevron-icon" fill="currentColor" viewBox="0 0 20 20">
|
|
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/>
|
|
</svg>
|
|
</button>
|
|
@else
|
|
<svg class="w-4 h-4 text-gray-400 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
|
|
</svg>
|
|
@endif
|
|
|
|
{{-- 메뉴명 --}}
|
|
<span class="text-sm {{ ($menu->depth ?? 0) === 0 ? 'font-semibold text-gray-900' : 'font-medium text-gray-700' }}">
|
|
{{ $menu->name }}
|
|
</span>
|
|
</div>
|
|
</td>
|
|
<td class="px-3 py-2 whitespace-nowrap text-sm text-gray-500">
|
|
<span class="truncate max-w-xs inline-block" title="{{ $menu->url }}">
|
|
{{ $menu->url }}
|
|
</span>
|
|
</td>
|
|
<td class="px-3 py-2 whitespace-nowrap text-sm text-gray-900 text-center">
|
|
{{ $menu->sort_order }}
|
|
</td>
|
|
@foreach($permissionTypes as $type)
|
|
<td class="px-3 py-2 whitespace-nowrap text-center">
|
|
<input
|
|
type="checkbox"
|
|
{{ isset($permissions[$menu->id][$type]) && $permissions[$menu->id][$type] ? 'checked' : '' }}
|
|
class="h-5 w-5 rounded border-gray-300 text-primary focus:ring-primary cursor-pointer"
|
|
hx-post="/api/admin/role-permissions/toggle"
|
|
hx-target="#permission-matrix"
|
|
hx-include="[name='role_id'],[name='guard_name']"
|
|
hx-vals='{"menu_id": {{ $menu->id }}, "permission_type": "{{ $type }}"}'
|
|
>
|
|
</td>
|
|
@endforeach
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="11" class="px-6 py-12 text-center text-gray-500">
|
|
활성화된 메뉴가 없습니다.
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|