base.html 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
  8. <style>
  9. body { background-color: #f8f9fa; }
  10. .navbar { margin-bottom: 2rem; }
  11. .tree ul { padding-top: 20px; position: relative; transition: all 0.5s; }
  12. .tree li { float: left; text-align: center; list-style-type: none; position: relative; padding: 20px 5px 0 5px; transition: all 0.5s; }
  13. .tree li::before, .tree li::after { content: ''; position: absolute; top: 0; right: 50%; border-top: 1px solid #ccc; width: 50%; height: 20px; }
  14. .tree li::after { right: auto; left: 50%; border-left: 1px solid #ccc; }
  15. .tree li:only-child::after, .tree li:only-child::before { display: none; }
  16. .tree li:only-child { padding-top: 0; }
  17. .tree li:first-child::before, .tree li:last-child::after { border: 0 none; }
  18. .tree li:last-child::before { border-right: 1px solid #ccc; border-radius: 0 5px 0 0; }
  19. .tree li:first-child::after { border-radius: 5px 0 0 0; }
  20. .tree ul ul::before { content: ''; position: absolute; top: 0; left: 50%; border-left: 1px solid #ccc; width: 0; height: 20px; }
  21. .tree li div { border: 1px solid #ccc; padding: 5px 10px; text-decoration: none; color: #666; font-family: arial, verdana, tahoma; font-size: 11px; display: inline-block; border-radius: 5px; transition: all 0.5s; background: #fff; }
  22. .tree li div:hover { background: #c8e4f8; color: #000; border: 1px solid #94a0b4; }
  23. .split-container { display: flex; height: calc(100vh - 150px); }
  24. .form-panel { flex: 1; padding: 20px; overflow-y: auto; border-right: 1px solid #dee2e6; background: #fff; }
  25. .image-panel { flex: 1; padding: 20px; background: #e9ecef; overflow-y: auto; position: relative; }
  26. .image-viewer { text-align: center; }
  27. .image-viewer img { max-width: 100%; height: auto; border: 1px solid #ccc; }
  28. .page-nav { margin-bottom: 10px; display: flex; gap: 10px; }
  29. </style>
  30. </head>
  31. <body>
  32. <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
  33. <div class="container">
  34. <a class="navbar-brand" href="{{ url_for('index') }}">家谱管理系统</a>
  35. <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
  36. <span class="navbar-toggler-icon"></span>
  37. </button>
  38. <div class="collapse navbar-collapse" id="navbarNav">
  39. <ul class="navbar-nav me-auto">
  40. <li class="nav-item">
  41. <a class="nav-link" href="{{ url_for('index') }}">首页</a>
  42. </li>
  43. <li class="nav-item">
  44. <a class="nav-link" href="{{ url_for('members') }}">成员管理</a>
  45. </li>
  46. <li class="nav-item">
  47. <a class="nav-link" href="{{ url_for('tree') }}">关系树</a>
  48. </li>
  49. </ul>
  50. <div class="navbar-nav">
  51. {% if session.get('user_id') %}
  52. <span class="nav-item nav-link text-white">您好, {{ session['username'] }}</span>
  53. <a class="nav-item nav-link" href="{{ url_for('logout') }}">退出</a>
  54. {% else %}
  55. <a class="nav-item nav-link" href="{{ url_for('login') }}">登录</a>
  56. {% endif %}
  57. </div>
  58. </div>
  59. </div>
  60. </nav>
  61. <div class="container-fluid">
  62. {% with messages = get_flashed_messages() %}
  63. {% if messages %}
  64. {% for message in messages %}
  65. <div class="alert alert-info alert-dismissible fade show" role="alert">
  66. {{ message }}
  67. <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
  68. </div>
  69. {% endfor %}
  70. {% endif %}
  71. {% endwith %}
  72. {% block content %}{% endblock %}
  73. </div>
  74. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
  75. </body>
  76. </html>