style: [메뉴] 테이블 스타일 개선 및 용어 변경

- 테이블 행 간격 조정 (py-1.5 → py-2)
- "글로벌 메뉴" → "기본 메뉴" 용어 통일
- 구분 칸에 기본 메뉴 태그 표시 유지
This commit is contained in:
2025-12-02 22:06:42 +09:00
parent c5e3965368
commit 7f14359b28
4 changed files with 113 additions and 112 deletions

View File

@@ -1,12 +1,12 @@
@extends('layouts.app')
@section('title', '글로벌 메뉴 관리')
@section('title', '기본 메뉴 관리')
@section('content')
<!-- 페이지 헤더 -->
<div class="flex justify-between items-center mb-6">
<div>
<h1 class="text-2xl font-bold text-gray-800">글로벌 메뉴 관리</h1>
<h1 class="text-2xl font-bold text-gray-800">기본 메뉴 관리</h1>
<p class="text-sm text-gray-500 mt-1">
시스템 전체에서 사용되는 기본 메뉴를 관리합니다. 테넌트는 메뉴를 복사하여 사용합니다.
</p>
@@ -19,7 +19,7 @@
메뉴 관리로 돌아가기
</a>
<a href="{{ route('menus.global.create') }}" class="bg-purple-600 hover:bg-purple-700 text-white px-4 py-2 rounded-lg transition">
+ 글로벌 메뉴
+ 기본 메뉴
</a>
</div>
</div>
@@ -179,7 +179,7 @@ function saveGlobalMenuOrder(items) {
// 삭제 확인
window.confirmDelete = function(id, name) {
if (confirm(`"${name}" 글로벌 메뉴를 삭제하시겠습니까?`)) {
if (confirm(`"${name}" 기본 메뉴를 삭제하시겠습니까?`)) {
htmx.ajax('DELETE', `/api/admin/global-menus/${id}`, {
target: '#menu-table',
swap: 'none',
@@ -194,7 +194,7 @@ function saveGlobalMenuOrder(items) {
// 복원 확인
window.confirmRestore = function(id, name) {
if (confirm(`"${name}" 글로벌 메뉴를 복원하시겠습니까?`)) {
if (confirm(`"${name}" 기본 메뉴를 복원하시겠습니까?`)) {
htmx.ajax('POST', `/api/admin/global-menus/${id}/restore`, {
target: '#menu-table',
swap: 'none',
@@ -209,7 +209,7 @@ function saveGlobalMenuOrder(items) {
// 영구삭제 확인
window.confirmForceDelete = function(id, name) {
if (confirm(`⚠️ 경고: "${name}" 글로벌 메뉴를 영구 삭제하시겠습니까?\n\n이 작업은 되돌릴 수 없습니다!`)) {
if (confirm(`⚠️ 경고: "${name}" 기본 메뉴를 영구 삭제하시겠습니까?\n\n이 작업은 되돌릴 수 없습니다!`)) {
htmx.ajax('DELETE', `/api/admin/global-menus/${id}/force`, {
target: '#menu-table',
swap: 'none',

View File

@@ -23,7 +23,7 @@ class="mode-btn px-4 py-2 text-sm font-medium rounded-md transition bg-white tex
<button onclick="switchMode('import')"
id="importModeBtn"
class="mode-btn px-4 py-2 text-sm font-medium rounded-md transition bg-gray-200 text-gray-500 hover:text-gray-700 hover:bg-gray-300">
글로벌에서 가져오기
기본에서 가져오기
</button>
</div>
<!-- 가져오기 버튼 (import 모드에서만 표시) -->
@@ -45,7 +45,7 @@ class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg transitio
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
글로벌 메뉴 관리
기본 메뉴 관리
</a>
@endif
</div>
@@ -655,7 +655,7 @@ function saveMenuOrder(items) {
// 내 메뉴 버튼 비활성화 스타일
normalBtn.classList.remove('bg-white', 'text-gray-900', 'shadow-sm');
normalBtn.classList.add('bg-gray-200', 'text-gray-500', 'hover:text-gray-700', 'hover:bg-gray-300');
// 글로벌에서 가져오기 버튼 활성화 스타일
// 기본에서 가져오기 버튼 활성화 스타일
importBtn.classList.add('bg-white', 'text-gray-900', 'shadow-sm');
importBtn.classList.remove('bg-gray-200', 'text-gray-500', 'hover:text-gray-700', 'hover:bg-gray-300');
@@ -669,9 +669,9 @@ function saveMenuOrder(items) {
importFilter.classList.remove('hidden');
// 설명 변경
modeDescription.innerHTML = '글로벌 메뉴에서 가져올 항목을 선택하세요. 체크박스로 선택 후 <span class="font-medium text-green-600">선택 가져오기</span> 버튼을 클릭하세요.';
modeDescription.innerHTML = '기본 메뉴에서 가져올 항목을 선택하세요. 체크박스로 선택 후 <span class="font-medium text-green-600">선택 가져오기</span> 버튼을 클릭하세요.';
} else {
// 글로벌에서 가져오기 버튼 비활성화 스타일
// 기본에서 가져오기 버튼 비활성화 스타일
importBtn.classList.remove('bg-white', 'text-gray-900', 'shadow-sm');
importBtn.classList.add('bg-gray-200', 'text-gray-500', 'hover:text-gray-700', 'hover:bg-gray-300');
// 내 메뉴 버튼 활성화 스타일
@@ -744,7 +744,7 @@ function saveMenuOrder(items) {
updateImportButtonState();
};
// 선택된 글로벌 메뉴 가져오기 (가져올 수 있는 것만)
// 선택된 기본 메뉴 가져오기 (가져올 수 있는 것만)
window.importSelectedMenus = function() {
const checkboxes = document.querySelectorAll('#menu-sortable .import-checkbox:checked:not(:disabled)');
const menuIds = Array.from(checkboxes).map(cb => parseInt(cb.value));

View File

@@ -2,14 +2,14 @@
<table class="w-full">
<thead class="bg-purple-50 border-b">
<tr>
<th class="px-2 py-3 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider w-10"></th>
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider w-16">No.</th>
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider">메뉴명</th>
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider">URL</th>
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider w-16">정렬</th>
<th class="px-4 py-3 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider w-16">활성</th>
<th class="px-4 py-3 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider w-16">숨김</th>
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider">작업</th>
<th class="px-2 py-2 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider w-10"></th>
<th class="px-3 py-2 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider w-12">No.</th>
<th class="px-3 py-2 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider">메뉴명</th>
<th class="px-3 py-2 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider">URL</th>
<th class="px-3 py-2 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider w-14">정렬</th>
<th class="px-3 py-2 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider w-14">활성</th>
<th class="px-3 py-2 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider w-14">숨김</th>
<th class="px-3 py-2 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider w-24">작업</th>
</tr>
</thead>
<tbody id="menu-sortable" class="bg-white divide-y divide-gray-200">
@@ -19,20 +19,20 @@
data-parent-id="{{ $menu->parent_id ?? '' }}"
data-sort-order="{{ $menu->sort_order ?? 0 }}"
data-depth="{{ $menu->depth ?? 0 }}">
<td class="px-2 py-4 whitespace-nowrap text-center">
<td class="px-2 py-2 whitespace-nowrap text-center">
@if(!$menu->deleted_at)
<span class="drag-handle cursor-grab active:cursor-grabbing text-gray-400 hover:text-gray-600">
<svg class="w-5 h-5 inline-block" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<svg class="w-4 h-4 inline-block" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 8h16M4 16h16" />
</svg>
</span>
@endif
</td>
<td class="px-4 py-4 whitespace-nowrap text-sm text-gray-900">
<td class="px-3 py-2 whitespace-nowrap text-sm text-gray-900">
{{ $loop->iteration }}
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center gap-2" style="padding-left: {{ (($menu->depth ?? 0) * 1.5) }}rem;">
<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
@@ -55,7 +55,7 @@ class="toggle-btn flex items-center text-purple-500 hover:text-purple-700 focus:
</svg>
@endif
<div class="flex items-center gap-2">
<div class="flex items-center gap-1.5">
<span class="text-sm {{ ($menu->depth ?? 0) === 0 ? 'font-semibold text-gray-900' : 'font-medium text-gray-700' }}">
{{ $menu->name }}
</span>
@@ -65,7 +65,7 @@ class="toggle-btn flex items-center text-purple-500 hover:text-purple-700 focus:
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<td class="px-3 py-2 whitespace-nowrap text-sm text-gray-500">
@if($menu->is_external && $menu->external_url)
<a href="{{ $menu->external_url }}" target="_blank" class="text-purple-600 hover:underline">
{{ Str::limit($menu->external_url, 30) }}
@@ -76,47 +76,51 @@ class="toggle-btn flex items-center text-purple-500 hover:text-purple-700 focus:
-
@endif
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<td class="px-3 py-2 whitespace-nowrap text-sm text-gray-500 text-center">
{{ $menu->sort_order ?? 0 }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-center">
<td class="px-3 py-2 whitespace-nowrap text-center">
@if(!$menu->deleted_at)
<button type="button"
onclick="toggleActive({{ $menu->id }})"
class="relative inline-flex h-4 w-8 items-center rounded-full transition-colors focus:outline-none focus:ring-1 focus:ring-purple-500 focus:ring-offset-1 {{ $menu->is_active ? 'bg-purple-500' : 'bg-gray-400' }}">
<span class="inline-block h-3 w-3 transform rounded-full bg-white shadow-sm transition-transform {{ $menu->is_active ? 'translate-x-4' : 'translate-x-0.5' }}"></span>
class="relative inline-flex h-4 w-7 items-center rounded-full transition-colors focus:outline-none focus:ring-1 focus:ring-purple-500 focus:ring-offset-1 {{ $menu->is_active ? 'bg-purple-500' : 'bg-gray-400' }}">
<span class="inline-block h-3 w-3 transform rounded-full bg-white shadow-sm transition-transform {{ $menu->is_active ? 'translate-x-3.5' : 'translate-x-0.5' }}"></span>
</button>
@else
<span class="text-gray-400">-</span>
@endif
</td>
<td class="px-6 py-4 whitespace-nowrap text-center">
<td class="px-3 py-2 whitespace-nowrap text-center">
@if(!$menu->deleted_at)
<button type="button"
onclick="toggleHidden({{ $menu->id }})"
class="relative inline-flex h-4 w-8 items-center rounded-full transition-colors focus:outline-none focus:ring-1 focus:ring-amber-500 focus:ring-offset-1 {{ $menu->hidden ? 'bg-amber-500' : 'bg-gray-400' }}">
<span class="inline-block h-3 w-3 transform rounded-full bg-white shadow-sm transition-transform {{ $menu->hidden ? 'translate-x-4' : 'translate-x-0.5' }}"></span>
class="relative inline-flex h-4 w-7 items-center rounded-full transition-colors focus:outline-none focus:ring-1 focus:ring-amber-500 focus:ring-offset-1 {{ $menu->hidden ? 'bg-amber-500' : 'bg-gray-400' }}">
<span class="inline-block h-3 w-3 transform rounded-full bg-white shadow-sm transition-transform {{ $menu->hidden ? 'translate-x-3.5' : 'translate-x-0.5' }}"></span>
</button>
@else
<span class="text-gray-400">-</span>
@endif
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<td class="px-3 py-2 whitespace-nowrap text-center">
@if($menu->deleted_at)
<button onclick="confirmRestore({{ $menu->id }}, '{{ $menu->name }}')"
class="text-green-600 hover:text-green-900 mr-3">
복원
</button>
<button onclick="confirmForceDelete({{ $menu->id }}, '{{ $menu->name }}')"
class="text-red-600 hover:text-red-900">
영구삭제
</button>
<div class="flex items-center justify-center gap-1">
<button onclick="confirmRestore({{ $menu->id }}, '{{ $menu->name }}')"
class="inline-flex items-center px-2 py-1 text-xs font-medium rounded bg-green-100 text-green-700 hover:bg-green-200">
복원
</button>
<button onclick="confirmForceDelete({{ $menu->id }}, '{{ $menu->name }}')"
class="inline-flex items-center px-2 py-1 text-xs font-medium rounded bg-red-100 text-red-700 hover:bg-red-200">
영구삭제
</button>
</div>
@else
<div class="flex items-center gap-2">
<a href="{{ route('menus.global.edit', $menu->id) }}" class="text-purple-600 hover:text-purple-900">
<div class="flex items-center justify-center gap-1">
<a href="{{ route('menus.global.edit', $menu->id) }}"
class="inline-flex items-center px-2 py-1 text-xs font-medium rounded bg-purple-100 text-purple-700 hover:bg-purple-200">
수정
</a>
<button onclick="confirmDelete({{ $menu->id }}, '{{ $menu->name }}')" class="text-red-600 hover:text-red-900">
<button onclick="confirmDelete({{ $menu->id }}, '{{ $menu->name }}')"
class="inline-flex items-center px-2 py-1 text-xs font-medium rounded bg-red-100 text-red-700 hover:bg-red-200">
삭제
</button>
</div>
@@ -125,8 +129,8 @@ class="text-red-600 hover:text-red-900">
</tr>
@empty
<tr>
<td colspan="8" class="px-6 py-4 text-center text-gray-500">
글로벌 메뉴가 없습니다.
<td colspan="8" class="px-4 py-3 text-center text-gray-500">
기본 메뉴가 없습니다.
</td>
</tr>
@endforelse

View File

@@ -4,22 +4,23 @@
<tr>
{{-- 체크박스 (가져오기 모드일 때만 표시) --}}
@if($importMode ?? false)
<th class="px-2 py-3 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider w-10">
<th class="px-2 py-2 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider w-10">
<input type="checkbox"
id="selectAllImport"
onchange="toggleSelectAllImport(this)"
class="w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-green-500">
</th>
@else
<th class="px-2 py-3 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider w-10"></th>
<th class="px-2 py-2 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider w-10"></th>
@endif
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider w-16">No.</th>
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider">메뉴명</th>
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider">URL</th>
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider w-16">정렬</th>
<th class="px-4 py-3 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider w-16">활성</th>
<th class="px-4 py-3 text-center text-sm font-semibold text-gray-700 uppercase tracking-wider w-16">숨김</th>
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700 uppercase tracking-wider">작업</th>
<th class="px-3 py-2 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider w-12">No.</th>
<th class="px-3 py-2 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider">메뉴명</th>
<th class="px-3 py-2 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider">URL</th>
<th class="px-3 py-2 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider w-14">정렬</th>
<th class="px-3 py-2 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider w-14">활성</th>
<th class="px-3 py-2 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider w-14">숨김</th>
<th class="px-3 py-2 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider w-16">구분</th>
<th class="px-3 py-2 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider w-24">작업</th>
</tr>
</thead>
<tbody id="menu-sortable" class="bg-white divide-y divide-gray-200">
@@ -31,15 +32,13 @@ class="w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-green-500">
data-depth="{{ $menu->depth ?? 0 }}">
{{-- 체크박스 또는 드래그 핸들 --}}
@if($importMode ?? false)
<td class="px-2 py-4 whitespace-nowrap text-center">
<td class="px-2 py-2 whitespace-nowrap text-center">
@if($menu->is_imported ?? false)
{{-- 이미 가져온 메뉴: 비활성화 --}}
<input type="checkbox"
value="{{ $menu->id }}"
disabled
class="import-checkbox w-4 h-4 rounded border-gray-300 text-gray-400 cursor-not-allowed">
@else
{{-- 가져올 있는 메뉴 --}}
<input type="checkbox"
value="{{ $menu->id }}"
onchange="updateImportButtonState()"
@@ -47,27 +46,25 @@ class="import-checkbox w-4 h-4 rounded border-gray-300 text-green-600 focus:ring
@endif
</td>
@else
<td class="px-2 py-4 whitespace-nowrap text-center">
<td class="px-2 py-2 whitespace-nowrap text-center">
@if(!$menu->deleted_at)
<span class="drag-handle cursor-grab active:cursor-grabbing text-gray-400 hover:text-gray-600">
<svg class="w-5 h-5 inline-block" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<svg class="w-4 h-4 inline-block" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 8h16M4 16h16" />
</svg>
</span>
@endif
</td>
@endif
<td class="px-4 py-4 whitespace-nowrap text-sm text-gray-900">
<td class="px-3 py-2 whitespace-nowrap text-sm text-gray-900">
{{ $loop->iteration }}
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center gap-2" style="padding-left: {{ (($menu->depth ?? 0) * 1.5) }}rem;">
{{-- 트리 구조 표시 --}}
<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 }})"
@@ -86,8 +83,7 @@ class="toggle-btn flex items-center text-blue-500 hover:text-blue-700 focus:outl
</svg>
@endif
{{-- 메뉴 정보 --}}
<div class="flex items-center gap-2">
<div class="flex items-center gap-1.5">
<span class="text-sm {{ ($menu->depth ?? 0) === 0 ? 'font-semibold text-gray-900' : 'font-medium text-gray-700' }}">
{{ $menu->name }}
</span>
@@ -97,7 +93,7 @@ class="toggle-btn flex items-center text-blue-500 hover:text-blue-700 focus:outl
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<td class="px-3 py-2 whitespace-nowrap text-sm text-gray-500">
@if($menu->is_external && $menu->external_url)
<a href="{{ $menu->external_url }}" target="_blank" class="text-blue-600 hover:underline">
{{ Str::limit($menu->external_url, 30) }}
@@ -108,81 +104,82 @@ class="toggle-btn flex items-center text-blue-500 hover:text-blue-700 focus:outl
-
@endif
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<td class="px-3 py-2 whitespace-nowrap text-sm text-gray-500 text-center">
{{ $menu->sort_order ?? 0 }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-center">
<td class="px-3 py-2 whitespace-nowrap text-center">
@if($importMode ?? false)
{{-- 가져오기 모드: 읽기 전용 상태 표시 --}}
@if($menu->is_active)
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-blue-100 text-blue-700">활성</span>
<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-blue-100 text-blue-700">활성</span>
@else
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-500">비활성</span>
<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-500">비활성</span>
@endif
@elseif(!$menu->deleted_at)
<button type="button"
onclick="toggleActive({{ $menu->id }})"
class="relative inline-flex h-4 w-8 items-center rounded-full transition-colors focus:outline-none focus:ring-1 focus:ring-blue-500 focus:ring-offset-1 {{ $menu->is_active ? 'bg-blue-500' : 'bg-gray-400' }}">
<span class="inline-block h-3 w-3 transform rounded-full bg-white shadow-sm transition-transform {{ $menu->is_active ? 'translate-x-4' : 'translate-x-0.5' }}"></span>
class="relative inline-flex h-4 w-7 items-center rounded-full transition-colors focus:outline-none focus:ring-1 focus:ring-blue-500 focus:ring-offset-1 {{ $menu->is_active ? 'bg-blue-500' : 'bg-gray-400' }}">
<span class="inline-block h-3 w-3 transform rounded-full bg-white shadow-sm transition-transform {{ $menu->is_active ? 'translate-x-3.5' : 'translate-x-0.5' }}"></span>
</button>
@else
<span class="text-gray-400">-</span>
@endif
</td>
<td class="px-6 py-4 whitespace-nowrap text-center">
<td class="px-3 py-2 whitespace-nowrap text-center">
@if($importMode ?? false)
{{-- 가져오기 모드: 읽기 전용 상태 표시 --}}
@if($menu->hidden)
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-amber-100 text-amber-700">숨김</span>
<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-amber-100 text-amber-700">숨김</span>
@else
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-500">표시</span>
<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-500">표시</span>
@endif
@elseif(!$menu->deleted_at)
<button type="button"
onclick="toggleHidden({{ $menu->id }})"
class="relative inline-flex h-4 w-8 items-center rounded-full transition-colors focus:outline-none focus:ring-1 focus:ring-amber-500 focus:ring-offset-1 {{ $menu->hidden ? 'bg-amber-500' : 'bg-gray-400' }}">
<span class="inline-block h-3 w-3 transform rounded-full bg-white shadow-sm transition-transform {{ $menu->hidden ? 'translate-x-4' : 'translate-x-0.5' }}"></span>
class="relative inline-flex h-4 w-7 items-center rounded-full transition-colors focus:outline-none focus:ring-1 focus:ring-amber-500 focus:ring-offset-1 {{ $menu->hidden ? 'bg-amber-500' : 'bg-gray-400' }}">
<span class="inline-block h-3 w-3 transform rounded-full bg-white shadow-sm transition-transform {{ $menu->hidden ? 'translate-x-3.5' : 'translate-x-0.5' }}"></span>
</button>
@else
<span class="text-gray-400">-</span>
@endif
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
{{-- 구분 --}}
<td class="px-3 py-2 whitespace-nowrap text-center">
@if($importMode ?? false)
<!-- 가져오기 모드: 가져온 메뉴 vs 가져올 있는 메뉴 구분 -->
@if($menu->is_imported ?? false)
<span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-200 text-gray-500">
가져옴
</span>
<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-gray-200 text-gray-500">가져옴</span>
@else
<span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-700">
가져오기 가능
</span>
@endif
@elseif($menu->deleted_at)
<!-- 삭제된 항목 - 복원은 일반관리자도 가능, 영구삭제는 슈퍼관리자만 -->
<button onclick="confirmRestore({{ $menu->id }}, '{{ $menu->name }}')"
class="text-green-600 hover:text-green-900 mr-3">
복원
</button>
@if(auth()->user()?->is_super_admin)
<button onclick="confirmForceDelete({{ $menu->id }}, '{{ $menu->name }}')"
class="text-red-600 hover:text-red-900">
영구삭제
</button>
<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-green-100 text-green-700">가능</span>
@endif
@elseif($menu->global_menu_id)
<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-purple-100 text-purple-700">기본</span>
@else
<!-- 활성 항목 -->
<div class="flex items-center gap-2">
@if($menu->global_menu_id)
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-purple-100 text-purple-700">
글로벌
</span>
<span class="text-gray-300">-</span>
@endif
</td>
{{-- 작업 --}}
<td class="px-3 py-2 whitespace-nowrap text-center">
@if($importMode ?? false)
{{-- 가져오기 모드: 작업 없음 --}}
@elseif($menu->deleted_at)
<div class="flex items-center justify-center gap-1">
<button onclick="confirmRestore({{ $menu->id }}, '{{ $menu->name }}')"
class="inline-flex items-center px-2 py-1 text-xs font-medium rounded bg-green-100 text-green-700 hover:bg-green-200">
복원
</button>
@if(auth()->user()?->is_super_admin)
<button onclick="confirmForceDelete({{ $menu->id }}, '{{ $menu->name }}')"
class="inline-flex items-center px-2 py-1 text-xs font-medium rounded bg-red-100 text-red-700 hover:bg-red-200">
영구삭제
</button>
@endif
<a href="{{ route('menus.edit', $menu->id) }}" class="text-blue-600 hover:text-blue-900">
</div>
@else
<div class="flex items-center justify-center gap-1">
<a href="{{ route('menus.edit', $menu->id) }}"
class="inline-flex items-center px-2 py-1 text-xs font-medium rounded bg-blue-100 text-blue-700 hover:bg-blue-200">
수정
</a>
<button onclick="confirmDelete({{ $menu->id }}, '{{ $menu->name }}')" class="text-red-600 hover:text-red-900">
<button onclick="confirmDelete({{ $menu->id }}, '{{ $menu->name }}')"
class="inline-flex items-center px-2 py-1 text-xs font-medium rounded bg-red-100 text-red-700 hover:bg-red-200">
삭제
</button>
</div>
@@ -191,7 +188,7 @@ class="text-red-600 hover:text-red-900">
</tr>
@empty
<tr>
<td colspan="8" class="px-6 py-4 text-center text-gray-500">
<td colspan="9" class="px-4 py-3 text-center text-gray-500">
메뉴가 없습니다.
</td>
</tr>