File size: 5,089 Bytes
9cc30a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c7947de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9cc30a5
 
 
 
 
 
c7947de
 
9cc30a5
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{% extends "base.html" %}

{% block title %}Đăng ký - Student Feedback Analysis{% endblock %}
{% block page_title %}Đăng ký{% endblock %}
{% block container_class %} min-vh-100{% endblock %}

{% block header %}{% endblock %}
{% block flash_messages %}{% endblock %}
{% block footer %}{% endblock %}

{% block content %}
<div class="row justify-content-center align-items-center min-vh-100">
    <div class="col-lg-6 col-md-8">
        <!-- Registration Form -->
        <div class="card shadow-sm">
            <div class="card-header bg-primary text-white">
                <h3 class="card-title mb-0">
                    <i class="fas fa-user-plus me-2"></i>
                    Tạo tài khoản mới
                </h3>
            </div>
            <div class="card-body">
                <!-- Flash Messages -->
                {% with messages = get_flashed_messages(with_categories=true) %}
                    {% if messages %}
                        {% for category, message in messages %}
                            <div class="alert alert-{{ 'danger' if category == 'error' else category }} alert-dismissible fade show" role="alert">
                                <div class="alert-content">
                                    <i class="fas fa-{{ 'exclamation-triangle' if category == 'error' else 'info-circle' if category == 'info' else 'check-circle' if category == 'success' else 'exclamation-triangle' }}"></i>
                                    {{ message }}
                                </div>
                                <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                            </div>
                        {% endfor %}
                    {% endif %}
                {% endwith %}

                        <form method="POST">
                            {{ form.hidden_tag() }}
                            
                            <div class="mb-3">
                                {{ form.username.label(class="form-label fw-bold") }}
                                {{ form.username(class="form-control" + (" is-invalid" if form.username.errors else "")) }}
                                {% if form.username.errors %}
                                    <div class="invalid-feedback">
                                        {% for error in form.username.errors %}
                                            {{ error }}
                                        {% endfor %}
                                    </div>
                                {% endif %}
                            </div>

                            <div class="mb-3">
                                {{ form.password.label(class="form-label fw-bold") }}
                                {{ form.password(class="form-control" + (" is-invalid" if form.password.errors else "")) }}
                                {% if form.password.errors %}
                                    <div class="invalid-feedback">
                                        {% for error in form.password.errors %}
                                            {{ error }}
                                        {% endfor %}
                                    </div>
                                {% endif %}
                            </div>

                            <div class="mb-4">
                                {{ form.confirm_password.label(class="form-label fw-bold") }}
                                {{ form.confirm_password(class="form-control" + (" is-invalid" if form.confirm_password.errors else "")) }}
                                {% if form.confirm_password.errors %}
                                    <div class="invalid-feedback">
                                        {% for error in form.confirm_password.errors %}
                                            {{ error }}
                                        {% endfor %}
                                    </div>
                                {% endif %}
                            </div>

                            <div class="d-grid">
                                {{ form.submit(class="btn btn-primary btn-lg") }}
                            </div>
                        </form>

                        <hr class="my-4">
                        
                        <div class="text-center">
                            <p class="text-muted mb-0">
                                Đã có tài khoản? 
                                <a href="{{ url_for('login') }}" class="text-decoration-none fw-bold text-secondary">
                                    Đăng nhập ngay
                                </a>
                            </p>
                        </div>
                    </div>
                </div>

        <!-- Back to Home -->
        <div class="text-center mt-3">
            <a href="{{ url_for('home') }}" class="btn btn-outline-secondary">
                <i class="fas fa-arrow-left me-2"></i>
                Về trang chủ
            </a>
        </div>
    </div>
</div>
{% endblock %}