Files
document-server/frontend/notebooks.html
Hyungi Ahn f221a5611c 전체 페이지 헤더 여백 통일 및 z-index 충돌 해결
주요 변경사항:
- story-reader.html: pt-4 → pt-20
- pdf-manager.html: py-8 → pt-20 pb-8
- upload.html: py-8 → pt-20 pb-8
- index.html: py-8 → pt-20 pb-8
- search.html: py-8 → pt-20 pb-8
- memo-tree.html: pt-16 → pt-20
- notebooks.html: py-8 → pt-20 pb-8
- notes.html: py-8 → pt-20 pb-8

헤더(h-16, z-50)와의 충돌을 방지하기 위해 모든 페이지의 상단 여백을 pt-20(80px)으로 통일
2025-09-04 10:25:57 +09:00

454 lines
23 KiB
HTML

<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>노트북 관리 - Document Server</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style>
.notebook-card {
transition: all 0.3s ease;
border-left: 4px solid var(--notebook-color);
}
.notebook-card:hover {
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.notebook-icon {
color: var(--notebook-color);
}
.gradient-bg {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.line-clamp-2 {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.line-clamp-3 {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
</style>
</head>
<body class="bg-gray-50 min-h-screen" x-data="notebooksApp()">
<!-- 헤더 -->
<div id="header-container"></div>
<!-- 메인 컨텐츠 -->
<main class="container mx-auto px-4 pt-20 pb-8">
<!-- 페이지 헤더 -->
<div class="mb-8">
<div class="flex items-center justify-between mb-6">
<div>
<h1 class="text-3xl font-bold text-gray-900 flex items-center">
<i class="fas fa-book text-blue-600 mr-3"></i>
노트북 관리
</h1>
<p class="text-gray-600 mt-2">노트들을 체계적으로 분류하고 관리하세요</p>
</div>
<div class="flex space-x-3">
<button onclick="window.location.href='/notes.html'"
class="flex items-center px-4 py-2 bg-gray-600 hover:bg-gray-700 text-white rounded-lg transition-colors">
<i class="fas fa-sticky-note mr-2"></i>
<span>노트 관리</span>
</button>
<button @click="refreshNotebooks()"
:disabled="loading"
class="flex items-center px-4 py-2 bg-gray-500 hover:bg-gray-600 disabled:bg-gray-400 text-white rounded-lg transition-colors">
<i class="fas fa-sync-alt mr-2" :class="{'fa-spin': loading}"></i>
<span>새로고침</span>
</button>
<button @click="showCreateModal = true"
class="flex items-center px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition-colors">
<i class="fas fa-plus mr-2"></i>
<span>새 노트북</span>
</button>
</div>
</div>
</div>
<!-- 통계 카드 -->
<div x-show="stats" class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-8">
<div class="bg-white rounded-lg shadow-sm border p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-blue-100">
<i class="fas fa-book text-blue-600 text-xl"></i>
</div>
<div class="ml-4">
<p class="text-sm font-medium text-gray-600">전체 노트북</p>
<p class="text-2xl font-bold text-gray-900" x-text="stats?.total_notebooks || 0"></p>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow-sm border p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-green-100">
<i class="fas fa-check-circle text-green-600 text-xl"></i>
</div>
<div class="ml-4">
<p class="text-sm font-medium text-gray-600">활성 노트북</p>
<p class="text-2xl font-bold text-gray-900" x-text="stats?.active_notebooks || 0"></p>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow-sm border p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-purple-100">
<i class="fas fa-sticky-note text-purple-600 text-xl"></i>
</div>
<div class="ml-4">
<p class="text-sm font-medium text-gray-600">전체 노트</p>
<p class="text-2xl font-bold text-gray-900" x-text="stats?.total_notes || 0"></p>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow-sm border p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-orange-100">
<i class="fas fa-folder-open text-orange-600 text-xl"></i>
</div>
<div class="ml-4">
<p class="text-sm font-medium text-gray-600">미분류 노트</p>
<p class="text-2xl font-bold text-gray-900" x-text="stats?.notes_without_notebook || 0"></p>
</div>
</div>
</div>
</div>
<!-- 검색 및 필터 -->
<div class="bg-white rounded-lg shadow-sm border p-6 mb-6">
<div class="flex flex-col md:flex-row md:items-center md:justify-between space-y-4 md:space-y-0">
<div class="flex-1 max-w-md">
<div class="relative">
<input type="text"
x-model="searchQuery"
@input="debounceSearch()"
placeholder="노트북 검색..."
class="w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent">
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
</div>
</div>
<div class="flex items-center space-x-4">
<label class="flex items-center">
<input type="checkbox"
x-model="activeOnly"
@change="loadNotebooks()"
class="mr-2 text-blue-600">
<span class="text-sm text-gray-700">활성 노트북만</span>
</label>
<select x-model="sortBy"
@change="loadNotebooks()"
class="px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent">
<option value="updated_at">최근 수정순</option>
<option value="created_at">생성일순</option>
<option value="title">제목순</option>
<option value="sort_order">정렬순</option>
</select>
</div>
</div>
</div>
<!-- 로딩 상태 -->
<div x-show="loading" class="text-center py-12">
<i class="fas fa-spinner fa-spin text-4xl text-gray-400 mb-4"></i>
<p class="text-gray-600">노트북을 불러오는 중...</p>
</div>
<!-- 오류 메시지 -->
<div x-show="error" class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-6">
<div class="flex items-center">
<i class="fas fa-exclamation-triangle mr-2"></i>
<span x-text="error"></span>
</div>
</div>
<!-- 노트북 그리드 -->
<div x-show="!loading && notebooks.length > 0" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<template x-for="notebook in notebooks" :key="notebook.id">
<div class="notebook-card bg-white rounded-lg shadow-sm border p-6 cursor-pointer"
:style="`--notebook-color: ${notebook.color}`"
@click="openNotebook(notebook)">
<!-- 노트북 헤더 -->
<div class="flex items-start justify-between mb-4">
<div class="flex items-center">
<i :class="`fas fa-${notebook.icon} notebook-icon text-2xl mr-3`"></i>
<div>
<h3 class="text-lg font-semibold text-gray-900" x-text="notebook.title"></h3>
<p class="text-sm text-gray-500" x-text="`${notebook.note_count}개 노트`"></p>
</div>
</div>
<div class="flex items-center space-x-2">
<button @click.stop="editNotebook(notebook)"
class="p-2 text-gray-400 hover:text-blue-600 rounded-lg hover:bg-blue-50 transition-colors">
<i class="fas fa-edit"></i>
</button>
<button @click.stop="deleteNotebook(notebook)"
class="p-2 text-gray-400 hover:text-red-600 rounded-lg hover:bg-red-50 transition-colors">
<i class="fas fa-trash"></i>
</button>
</div>
</div>
<!-- 노트북 설명 -->
<div x-show="notebook.description" class="mb-4">
<p class="text-gray-600 text-sm line-clamp-2" x-text="notebook.description"></p>
</div>
<!-- 노트북 메타데이터 -->
<div class="flex items-center justify-between text-xs text-gray-500 mb-2">
<span x-text="formatDate(notebook.updated_at)"></span>
<div class="flex items-center space-x-2">
<span x-show="!notebook.is_active" class="px-2 py-1 bg-gray-100 text-gray-600 rounded-full">
비활성
</span>
<span class="px-2 py-1 rounded-full text-white"
:style="`background-color: ${notebook.color}`"
x-text="notebook.created_by">
</span>
</div>
</div>
<!-- 빠른 액션 -->
<div x-show="notebook.note_count === 0" class="text-center py-2">
<p class="text-xs text-gray-400 mb-2">노트가 없습니다</p>
<button @click.stop="createNoteInNotebook(notebook)"
class="text-xs bg-blue-50 text-blue-600 px-3 py-1 rounded-full hover:bg-blue-100 transition-colors">
<i class="fas fa-plus mr-1"></i>
첫 노트 작성
</button>
</div>
<div x-show="notebook.note_count > 0" class="flex items-center justify-between text-xs">
<span class="text-gray-400">
<i class="fas fa-clock mr-1"></i>
<span x-text="formatDate(notebook.last_note_created_at || notebook.updated_at)"></span>
</span>
<button @click.stop="createNoteInNotebook(notebook)"
class="text-blue-600 hover:text-blue-800 transition-colors">
<i class="fas fa-plus mr-1"></i>
노트 추가
</button>
</div>
</div>
</template>
</div>
<!-- 빈 상태 -->
<div x-show="!loading && notebooks.length === 0" class="text-center py-16">
<i class="fas fa-book text-6xl text-gray-300 mb-4"></i>
<h3 class="text-xl font-semibold text-gray-600 mb-2">노트북이 없습니다</h3>
<p class="text-gray-500 mb-6">첫 번째 노트북을 만들어 노트들을 정리해보세요</p>
<button @click="showCreateModal = true"
class="bg-blue-600 text-white px-6 py-3 rounded-lg hover:bg-blue-700 transition-colors">
<i class="fas fa-plus mr-2"></i>
새 노트북 만들기
</button>
</div>
</main>
<!-- 토스트 알림 -->
<div x-show="notification.show"
x-transition:enter="transition ease-out duration-300"
x-transition:enter-start="opacity-0 transform translate-x-full"
x-transition:enter-end="opacity-100 transform translate-x-0"
x-transition:leave="transition ease-in duration-200"
x-transition:leave-start="opacity-100 transform translate-x-0"
x-transition:leave-end="opacity-0 transform translate-x-full"
class="fixed top-4 right-4 z-50 max-w-sm">
<div class="rounded-lg shadow-lg border p-4"
:class="{
'bg-green-50 border-green-200 text-green-800': notification.type === 'success',
'bg-red-50 border-red-200 text-red-800': notification.type === 'error',
'bg-blue-50 border-blue-200 text-blue-800': notification.type === 'info'
}">
<div class="flex items-center">
<i :class="{
'fas fa-check-circle text-green-600': notification.type === 'success',
'fas fa-exclamation-circle text-red-600': notification.type === 'error',
'fas fa-info-circle text-blue-600': notification.type === 'info'
}" class="mr-2"></i>
<span x-text="notification.message"></span>
<button @click="notification.show = false" class="ml-auto text-gray-400 hover:text-gray-600">
<i class="fas fa-times"></i>
</button>
</div>
</div>
</div>
<!-- 노트북 생성/편집 모달 -->
<div x-show="showCreateModal || showEditModal"
x-transition:enter="transition ease-out duration-300"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
x-transition:leave="transition ease-in duration-200"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4">
<div class="bg-white rounded-lg max-w-md w-full p-6"
x-transition:enter="transition ease-out duration-300"
x-transition:enter-start="opacity-0 transform scale-95"
x-transition:enter-end="opacity-100 transform scale-100"
x-transition:leave="transition ease-in duration-200"
x-transition:leave-start="opacity-100 transform scale-100"
x-transition:leave-end="opacity-0 transform scale-95">
<div class="flex items-center justify-between mb-6">
<h3 class="text-lg font-semibold text-gray-900"
x-text="showEditModal ? '노트북 편집' : '새 노트북 만들기'"></h3>
<button @click="closeModal()" class="text-gray-400 hover:text-gray-600">
<i class="fas fa-times"></i>
</button>
</div>
<form @submit.prevent="saveNotebook()">
<!-- 제목 -->
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-2">제목 *</label>
<input type="text"
x-model="notebookForm.title"
placeholder="노트북 제목을 입력하세요..."
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
required>
</div>
<!-- 설명 -->
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-2">설명</label>
<textarea x-model="notebookForm.description"
rows="3"
placeholder="노트북에 대한 설명을 입력하세요..."
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"></textarea>
</div>
<!-- 색상과 아이콘 -->
<div class="grid grid-cols-2 gap-4 mb-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">색상</label>
<div class="flex flex-wrap gap-2">
<template x-for="color in availableColors" :key="color">
<button type="button"
@click="notebookForm.color = color"
:class="notebookForm.color === color ? 'ring-2 ring-offset-2 ring-gray-400' : ''"
class="w-8 h-8 rounded-full border-2 border-white shadow-sm"
:style="`background-color: ${color}`">
</button>
</template>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">아이콘</label>
<select x-model="notebookForm.icon"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent">
<template x-for="icon in availableIcons" :key="icon.value">
<option :value="icon.value" x-text="icon.label"></option>
</template>
</select>
</div>
</div>
<!-- 버튼 -->
<div class="flex justify-end space-x-3">
<button type="button"
@click="closeModal()"
class="px-4 py-2 text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors">
취소
</button>
<button type="submit"
:disabled="saving || !notebookForm.title"
:class="saving || !notebookForm.title ? 'bg-gray-400 cursor-not-allowed' : 'bg-blue-600 hover:bg-blue-700'"
class="px-4 py-2 text-white rounded-lg transition-colors">
<span x-show="!saving" x-text="showEditModal ? '수정' : '생성'"></span>
<span x-show="saving">저장 중...</span>
</button>
</div>
</form>
</div>
</div>
<!-- 삭제 확인 모달 -->
<div x-show="showDeleteModal"
x-transition:enter="transition ease-out duration-300"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
x-transition:leave="transition ease-in duration-200"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4">
<div class="bg-white rounded-lg max-w-md w-full p-6"
x-transition:enter="transition ease-out duration-300"
x-transition:enter-start="opacity-0 transform scale-95"
x-transition:enter-end="opacity-100 transform scale-100"
x-transition:leave="transition ease-in duration-200"
x-transition:leave-start="opacity-100 transform scale-100"
x-transition:leave-end="opacity-0 transform scale-95">
<div class="flex items-center mb-4">
<div class="p-3 rounded-full bg-red-100 mr-4">
<i class="fas fa-exclamation-triangle text-red-600 text-xl"></i>
</div>
<div>
<h3 class="text-lg font-semibold text-gray-900">노트북 삭제</h3>
<p class="text-sm text-gray-600">이 작업은 되돌릴 수 없습니다.</p>
</div>
</div>
<div class="mb-6">
<p class="text-gray-700 mb-2">
<strong x-text="deletingNotebook?.title"></strong> 노트북을 삭제하시겠습니까?
</p>
<div x-show="deletingNotebook?.note_count > 0" class="bg-yellow-50 border border-yellow-200 rounded-lg p-3">
<div class="flex items-center">
<i class="fas fa-info-circle text-yellow-600 mr-2"></i>
<span class="text-sm text-yellow-800">
포함된 <strong x-text="deletingNotebook?.note_count"></strong>개의 노트는 미분류 상태가 됩니다.
</span>
</div>
</div>
</div>
<div class="flex justify-end space-x-3">
<button type="button"
@click="closeDeleteModal()"
class="px-4 py-2 text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors">
취소
</button>
<button type="button"
@click="confirmDeleteNotebook()"
:disabled="deleting"
:class="deleting ? 'bg-gray-400 cursor-not-allowed' : 'bg-red-600 hover:bg-red-700'"
class="px-4 py-2 text-white rounded-lg transition-colors">
<span x-show="!deleting">삭제</span>
<span x-show="deleting">삭제 중...</span>
</button>
</div>
</div>
</div>
<!-- JavaScript 파일들 -->
<script src="/static/js/header-loader.js?v=2025012603"></script>
<script src="/static/js/api.js?v=2025012607"></script>
<script src="/static/js/auth.js?v=2025012351"></script>
<script src="/static/js/notebooks.js?v=2025012609"></script>
</body>
</html>