layout.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>{% block title %}家谱管理系统{% endblock %}</title>
  7. <!-- Local Bootstrap CSS -->
  8. <link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
  9. <!-- Local Bootstrap Icons CSS -->
  10. <link href="{{ url_for('static', filename='css/bootstrap-icons.min.css') }}" rel="stylesheet">
  11. <style>
  12. body { font-family: 'Microsoft YaHei', sans-serif; }
  13. .sidebar { min-height: 100vh; background-color: #343a40; color: white; }
  14. .sidebar a { color: rgba(255,255,255,.8); text-decoration: none; padding: 10px 20px; display: block; }
  15. .sidebar a:hover { background-color: #495057; color: white; }
  16. .sidebar a.active { background-color: #0d6efd; color: white; }
  17. .content-area { padding: 20px; }
  18. </style>
  19. {% block extra_css %}{% endblock %}
  20. </head>
  21. <body class="bg-light">
  22. <div class="container-fluid">
  23. <div class="row">
  24. {% if session.get('user_id') %}
  25. <!-- Sidebar -->
  26. <div class="col-md-2 sidebar d-none d-md-block">
  27. <div class="py-4 text-center border-bottom mb-4">
  28. <h4>家谱管理</h4>
  29. </div>
  30. <nav>
  31. <a href="{{ url_for('index') }}" class="{% if request.endpoint == 'index' %}active{% endif %}">
  32. <i class="bi bi-file-earmark-arrow-up me-2"></i> 家谱管理
  33. </a>
  34. <a href="{{ url_for('members') }}" class="{% if request.endpoint == 'members' %}active{% endif %}">
  35. <i class="bi bi-people me-2"></i> 成员列表
  36. </a>
  37. <a href="{{ url_for('tree') }}" class="{% if request.endpoint == 'tree' %}active{% endif %}">
  38. <i class="bi bi-diagram-3 me-2"></i> 关系树状图
  39. </a>
  40. <div class="mt-5 border-top pt-3">
  41. <p class="px-3 small text-muted">用户: {{ session['username'] }}</p>
  42. <a href="{{ url_for('logout') }}" class="text-danger">
  43. <i class="bi bi-box-arrow-right me-2"></i> 退出登录
  44. </a>
  45. </div>
  46. </nav>
  47. </div>
  48. {% endif %}
  49. <!-- Main Content -->
  50. <div class="col-md-{% if session.get('user_id') %}10{% else %}12{% endif %} content-area">
  51. {% with messages = get_flashed_messages() %}
  52. {% if messages %}
  53. {% for message in messages %}
  54. <div class="alert alert-info alert-dismissible fade show" role="alert">
  55. {{ message }}
  56. <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
  57. </div>
  58. {% endfor %}
  59. {% endif %}
  60. {% endwith %}
  61. {% block content %}{% endblock %}
  62. </div>
  63. </div>
  64. </div>
  65. <!-- Local Bootstrap JS -->
  66. <script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') }}"></script>
  67. {% block extra_js %}{% endblock %}
  68. </body>
  69. </html>