Files
TK-FB-Project/web-ui/components/navbar.html
Hyungi Ahn a9bce9d20b fix: 캘린더 모달 중복 카드 문제 및 삭제 권한 개선
- monthly_worker_status 조회 시 GROUP BY로 중복 데이터 합산
- 작업보고서 삭제 권한을 그룹장 이상으로 제한 (admin, system, group_leader)
- 중복 데이터 정리를 위한 마이그레이션 SQL 추가 (009_fix_duplicate_monthly_status.sql)
- synology_deployment 버전에도 동일 수정 적용
2025-12-02 13:08:44 +09:00

368 lines
7.1 KiB
HTML

<!-- components/navbar.html -->
<!-- 프로필 드롭다운이 추가된 개선된 네비게이션바 -->
<nav class="navbar">
<div class="navbar-brand">
<img src="/img/logo.png" alt="로고" class="logo-small">
<div class="brand-content">
<span class="brand-text">테크니컬코리아</span>
<span class="brand-subtitle">생산팀 포털</span>
</div>
</div>
<div class="navbar-center">
<div class="current-time" id="current-time"></div>
</div>
<div class="navbar-menu">
<!-- 프로필 드롭다운 추가 -->
<div class="profile-dropdown">
<div class="user-info" id="user-info-dropdown">
<div class="user-avatar">👤</div>
<div class="user-details">
<span class="user-name" id="user-name">사용자</span>
<span class="user-role" id="user-role">작업자</span>
</div>
<span class="dropdown-arrow"></span>
</div>
<!-- 드롭다운 메뉴 -->
<div class="dropdown-menu" id="profile-dropdown-menu">
<div class="dropdown-header">
<div class="dropdown-user-name" id="dropdown-user-fullname">사용자</div>
<div class="dropdown-user-id" id="dropdown-user-id">@username</div>
</div>
<div class="dropdown-divider"></div>
<a href="/pages/profile/my-profile.html" class="dropdown-item">
<span class="dropdown-icon">👤</span>
내 프로필
</a>
<a href="/pages/profile/change-password.html" class="dropdown-item">
<span class="dropdown-icon">🔐</span>
비밀번호 변경
</a>
<a href="/pages/profile/admin-settings.html" class="dropdown-item admin-only">
<span class="dropdown-icon">⚙️</span>
관리자 설정
</a>
<div class="dropdown-divider"></div>
<button class="dropdown-item logout-item" id="dropdown-logout">
<span class="dropdown-icon">🚪</span>
로그아웃
</button>
</div>
</div>
<div class="navbar-buttons">
<button class="nav-btn dashboard-btn" title="대시보드">
🏠 대시보드
</button>
<button class="nav-btn system-btn" title="시스템 관리자" id="systemBtn" style="display: none;">
🔧 시스템
</button>
</div>
</div>
</nav>
<style>
.navbar {
background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
padding: 12px 24px;
color: white;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
font-family: 'Malgun Gothic', sans-serif;
position: relative;
z-index: 1000;
}
.navbar-brand {
display: flex;
align-items: center;
gap: 12px;
}
.logo-small {
height: 40px;
width: auto;
border-radius: 6px;
}
.brand-content {
display: flex;
flex-direction: column;
}
.brand-text {
font-size: 1.2rem;
font-weight: 700;
line-height: 1.2;
}
.brand-subtitle {
font-size: 0.8rem;
opacity: 0.9;
font-weight: 400;
}
.navbar-center {
display: flex;
align-items: center;
}
.current-time {
font-size: 0.9rem;
font-weight: 500;
padding: 8px 16px;
background: rgba(255,255,255,0.1);
border-radius: 20px;
backdrop-filter: blur(10px);
border: 1px solid rgba(255,255,255,0.2);
}
.navbar-menu {
display: flex;
align-items: center;
gap: 20px;
}
/* 프로필 드롭다운 스타일 */
.profile-dropdown {
position: relative;
}
.user-info {
display: flex;
align-items: center;
gap: 12px;
padding: 8px 16px;
background: rgba(255,255,255,0.1);
border-radius: 25px;
backdrop-filter: blur(10px);
border: 1px solid rgba(255,255,255,0.2);
cursor: pointer;
transition: all 0.3s ease;
}
.user-info:hover {
background: rgba(255,255,255,0.2);
}
.user-info.active {
background: rgba(255,255,255,0.25);
box-shadow: 0 0 0 3px rgba(255,255,255,0.2);
}
.dropdown-arrow {
font-size: 0.7rem;
margin-left: 4px;
transition: transform 0.3s ease;
}
.user-info.active .dropdown-arrow {
transform: rotate(180deg);
}
.user-avatar {
width: 36px;
height: 36px;
background: rgba(255,255,255,0.2);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.2rem;
}
.user-details {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.user-name {
font-weight: 600;
font-size: 0.9rem;
line-height: 1.2;
}
.user-role {
font-size: 0.7rem;
opacity: 0.8;
font-weight: 400;
}
/* 드롭다운 메뉴 */
.dropdown-menu {
position: absolute;
top: calc(100% + 8px);
right: 0;
background: white;
border-radius: 12px;
box-shadow: 0 8px 24px rgba(0,0,0,0.15);
min-width: 240px;
opacity: 0;
visibility: hidden;
transform: translateY(-10px);
transition: all 0.3s ease;
overflow: hidden;
}
.dropdown-menu.show {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
.dropdown-header {
padding: 16px 20px;
background: #f5f5f5;
border-bottom: 1px solid #e0e0e0;
}
.dropdown-user-name {
font-weight: 600;
color: #333;
font-size: 1rem;
margin-bottom: 4px;
}
.dropdown-user-id {
font-size: 0.85rem;
color: #666;
}
.dropdown-divider {
height: 1px;
background: #e0e0e0;
margin: 0;
}
.dropdown-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 20px;
color: #333;
text-decoration: none;
transition: background 0.2s ease;
border: none;
background: none;
width: 100%;
text-align: left;
font-size: 0.9rem;
cursor: pointer;
font-family: inherit;
}
.dropdown-item:hover {
background: #f5f5f5;
}
.dropdown-item:active {
background: #e0e0e0;
}
.dropdown-icon {
font-size: 1.1rem;
width: 24px;
text-align: center;
}
.logout-item {
color: #f44336;
}
.logout-item:hover {
background: #ffebee;
}
/* 기존 버튼 스타일 */
.navbar-buttons {
display: flex;
gap: 12px;
}
.nav-btn {
padding: 8px 16px;
border: none;
border-radius: 20px;
font-size: 0.85rem;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
gap: 6px;
font-family: inherit;
}
.dashboard-btn {
background: rgba(255,255,255,0.15);
color: white;
border: 1px solid rgba(255,255,255,0.3);
}
.dashboard-btn:hover {
background: rgba(255,255,255,0.25);
transform: translateY(-1px);
}
.system-btn {
background: linear-gradient(135deg, #9c27b0 0%, #673ab7 100%);
color: white;
border: 1px solid rgba(255,255,255,0.3);
box-shadow: 0 2px 8px rgba(156,39,176,0.3);
}
.system-btn:hover {
background: linear-gradient(135deg, #8e24aa 0%, #5e35b1 100%);
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(156,39,176,0.4);
}
/* 반응형 */
@media (max-width: 1024px) {
.navbar {
padding: 12px 20px;
}
.navbar-center {
display: none;
}
}
@media (max-width: 768px) {
.navbar {
padding: 12px 16px;
}
.brand-content {
display: none;
}
.navbar-menu {
gap: 12px;
}
.dropdown-menu {
right: -16px;
}
}
@media (max-width: 480px) {
.dashboard-btn, .admin-btn, .system-btn {
display: none;
}
.user-details {
display: none;
}
.dropdown-arrow {
display: none;
}
}
</style>