589 lines
20 KiB
HTML
589 lines
20 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>家庭日报系统</title>
|
|
<!-- Bootstrap 5 CSS -->
|
|
<link href="https://testingcf.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<!-- Bootstrap Icons -->
|
|
<link href="https://testingcf.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css" rel="stylesheet">
|
|
<!-- Chart.js -->
|
|
<script src="https://testingcf.jsdelivr.net/npm/chart.js"></script>
|
|
<style>
|
|
:root {
|
|
--primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
--secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
|
|
--success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
|
--warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
|
|
--info-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
|
|
--dark-gradient: linear-gradient(135deg, #2c3e50 0%, #4ca1af 100%);
|
|
}
|
|
|
|
body {
|
|
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
|
min-height: 100vh;
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
}
|
|
|
|
/* 导航栏样式 */
|
|
.navbar {
|
|
background: var(--dark-gradient) !important;
|
|
box-shadow: 0 2px 20px rgba(0,0,0,0.1);
|
|
padding: 0.5rem 0;
|
|
}
|
|
|
|
.navbar-brand {
|
|
font-weight: 700;
|
|
font-size: 1.2rem;
|
|
color: #fff !important;
|
|
text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.navbar-nav {
|
|
flex-wrap: nowrap;
|
|
}
|
|
|
|
.navbar-nav .nav-item {
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.navbar-nav .nav-link {
|
|
color: rgba(255,255,255,0.9) !important;
|
|
font-weight: 500;
|
|
padding: 0.4rem 0.6rem !important;
|
|
border-radius: 6px;
|
|
transition: all 0.3s ease;
|
|
margin: 0 0.1rem;
|
|
font-size: 0.9rem;
|
|
white-space: nowrap;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.3rem;
|
|
}
|
|
|
|
.navbar-nav .nav-link:hover {
|
|
background: rgba(255,255,255,0.15);
|
|
color: #fff !important;
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.navbar-nav .nav-link.active {
|
|
background: rgba(255,255,255,0.25);
|
|
color: #fff !important;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.navbar-nav .nav-link i {
|
|
font-size: 1rem;
|
|
}
|
|
|
|
.navbar-collapse {
|
|
flex-wrap: nowrap;
|
|
}
|
|
|
|
.container {
|
|
max-width: 1400px;
|
|
}
|
|
|
|
/* 卡片样式 */
|
|
.card {
|
|
border: none;
|
|
border-radius: 16px;
|
|
box-shadow: 0 4px 20px rgba(0,0,0,0.08);
|
|
transition: all 0.3s ease;
|
|
background: rgba(255,255,255,0.95);
|
|
backdrop-filter: blur(10px);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.card:hover {
|
|
transform: translateY(-3px);
|
|
box-shadow: 0 8px 30px rgba(0,0,0,0.12);
|
|
}
|
|
|
|
.card-header {
|
|
border-bottom: none;
|
|
padding: 1.2rem 1.5rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.card-header.bg-primary {
|
|
background: var(--primary-gradient) !important;
|
|
}
|
|
|
|
.card-header.bg-success {
|
|
background: var(--success-gradient) !important;
|
|
}
|
|
|
|
.card-header.bg-warning {
|
|
background: var(--warning-gradient) !important;
|
|
color: #fff !important;
|
|
}
|
|
|
|
.card-header.bg-info {
|
|
background: var(--info-gradient) !important;
|
|
color: #2c3e50 !important;
|
|
}
|
|
|
|
.card-header.bg-secondary {
|
|
background: var(--dark-gradient) !important;
|
|
}
|
|
|
|
.card-header.bg-danger {
|
|
background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%) !important;
|
|
}
|
|
|
|
.card-body {
|
|
padding: 1.5rem;
|
|
}
|
|
|
|
/* 按钮样式 */
|
|
.btn {
|
|
border-radius: 10px;
|
|
font-weight: 500;
|
|
padding: 0.5rem 1.2rem;
|
|
transition: all 0.3s ease;
|
|
border: none;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: var(--primary-gradient);
|
|
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
|
|
}
|
|
|
|
.btn-success {
|
|
background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
|
|
box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
|
|
}
|
|
|
|
.btn-success:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 6px 20px rgba(17, 153, 142, 0.5);
|
|
}
|
|
|
|
.btn-danger {
|
|
background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
|
|
box-shadow: 0 4px 15px rgba(255, 65, 108, 0.4);
|
|
}
|
|
|
|
.btn-warning {
|
|
background: var(--warning-gradient);
|
|
color: #fff;
|
|
box-shadow: 0 4px 15px rgba(250, 112, 154, 0.4);
|
|
}
|
|
|
|
.btn-info {
|
|
background: var(--success-gradient);
|
|
color: #fff;
|
|
box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
|
|
}
|
|
|
|
.btn-secondary {
|
|
background: linear-gradient(135deg, #8e9eab 0%, #eef2f3 100%);
|
|
color: #555;
|
|
box-shadow: 0 4px 15px rgba(142, 158, 171, 0.3);
|
|
}
|
|
|
|
.btn-outline-primary {
|
|
border: 2px solid #667eea;
|
|
color: #667eea;
|
|
background: transparent;
|
|
}
|
|
|
|
.btn-outline-primary:hover {
|
|
background: var(--primary-gradient);
|
|
border-color: transparent;
|
|
}
|
|
|
|
.btn-sm {
|
|
padding: 0.35rem 0.8rem;
|
|
font-size: 0.85rem;
|
|
}
|
|
|
|
/* 表格样式 */
|
|
.table {
|
|
border-radius: 12px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.table thead th {
|
|
background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
|
|
border-bottom: 2px solid #dee2e6;
|
|
font-weight: 600;
|
|
color: #495057;
|
|
padding: 1rem;
|
|
}
|
|
|
|
.table tbody td {
|
|
padding: 1rem;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.table-striped > tbody > tr:nth-of-type(odd) > td {
|
|
background-color: rgba(102, 126, 234, 0.03);
|
|
}
|
|
|
|
.table-hover tbody tr:hover {
|
|
background-color: rgba(102, 126, 234, 0.08);
|
|
}
|
|
|
|
/* 列表组样式 */
|
|
.list-group-item {
|
|
border: none;
|
|
border-radius: 12px !important;
|
|
margin-bottom: 0.5rem;
|
|
background: rgba(255,255,255,0.8);
|
|
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
|
|
transition: all 0.3s ease;
|
|
padding: 1rem 1.2rem;
|
|
}
|
|
|
|
.list-group-item:hover {
|
|
transform: translateX(5px);
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
/* 徽章样式 */
|
|
.badge {
|
|
padding: 0.5em 0.8em;
|
|
border-radius: 20px;
|
|
font-weight: 500;
|
|
font-size: 0.8rem;
|
|
}
|
|
|
|
.bg-success {
|
|
background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
|
|
}
|
|
|
|
.bg-warning {
|
|
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
|
|
}
|
|
|
|
.bg-danger {
|
|
background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%) !important;
|
|
}
|
|
|
|
.bg-info {
|
|
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
|
|
}
|
|
|
|
.bg-secondary {
|
|
background: linear-gradient(135deg, #8e9eab 0%, #eef2f3 100%) !important;
|
|
color: #555 !important;
|
|
}
|
|
|
|
/* 表单样式 */
|
|
.form-control, .form-select {
|
|
border-radius: 10px;
|
|
border: 2px solid #e9ecef;
|
|
padding: 0.6rem 1rem;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.form-control:focus, .form-select:focus {
|
|
border-color: #667eea;
|
|
box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
|
|
}
|
|
|
|
.form-label {
|
|
font-weight: 600;
|
|
color: #495057;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
/* 警告框样式 */
|
|
.alert {
|
|
border: none;
|
|
border-radius: 12px;
|
|
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.alert-success {
|
|
background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
|
|
}
|
|
|
|
.alert-danger {
|
|
background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
|
|
}
|
|
|
|
.alert-warning {
|
|
background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
|
|
}
|
|
|
|
.alert-info {
|
|
background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
|
|
}
|
|
|
|
/* 页脚样式 */
|
|
footer {
|
|
background: var(--dark-gradient) !important;
|
|
color: rgba(255,255,255,0.8) !important;
|
|
margin-top: auto;
|
|
}
|
|
|
|
footer .text-muted {
|
|
color: rgba(255,255,255,0.7) !important;
|
|
}
|
|
|
|
/* 文件链接样式 */
|
|
.file-link {
|
|
font-size: 0.875rem;
|
|
color: #667eea;
|
|
text-decoration: none;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.file-link:hover {
|
|
color: #764ba2;
|
|
text-decoration: underline;
|
|
}
|
|
|
|
/* 状态徽章 */
|
|
.status-badge {
|
|
font-size: 0.75rem;
|
|
padding: 0.4em 0.8em;
|
|
}
|
|
|
|
/* 页面标题 */
|
|
h2 {
|
|
color: #2c3e50;
|
|
font-weight: 700;
|
|
margin-bottom: 1.5rem;
|
|
position: relative;
|
|
padding-bottom: 0.5rem;
|
|
}
|
|
|
|
h2::after {
|
|
content: '';
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 0;
|
|
width: 60px;
|
|
height: 4px;
|
|
background: var(--primary-gradient);
|
|
border-radius: 2px;
|
|
}
|
|
|
|
h5 {
|
|
font-weight: 600;
|
|
color: #34495e;
|
|
}
|
|
|
|
h6 {
|
|
font-weight: 600;
|
|
color: #495057;
|
|
}
|
|
|
|
/* 主要内容区域 */
|
|
main.container {
|
|
padding-top: 2rem;
|
|
padding-bottom: 2rem;
|
|
}
|
|
|
|
/* 快捷操作按钮组 */
|
|
.btn-group-vertical .btn {
|
|
margin-bottom: 0.5rem;
|
|
border-radius: 10px !important;
|
|
}
|
|
|
|
/* 响应式调整 */
|
|
@media (max-width: 768px) {
|
|
.card {
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.navbar-nav .nav-link {
|
|
margin: 0.2rem 0;
|
|
}
|
|
|
|
h2 {
|
|
font-size: 1.5rem;
|
|
}
|
|
}
|
|
|
|
/* 动画效果 */
|
|
@keyframes fadeIn {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateY(20px);
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
}
|
|
|
|
.card {
|
|
animation: fadeIn 0.5s ease-out;
|
|
}
|
|
|
|
/* 图表容器 */
|
|
.chart-container {
|
|
position: relative;
|
|
height: 250px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="d-flex flex-column">
|
|
<!-- 导航栏 -->
|
|
<nav class="navbar navbar-expand-lg navbar-dark">
|
|
<div class="container">
|
|
<a class="navbar-brand" href="{% url 'index' %}">
|
|
<i class="bi bi-house-heart-fill me-2"></i>家庭日报系统
|
|
</a>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarNav">
|
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if request.resolver_match.url_name == 'index' %}active{% endif %}" href="{% url 'index' %}">
|
|
<i class="bi bi-speedometer2"></i><span>首页</span>
|
|
</a>
|
|
</li>
|
|
{% if user.is_authenticated %}
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if request.resolver_match.url_name == 'yesterday_records' or 'add_reading' in request.path or 'edit_reading' in request.path or 'add_insight' in request.path or 'edit_insight' in request.path %}active{% endif %}" href="{% url 'yesterday_records' %}">
|
|
<i class="bi bi-journal-text"></i><span>昨日记录</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if request.resolver_match.url_name == 'today_records' or 'add_today_reading' in request.path or 'edit_today_reading' in request.path or 'add_today_insight' in request.path or 'edit_today_insight' in request.path %}active{% endif %}" href="{% url 'today_records' %}">
|
|
<i class="bi bi-journal-check"></i><span>今日记录</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if request.resolver_match.url_name == 'summaries' or 'add_summary' in request.path or 'edit_summary' in request.path %}active{% endif %}" href="{% url 'summaries' %}">
|
|
<i class="bi bi-collection"></i><span>汇总记录</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if request.resolver_match.url_name == 'family_tasks' or 'add_family_task' in request.path or 'edit_family_task' in request.path %}active{% endif %}" href="{% url 'family_tasks' %}">
|
|
<i class="bi bi-list-check"></i><span>家庭事项</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if request.resolver_match.url_name == 'today_plan' or 'add_today_plan' in request.path or 'edit_today_plan' in request.path %}active{% endif %}" href="{% url 'today_plan' %}">
|
|
<i class="bi bi-calendar-check"></i><span>今日计划</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if request.resolver_match.url_name == 'generate_report' or 'view_report' in request.path or 'generate_pdf_report' in request.path %}active{% endif %}" href="{% url 'generate_report' %}">
|
|
<i class="bi bi-file-earmark-pdf"></i><span>报告生成</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link {% if request.resolver_match.url_name == 'system_settings' %}active{% endif %}" href="{% url 'system_settings' %}">
|
|
<i class="bi bi-gear"></i><span>系统配置</span>
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
<ul class="navbar-nav">
|
|
{% if user.is_authenticated %}
|
|
<li class="nav-item">
|
|
<span class="nav-link">
|
|
<i class="bi bi-person-circle"></i><span>欢迎,{{ user.username }}</span>
|
|
</span>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{% url 'logout' %}">
|
|
<i class="bi bi-box-arrow-right"></i><span>注销</span>
|
|
</a>
|
|
</li>
|
|
{% else %}
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{% url 'login' %}">
|
|
<i class="bi bi-box-arrow-in-right"></i><span>登录</span>
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{% if user.is_authenticated %}
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/houtai/">
|
|
<i class="bi bi-shield-lock"></i><span>后台管理</span>
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<!-- 主要内容区域 -->
|
|
<main class="container mt-4 flex-grow-1">
|
|
{% if messages %}
|
|
{% for message in messages %}
|
|
<div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
|
|
<i class="bi bi-info-circle-fill me-2"></i>{{ message }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
{% block content %}
|
|
{% endblock %}
|
|
</main>
|
|
|
|
<!-- 页脚 -->
|
|
<footer class="text-center text-lg-start mt-5 py-4">
|
|
<div class="container">
|
|
<p class="mb-0">
|
|
<i class="bi bi-heart-fill me-2"></i>
|
|
2026 家庭日报系统 - 专注于xiaji家庭生活的轻量级日报系统
|
|
</p>
|
|
<p class="mb-0 mt-2 small text-white-50">
|
|
<i class="bi bi-clock-history me-1"></i>
|
|
更新时间:{% now "Y-m-d H:i:s" %}
|
|
</p>
|
|
</div>
|
|
</footer>
|
|
|
|
<!-- Bootstrap 5 JS -->
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
<!-- 自定义JS -->
|
|
<script>
|
|
// 切换计划状态
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const toggleButtons = document.querySelectorAll('.toggle-status-btn');
|
|
toggleButtons.forEach(btn => {
|
|
btn.addEventListener('click', function(e) {
|
|
e.preventDefault();
|
|
const url = this.getAttribute('href');
|
|
const statusBadge = this.closest('tr').querySelector('.status-badge');
|
|
|
|
fetch(url, {
|
|
method: 'GET',
|
|
headers: {
|
|
'X-Requested-With': 'XMLHttpRequest'
|
|
}
|
|
})
|
|
.then(response => response.json())
|
|
.then(data => {
|
|
if (data.status === 'completed') {
|
|
statusBadge.className = 'badge bg-success status-badge';
|
|
statusBadge.textContent = '已完成';
|
|
this.innerHTML = '<i class="bi bi-check2-square"></i> 已完成';
|
|
} else {
|
|
statusBadge.className = 'badge bg-warning status-badge';
|
|
statusBadge.textContent = '待处理';
|
|
this.innerHTML = '<i class="bi bi-square"></i> 标记完成';
|
|
}
|
|
})
|
|
.catch(error => {
|
|
console.error('Error:', error);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|