Update templates/base.html
Browse files- templates/base.html +7 -23
templates/base.html
CHANGED
@@ -5,28 +5,11 @@
|
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<title>{{ title | default('Ứng dụng Flask Supabase') }}</title>
|
7 |
<style>
|
8 |
-
|
9 |
-
.container { max-width: 800px; margin: auto; background: #fff; padding: 20px 30px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
|
10 |
-
h1, h2 { color: #0056b3; border-bottom: 2px solid #eee; padding-bottom: 10px; margin-bottom: 20px; }
|
11 |
-
nav { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }
|
12 |
nav .nav-links a { margin-right: 15px; text-decoration: none; color: #007bff; font-weight: bold; }
|
13 |
nav .nav-links a:hover { color: #0056b3; text-decoration: underline; }
|
14 |
-
|
15 |
-
nav
|
16 |
-
nav .auth-status a:hover { text-decoration: underline; }
|
17 |
-
form { background: #f9f9f9; padding: 20px; border-radius: 5px; margin-bottom: 20px; }
|
18 |
-
label { display: block; margin-bottom: 8px; font-weight: bold; }
|
19 |
-
input[type="text"], input[type="email"], input[type="password"] {
|
20 |
-
width: calc(100% - 22px); padding: 10px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 4px;
|
21 |
-
}
|
22 |
-
button { background-color: #28a745; color: white; padding: 12px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 16px; }
|
23 |
-
button:hover { background-color: #218838; }
|
24 |
-
.flash-messages { margin-bottom: 20px; }
|
25 |
-
.flash-messages .success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; padding: 10px; border-radius: 5px; margin-bottom: 10px; }
|
26 |
-
.flash-messages .error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; padding: 10px; border-radius: 5px; margin-bottom: 10px; }
|
27 |
-
.flash-messages .info { background-color: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; padding: 10px; border-radius: 5px; margin-bottom: 10px; }
|
28 |
-
ul { list-style-type: none; padding: 0; }
|
29 |
-
li { background: #e9ecef; margin-bottom: 8px; padding: 10px; border-radius: 4px; }
|
30 |
</style>
|
31 |
</head>
|
32 |
<body>
|
@@ -37,14 +20,15 @@
|
|
37 |
<a href="{{ url_for('test_db') }}">Kiểm tra DB</a>
|
38 |
<a href="{{ url_for('create_table') }}">Tạo Bảng</a>
|
39 |
<a href="{{ url_for('add_user') }}">Thêm Người dùng</a>
|
40 |
-
<a href="{{ url_for('get_users') }}">Danh sách Người dùng</a>
|
41 |
<a href="{{ url_for('login') }}">Đăng nhập Người dùng</a>
|
|
|
42 |
</div>
|
43 |
<div class="auth-status">
|
44 |
{% if session.get('page_logged_in') %}
|
45 |
-
<span>Đã xác thực
|
46 |
{% else %}
|
47 |
-
<span>Chưa xác thực
|
48 |
{% endif %}
|
49 |
</div>
|
50 |
</nav>
|
|
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<title>{{ title | default('Ứng dụng Flask Supabase') }}</title>
|
7 |
<style>
|
8 |
+
/* ... (CSS hiện có) ... */
|
|
|
|
|
|
|
9 |
nav .nav-links a { margin-right: 15px; text-decoration: none; color: #007bff; font-weight: bold; }
|
10 |
nav .nav-links a:hover { color: #0056b3; text-decoration: underline; }
|
11 |
+
/* Thêm style cho link mới nếu cần */
|
12 |
+
.nav-links a.active { color: #0056b3; text-decoration: underline; } /* Ví dụ: style cho link đang active */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
</style>
|
14 |
</head>
|
15 |
<body>
|
|
|
20 |
<a href="{{ url_for('test_db') }}">Kiểm tra DB</a>
|
21 |
<a href="{{ url_for('create_table') }}">Tạo Bảng</a>
|
22 |
<a href="{{ url_for('add_user') }}">Thêm Người dùng</a>
|
23 |
+
<a href="{{ url_for('get_users') }}">Danh sách Người dùng</a>
|
24 |
<a href="{{ url_for('login') }}">Đăng nhập Người dùng</a>
|
25 |
+
<a href="{{ url_for('solar_flow') }}">Điện mặt trời</a> {# <-- Thêm liên kết mới #}
|
26 |
</div>
|
27 |
<div class="auth-status">
|
28 |
{% if session.get('page_logged_in') %}
|
29 |
+
<span>Đã xác thực</span> | <a href="{{ url_for('page_logout') }}">Đăng xuất</a>
|
30 |
{% else %}
|
31 |
+
<span>Chưa xác thực</span> | <a href="{{ url_for('page_password_form', next=request.path) }}">Đăng nhập</a>
|
32 |
{% endif %}
|
33 |
</div>
|
34 |
</nav>
|