Update templates/base.html
Browse files- templates/base.html +22 -9
templates/base.html
CHANGED
@@ -8,9 +8,12 @@
|
|
8 |
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 20px; background-color: #f4f7f6; color: #333; }
|
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; }
|
12 |
-
nav a { margin-right: 15px; text-decoration: none; color: #007bff; font-weight: bold; }
|
13 |
-
nav a:hover { color: #0056b3; text-decoration: underline; }
|
|
|
|
|
|
|
14 |
form { background: #f9f9f9; padding: 20px; border-radius: 5px; margin-bottom: 20px; }
|
15 |
label { display: block; margin-bottom: 8px; font-weight: bold; }
|
16 |
input[type="text"], input[type="email"], input[type="password"] {
|
@@ -21,6 +24,7 @@
|
|
21 |
.flash-messages { margin-bottom: 20px; }
|
22 |
.flash-messages .success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; padding: 10px; border-radius: 5px; margin-bottom: 10px; }
|
23 |
.flash-messages .error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; padding: 10px; border-radius: 5px; margin-bottom: 10px; }
|
|
|
24 |
ul { list-style-type: none; padding: 0; }
|
25 |
li { background: #e9ecef; margin-bottom: 8px; padding: 10px; border-radius: 4px; }
|
26 |
</style>
|
@@ -28,12 +32,21 @@
|
|
28 |
<body>
|
29 |
<div class="container">
|
30 |
<nav>
|
31 |
-
<
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
</nav>
|
38 |
|
39 |
<div class="flash-messages">
|
|
|
8 |
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 20px; background-color: #f4f7f6; color: #333; }
|
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 |
+
nav .auth-status { font-size: 0.9em; }
|
15 |
+
nav .auth-status a { color: #dc3545; text-decoration: none; font-weight: bold; }
|
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"] {
|
|
|
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>
|
|
|
32 |
<body>
|
33 |
<div class="container">
|
34 |
<nav>
|
35 |
+
<div class="nav-links">
|
36 |
+
<a href="{{ url_for('home') }}">Trang chủ</a>
|
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> {# Sửa từ 'users' thành 'get_users' #}
|
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>Mật khẩu trang: Đã xác thực!</span> | <a href="{{ url_for('page_logout') }}">Đăng xuất Mật khẩu trang</a>
|
46 |
+
{% else %}
|
47 |
+
<span>Mật khẩu trang: Chưa xác thực.</span> | <a href="{{ url_for('page_password_form', next=request.path) }}">Nhập Mật khẩu trang</a>
|
48 |
+
{% endif %}
|
49 |
+
</div>
|
50 |
</nav>
|
51 |
|
52 |
<div class="flash-messages">
|