✨ 노트북 관리 UI 완성
🎯 주요 개선사항: - 노트북 목록 조회/표시 기능 완성 - 노트북 생성/편집/삭제 모달 구현 - 토스트 알림 시스템 추가 (alert 대신) - 노트북 통계 대시보드 표시 - 노트북별 노트 관리 및 빠른 노트 생성 기능 - URL 파라미터를 통한 노트북 자동 설정 🔧 기술적 개선: - CSS line-clamp 클래스 추가 - 필드명 불일치 수정 (notebook.name → notebook.title) - 삭제 확인 모달로 UX 개선 - 노트 에디터에서 노트북 자동 설정 지원 📱 UI/UX 개선: - 노트북 카드 호버 효과 및 색상 테마 - 빈 노트북 상태 처리 및 안내 - 반응형 그리드 레이아웃 - 로딩 상태 및 에러 처리 개선
This commit is contained in:
@@ -23,6 +23,18 @@
|
||||
.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()">
|
||||
@@ -200,7 +212,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 노트북 메타데이터 -->
|
||||
<div class="flex items-center justify-between text-xs text-gray-500">
|
||||
<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">
|
||||
@@ -212,6 +224,28 @@
|
||||
</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>
|
||||
@@ -229,6 +263,35 @@
|
||||
</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"
|
||||
@@ -321,6 +384,66 @@
|
||||
</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>
|
||||
|
||||
Reference in New Issue
Block a user