gcp-hockey-results/motm_app/templates/admin_profile.html
2025-10-04 17:04:55 +08:00

161 lines
7.8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Profile - HKFC Men's C Team MOTM System</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
.profile-section {
background-color: #f8f9fa;
border: 1px solid #dee2e6;
border-radius: 0.375rem;
padding: 2rem;
margin-bottom: 2rem;
}
.security-notice {
background-color: #fff3cd;
border: 1px solid #ffeaa7;
border-radius: 0.375rem;
padding: 1rem;
margin-bottom: 2rem;
}
</style>
</head>
<body>
<div class="container mt-4">
<div class="row">
<div class="col-md-8 mx-auto">
<h1>Admin Profile</h1>
<p class="lead">Manage your admin account settings and password</p>
<div class="mb-3">
<a href="/admin" class="btn btn-outline-primary">Back to Admin Dashboard</a>
</div>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ 'danger' if category == 'error' else 'success' }} alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
<!-- Security Notice -->
<div class="security-notice">
<h5><i class="bi bi-shield-check"></i> Security Notice</h5>
<p class="mb-0">
<strong>Important:</strong> Changing your password will immediately affect access to all admin functions.
Make sure to remember your new password or store it securely.
</p>
</div>
<!-- Profile Form -->
<div class="profile-section">
<h3>Change Password & Settings</h3>
<form method="POST">
{{ form.hidden_tag() }}
<div class="row">
<div class="col-md-6">
<div class="mb-3">
{{ form.current_password.label(class="form-label") }}
{{ form.current_password(class="form-control", placeholder="Enter current password") }}
{% if form.current_password.errors %}
<div class="text-danger">
{% for error in form.current_password.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="mb-3">
{{ form.new_password.label(class="form-label") }}
{{ form.new_password(class="form-control", placeholder="Enter new password (min 6 characters)") }}
{% if form.new_password.errors %}
<div class="text-danger">
{% for error in form.new_password.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
{{ form.confirm_password.label(class="form-label") }}
{{ form.confirm_password(class="form-control", placeholder="Confirm new password") }}
{% if form.confirm_password.errors %}
<div class="text-danger">
{% for error in form.confirm_password.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="mb-3">
{{ form.email.label(class="form-label") }}
{{ form.email(class="form-control", placeholder="admin@example.com") }}
{% if form.email.errors %}
<div class="text-danger">
{% for error in form.email.errors %}
<small>{{ error }}</small>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
<div class="mb-3">
<button type="submit" class="btn btn-primary">Update Profile</button>
<a href="/admin" class="btn btn-secondary">Cancel</a>
</div>
</form>
</div>
<!-- Current Profile Info -->
<div class="profile-section">
<h3>Current Profile Information</h3>
<div class="row">
<div class="col-md-6">
<p><strong>Username:</strong> admin</p>
<p><strong>Email:</strong> {{ current_email or 'Not set' }}</p>
</div>
<div class="col-md-6">
<p><strong>Account Type:</strong> Administrator</p>
<p><strong>Access Level:</strong> Full Admin Rights</p>
</div>
</div>
</div>
<!-- Password Requirements -->
<div class="profile-section">
<h3>Password Requirements</h3>
<ul class="list-unstyled">
<li><i class="bi bi-check-circle text-success"></i> Minimum 6 characters</li>
<li><i class="bi bi-check-circle text-success"></i> Must match confirmation</li>
<li><i class="bi bi-check-circle text-success"></i> Current password must be correct</li>
</ul>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>