Files
Document-AI-server/templates/library_organized.html

374 lines
13 KiB
HTML

<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>문서 라이브러리 - AI 번역 시스템</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 1400px;
margin: 0 auto;
background: white;
border-radius: 20px;
box-shadow: 0 20px 40px rgba(0,0,0,0.1);
overflow: hidden;
}
.header {
background: linear-gradient(135deg, #2563eb, #3b82f6);
color: white;
padding: 40px;
text-align: center;
}
.header h1 { font-size: 2.5rem; margin-bottom: 10px; }
.header p { font-size: 1.1rem; opacity: 0.9; }
.nav-menu {
background: #f8fafc;
padding: 20px 40px;
border-bottom: 1px solid #e5e7eb;
display: flex;
justify-content: space-between;
align-items: center;
}
.nav-links { display: flex; gap: 30px; }
.nav-link {
color: #374151;
text-decoration: none;
font-weight: 500;
transition: color 0.3s ease;
}
.nav-link:hover { color: #2563eb; }
.nav-link.active {
color: #2563eb;
border-bottom: 2px solid #2563eb;
padding-bottom: 5px;
}
.stats-bar {
background: #f0f9ff;
padding: 15px 40px;
border-bottom: 1px solid #bae6fd;
display: flex;
gap: 30px;
font-size: 0.9rem;
color: #0369a1;
}
.stat-item { display: flex; align-items: center; gap: 8px; }
.main-content { padding: 40px; }
.search-section {
margin-bottom: 30px;
display: flex;
gap: 15px;
align-items: center;
}
.search-box {
flex: 1;
padding: 15px;
border: 2px solid #e5e7eb;
border-radius: 12px;
font-size: 1rem;
}
.filter-select {
padding: 15px;
border: 2px solid #e5e7eb;
border-radius: 12px;
background: white;
min-width: 200px;
}
.category-section {
margin-bottom: 40px;
background: #f8fafc;
border-radius: 16px;
overflow: hidden;
}
.category-header {
background: linear-gradient(135deg, #1e40af, #2563eb);
color: white;
padding: 20px 30px;
display: flex;
justify-content: space-between;
align-items: center;
}
.category-title { font-size: 1.3rem; font-weight: 600; }
.category-count {
background: rgba(255,255,255,0.2);
padding: 5px 12px;
border-radius: 20px;
font-size: 0.9rem;
}
.documents-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
gap: 20px;
padding: 30px;
}
.document-card {
background: white;
border: 1px solid #e5e7eb;
border-radius: 12px;
padding: 24px;
transition: all 0.3s ease;
cursor: pointer;
}
.document-card:hover {
transform: translateY(-4px);
box-shadow: 0 12px 24px rgba(0,0,0,0.1);
border-color: #2563eb;
}
.document-title {
font-size: 1.1rem;
font-weight: 600;
color: #1f2937;
margin-bottom: 12px;
line-height: 1.4;
}
.document-meta {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
margin-bottom: 16px;
font-size: 0.85rem;
color: #6b7280;
}
.meta-item {
display: flex;
align-items: center;
gap: 6px;
}
.language-badge {
display: inline-block;
padding: 4px 8px;
background: #eff6ff;
color: #1d4ed8;
border-radius: 6px;
font-size: 0.75rem;
font-weight: 500;
margin-bottom: 12px;
}
.document-actions {
display: flex;
gap: 10px;
}
.btn {
padding: 10px 16px;
border-radius: 8px;
text-decoration: none;
font-weight: 500;
font-size: 0.875rem;
transition: all 0.3s ease;
border: none;
cursor: pointer;
flex: 1;
text-align: center;
}
.btn-primary {
background: #2563eb;
color: white;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary {
background: #f8fafc;
color: #374151;
border: 1px solid #e5e7eb;
}
.btn-secondary:hover { background: #f1f5f9; }
.empty-state {
text-align: center;
padding: 80px 20px;
color: #6b7280;
}
.empty-icon { font-size: 4rem; margin-bottom: 20px; }
.empty-title {
font-size: 1.5rem;
font-weight: 600;
margin-bottom: 10px;
color: #374151;
}
@media (max-width: 768px) {
.documents-grid { grid-template-columns: 1fr; }
.nav-menu { flex-direction: column; gap: 20px; }
.stats-bar { flex-wrap: wrap; }
.search-section { flex-direction: column; }
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>📚 문서 라이브러리</h1>
<p>체계적으로 분류된 다국어 번역 문서</p>
</div>
<div class="nav-menu">
<div class="nav-links">
<a href="/" class="nav-link">📤 업로드</a>
<a href="/library" class="nav-link active">📚 라이브러리</a>
<a href="/system-status" class="nav-link">📊 시스템</a>
</div>
</div>
<div class="stats-bar">
<div class="stat-item">
<span>📄</span>
<span>총 {{ total_documents }}개 문서</span>
</div>
<div class="stat-item">
<span>🗂️</span>
<span>{{ categories|length }}개 카테고리</span>
</div>
<div class="stat-item">
<span>🌍</span>
<span>다국어 지원</span>
</div>
</div>
<div class="main-content">
<div class="search-section">
<input type="text" class="search-box" placeholder="🔍 문서 제목으로 검색..." id="searchInput">
<select class="filter-select" id="categoryFilter">
<option value="">모든 카테고리</option>
{% for category_name in categories.keys() %}
<option value="{{ category_name }}">{{ category_name|replace("_", " ")|title }}</option>
{% endfor %}
</select>
</div>
{% if categories %}
{% for category_name, documents in categories.items() %}
<div class="category-section" data-category="{{ category_name }}">
<div class="category-header">
<div class="category-title">
{% if category_name == "English To Korean" %}
🇺🇸→🇰🇷 English to Korean
{% elif category_name == "Japanese To Korean" %}
🇯🇵→🇰🇷 Japanese to Korean
{% elif category_name == "Korean Only" %}
🇰🇷 Korean Documents
{% else %}
{{ category_name }}
{% endif %}
</div>
<div class="category-count">{{ documents|length }}개</div>
</div>
<div class="documents-grid">
{% for doc in documents %}
<div class="document-card" data-title="{{ doc.name.lower() }}" data-category="{{ category_name }}">
<div class="language-badge">{{ doc.language_display }}</div>
<div class="document-title">{{ doc.name }}</div>
<div class="document-meta">
<div class="meta-item">
<span>📅</span>
<span>{{ doc.created }}</span>
</div>
<div class="meta-item">
<span>📊</span>
<span>{{ doc.size }}</span>
</div>
<div class="meta-item">
<span>📁</span>
<span>{{ doc.month }}</span>
</div>
<div class="meta-item">
<span>🌐</span>
<span>{{ doc.language_type.replace("-", " ")|title }}</span>
</div>
</div>
<div class="document-actions">
<a href="{{ doc.url }}" class="btn btn-primary" target="_blank">👁️ 보기</a>
<a href="{{ doc.url }}" class="btn btn-secondary" download="{{ doc.filename }}">📥 다운로드</a>
</div>
</div>
{% endfor %}
</div>
</div>
{% endfor %}
{% else %}
<div class="empty-state">
<div class="empty-icon">📚</div>
<div class="empty-title">아직 변환된 문서가 없습니다</div>
<div class="empty-text">PDF나 텍스트 파일을 업로드하여 다국어 문서를 만들어보세요!</div>
<a href="/" class="btn btn-primary">📤 첫 번째 문서 업로드</a>
</div>
{% endif %}
</div>
</div>
<script>
// 검색 및 필터링
const searchInput = document.getElementById('searchInput');
const categoryFilter = document.getElementById('categoryFilter');
function filterDocuments() {
const query = searchInput.value.toLowerCase();
const selectedCategory = categoryFilter.value;
// 모든 카테고리 섹션 처리
document.querySelectorAll('.category-section').forEach(section => {
const categoryName = section.dataset.category;
let hasVisibleCards = false;
// 카테고리 필터 확인
if (selectedCategory && categoryName !== selectedCategory) {
section.style.display = 'none';
return;
}
// 카드 필터링
section.querySelectorAll('.document-card').forEach(card => {
const title = card.dataset.title;
const matchesSearch = !query || title.includes(query);
if (matchesSearch) {
card.style.display = 'block';
hasVisibleCards = true;
} else {
card.style.display = 'none';
}
});
// 카테고리 섹션 표시/숨김
section.style.display = hasVisibleCards ? 'block' : 'none';
});
}
searchInput.addEventListener('input', filterDocuments);
categoryFilter.addEventListener('change', filterDocuments);
</script>
</body>
</html>