feat: 좌측 사이드바 레이아웃 및 메뉴 시스템 구현
- layouts/app.blade.php 마스터 레이아웃 생성
- partials/sidebar.blade.php 좌측 사이드바 컴포넌트 (256px, 10개 메뉴)
- partials/header.blade.php 상단 헤더 컴포넌트 (64px, 페이지 타이틀 + 사용자 메뉴)
- dashboard/index.blade.php @extends 패턴으로 리팩토링
메뉴 구조:
- 조직 관리: 대시보드, 사용자, 권한/역할, 부서
- 제품/자재: 제품, 자재, BOM, 카테고리
- 시스템: 시스템 설정, 감사 로그
레이아웃:
- Flexbox 구조 (사이드바 + 메인 영역)
- Blade 컴포넌트 분리 (@extends/@section/@include)
- Heroicons 아이콘, 활성 상태 하이라이트
- 사용자 드롭다운 메뉴 (JavaScript 토글)
2025-11-20 21:28:58 +09:00
|
|
|
<!-- Header -->
|
|
|
|
|
<header class="bg-white shadow-sm h-16 flex items-center justify-between px-6 border-b border-gray-200">
|
2025-11-25 15:21:48 +09:00
|
|
|
<!-- Tenant Selector (좌측) -->
|
|
|
|
|
<div class="flex items-center gap-4">
|
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
|
<svg class="w-5 h-5 text-gray-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />
|
|
|
|
|
</svg>
|
|
|
|
|
<label for="tenant-select" class="text-sm font-medium text-gray-700">테넌트 선택:</label>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<form action="{{ route('tenant.switch') }}" method="POST" id="tenant-switch-form">
|
|
|
|
|
@csrf
|
|
|
|
|
<select
|
|
|
|
|
name="tenant_id"
|
|
|
|
|
id="tenant-select"
|
|
|
|
|
onchange="document.getElementById('tenant-switch-form').submit()"
|
|
|
|
|
class="border-gray-300 rounded-lg text-sm focus:ring-primary focus:border-primary min-w-[200px]"
|
|
|
|
|
>
|
|
|
|
|
<option value="all" {{ session('selected_tenant_id') === null ? 'selected' : '' }}>
|
|
|
|
|
전체 보기
|
|
|
|
|
</option>
|
|
|
|
|
@if($globalTenants->isNotEmpty())
|
|
|
|
|
<option disabled>─────────</option>
|
|
|
|
|
@endif
|
|
|
|
|
@foreach($globalTenants as $tenant)
|
|
|
|
|
<option value="{{ $tenant->id }}" {{ session('selected_tenant_id') == $tenant->id ? 'selected' : '' }}>
|
|
|
|
|
{{ $tenant->company_name }}
|
|
|
|
|
</option>
|
|
|
|
|
@endforeach
|
|
|
|
|
</select>
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
<!-- 현재 테넌트 정보 -->
|
|
|
|
|
@if(session('selected_tenant_id'))
|
|
|
|
|
@php
|
|
|
|
|
$currentTenant = $globalTenants->firstWhere('id', session('selected_tenant_id'));
|
|
|
|
|
@endphp
|
|
|
|
|
@if($currentTenant)
|
|
|
|
|
<span class="inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-primary/10 text-primary">
|
|
|
|
|
<svg class="w-4 h-4 mr-1.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
|
|
|
</svg>
|
|
|
|
|
{{ $currentTenant->company_name }}
|
|
|
|
|
</span>
|
|
|
|
|
@endif
|
|
|
|
|
@else
|
|
|
|
|
<span class="text-xs text-gray-500">전체</span>
|
|
|
|
|
@endif
|
feat: 좌측 사이드바 레이아웃 및 메뉴 시스템 구현
- layouts/app.blade.php 마스터 레이아웃 생성
- partials/sidebar.blade.php 좌측 사이드바 컴포넌트 (256px, 10개 메뉴)
- partials/header.blade.php 상단 헤더 컴포넌트 (64px, 페이지 타이틀 + 사용자 메뉴)
- dashboard/index.blade.php @extends 패턴으로 리팩토링
메뉴 구조:
- 조직 관리: 대시보드, 사용자, 권한/역할, 부서
- 제품/자재: 제품, 자재, BOM, 카테고리
- 시스템: 시스템 설정, 감사 로그
레이아웃:
- Flexbox 구조 (사이드바 + 메인 영역)
- Blade 컴포넌트 분리 (@extends/@section/@include)
- Heroicons 아이콘, 활성 상태 하이라이트
- 사용자 드롭다운 메뉴 (JavaScript 토글)
2025-11-20 21:28:58 +09:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Right Side Actions -->
|
|
|
|
|
<div class="flex items-center gap-4">
|
|
|
|
|
<!-- Notifications (추후 추가) -->
|
|
|
|
|
<button class="p-2 text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded-lg">
|
|
|
|
|
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9" />
|
|
|
|
|
</svg>
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
<!-- User Menu Dropdown -->
|
|
|
|
|
<div class="relative">
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onclick="document.getElementById('headerUserMenu').classList.toggle('hidden')"
|
|
|
|
|
class="flex items-center gap-2 px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 rounded-lg focus:outline-none"
|
|
|
|
|
>
|
|
|
|
|
<div class="w-8 h-8 rounded-full bg-primary text-white flex items-center justify-center text-sm font-bold">
|
|
|
|
|
{{ strtoupper(substr(auth()->user()->name ?? 'U', 0, 1)) }}
|
|
|
|
|
</div>
|
|
|
|
|
<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="M19 9l-7 7-7-7" />
|
|
|
|
|
</svg>
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
<!-- Dropdown Menu -->
|
|
|
|
|
<div id="headerUserMenu" class="hidden absolute right-0 mt-2 w-56 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50">
|
|
|
|
|
<!-- User Info -->
|
|
|
|
|
<div class="px-4 py-3 border-b border-gray-200">
|
|
|
|
|
<p class="text-sm font-medium text-gray-900">{{ auth()->user()->name ?? 'User' }}</p>
|
|
|
|
|
<p class="text-xs text-gray-500 truncate">{{ auth()->user()->email }}</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Menu Items -->
|
|
|
|
|
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
|
|
|
프로필 설정
|
|
|
|
|
</a>
|
|
|
|
|
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
|
|
|
|
|
계정 설정
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
<div class="border-t border-gray-200 my-1"></div>
|
|
|
|
|
|
|
|
|
|
<!-- Logout -->
|
|
|
|
|
<form method="POST" action="{{ route('logout') }}">
|
|
|
|
|
@csrf
|
|
|
|
|
<button type="submit" class="block w-full text-left px-4 py-2 text-sm text-red-600 hover:bg-gray-100">
|
|
|
|
|
로그아웃
|
|
|
|
|
</button>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
@push('scripts')
|
|
|
|
|
<script>
|
|
|
|
|
// Close dropdown when clicking outside
|
|
|
|
|
document.addEventListener('click', function(event) {
|
|
|
|
|
const userMenu = document.getElementById('headerUserMenu');
|
|
|
|
|
const button = event.target.closest('button[onclick*="headerUserMenu"]');
|
|
|
|
|
if (!button && !userMenu.contains(event.target)) {
|
|
|
|
|
userMenu.classList.add('hidden');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
@endpush
|