Updated code to populate database
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Add Club - HKFC Men's C Team</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3>Add New Club</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% 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 %}
|
||||
|
||||
<form method="POST">
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.hockey_club.label(class="form-label") }}
|
||||
{{ form.hockey_club(class="form-control") }}
|
||||
{% if form.hockey_club.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.hockey_club.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.logo_url.label(class="form-label") }}
|
||||
{{ form.logo_url(class="form-control") }}
|
||||
{% if form.logo_url.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.logo_url.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<small class="form-text text-muted">Enter the full URL to the club's logo image</small>
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
|
||||
{{ form.cancel(class="btn btn-secondary me-md-2") }}
|
||||
{{ form.save_club(class="btn btn-primary") }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<a href="/admin/clubs" class="btn btn-outline-secondary">Back to Club Management</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,109 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Add Player - HKFC Men's C Team</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3>Add New Player</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% 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 %}
|
||||
|
||||
<form method="POST">
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.player_number.label(class="form-label") }}
|
||||
{{ form.player_number(class="form-control") }}
|
||||
{% if form.player_number.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.player_number.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.player_forenames.label(class="form-label") }}
|
||||
{{ form.player_forenames(class="form-control") }}
|
||||
{% if form.player_forenames.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.player_forenames.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.player_surname.label(class="form-label") }}
|
||||
{{ form.player_surname(class="form-control") }}
|
||||
{% if form.player_surname.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.player_surname.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.player_nickname.label(class="form-label") }}
|
||||
{{ form.player_nickname(class="form-control") }}
|
||||
{% if form.player_nickname.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.player_nickname.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.player_team.label(class="form-label") }}
|
||||
{{ form.player_team(class="form-select") }}
|
||||
{% if form.player_team.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.player_team.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
|
||||
{{ form.cancel(class="btn btn-secondary me-md-2") }}
|
||||
{{ form.save_player(class="btn btn-primary") }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<a href="/admin/players" class="btn btn-outline-secondary">Back to Player Management</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,101 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Add Team - HKFC Men's C Team</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3>Add New Team</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% 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 %}
|
||||
|
||||
<form method="POST">
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.club.label(class="form-label") }}
|
||||
{{ form.club(class="form-control") }}
|
||||
{% if form.club.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.club.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<small class="form-text text-muted">Enter the club name (e.g., HKFC, KCC, USRC)</small>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.team.label(class="form-label") }}
|
||||
{{ form.team(class="form-control") }}
|
||||
{% if form.team.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.team.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<small class="form-text text-muted">Enter the team identifier (e.g., A, B, C, 1st, 2nd)</small>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.display_name.label(class="form-label") }}
|
||||
{{ form.display_name(class="form-control") }}
|
||||
{% if form.display_name.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.display_name.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<small class="form-text text-muted">Enter the full display name (e.g., HKFC A, KCC 1st Team)</small>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.league.label(class="form-label") }}
|
||||
{{ form.league(class="form-control") }}
|
||||
{% if form.league.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.league.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<small class="form-text text-muted">Enter the league/division (e.g., Premier Division, Division 1)</small>
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
|
||||
{{ form.cancel(class="btn btn-secondary me-md-2") }}
|
||||
{{ form.save_team(class="btn btn-primary") }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<a href="/admin/teams" class="btn btn-outline-secondary">Back to Team Management</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,83 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Club Management - HKFC Men's C Team</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-4">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h1>Club Management</h1>
|
||||
<p class="lead">Manage hockey clubs in the database</p>
|
||||
|
||||
<div class="mb-3">
|
||||
<a href="/admin/clubs/add" class="btn btn-primary">Add New Club</a>
|
||||
<a href="/admin" class="btn btn-secondary">Back to Admin</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 %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5>All Clubs</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if clubs %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Club Name</th>
|
||||
<th>Logo URL</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for club in clubs %}
|
||||
<tr>
|
||||
<td>{{ club.id }}</td>
|
||||
<td>{{ club.hockey_club }}</td>
|
||||
<td>
|
||||
<a href="{{ club.logo_url }}" target="_blank" class="text-decoration-none">
|
||||
{{ club.logo_url }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/admin/clubs/edit/{{ club.id }}" class="btn btn-sm btn-outline-primary">Edit</a>
|
||||
<form method="POST" action="/admin/clubs/delete/{{ club.id }}" style="display: inline;" onsubmit="return confirm('Are you sure you want to delete this club?')">
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-info">
|
||||
<h5>No clubs found</h5>
|
||||
<p>There are no clubs in the database. <a href="/admin/clubs/add">Add the first club</a> to get started.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Edit Club - HKFC Men's C Team</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3>Edit Club #{{ club_id }}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% 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 %}
|
||||
|
||||
<form method="POST">
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.hockey_club.label(class="form-label") }}
|
||||
{{ form.hockey_club(class="form-control") }}
|
||||
{% if form.hockey_club.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.hockey_club.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.logo_url.label(class="form-label") }}
|
||||
{{ form.logo_url(class="form-control") }}
|
||||
{% if form.logo_url.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.logo_url.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<small class="form-text text-muted">Enter the full URL to the club's logo image</small>
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
|
||||
{{ form.cancel(class="btn btn-secondary me-md-2") }}
|
||||
{{ form.save_club(class="btn btn-primary") }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<a href="/admin/clubs" class="btn btn-outline-secondary">Back to Club Management</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,103 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Edit Player - HKFC Men's C Team</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3>Edit Player #{{ player_number }}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% 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 %}
|
||||
|
||||
<form method="POST">
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.player_number.label(class="form-label") }}
|
||||
{{ form.player_number(class="form-control", readonly=true) }}
|
||||
<small class="form-text text-muted">Player number cannot be changed</small>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.player_forenames.label(class="form-label") }}
|
||||
{{ form.player_forenames(class="form-control") }}
|
||||
{% if form.player_forenames.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.player_forenames.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.player_surname.label(class="form-label") }}
|
||||
{{ form.player_surname(class="form-control") }}
|
||||
{% if form.player_surname.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.player_surname.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.player_nickname.label(class="form-label") }}
|
||||
{{ form.player_nickname(class="form-control") }}
|
||||
{% if form.player_nickname.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.player_nickname.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.player_team.label(class="form-label") }}
|
||||
{{ form.player_team(class="form-select") }}
|
||||
{% if form.player_team.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.player_team.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
|
||||
{{ form.cancel(class="btn btn-secondary me-md-2") }}
|
||||
{{ form.save_player(class="btn btn-primary") }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<a href="/admin/players" class="btn btn-outline-secondary">Back to Player Management</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,101 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Edit Team - HKFC Men's C Team</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3>Edit Team #{{ team_id }}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% 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 %}
|
||||
|
||||
<form method="POST">
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.club.label(class="form-label") }}
|
||||
{{ form.club(class="form-control") }}
|
||||
{% if form.club.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.club.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<small class="form-text text-muted">Enter the club name (e.g., HKFC, KCC, USRC)</small>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.team.label(class="form-label") }}
|
||||
{{ form.team(class="form-control") }}
|
||||
{% if form.team.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.team.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<small class="form-text text-muted">Enter the team identifier (e.g., A, B, C, 1st, 2nd)</small>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.display_name.label(class="form-label") }}
|
||||
{{ form.display_name(class="form-control") }}
|
||||
{% if form.display_name.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.display_name.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<small class="form-text text-muted">Enter the full display name (e.g., HKFC A, KCC 1st Team)</small>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.league.label(class="form-label") }}
|
||||
{{ form.league(class="form-control") }}
|
||||
{% if form.league.errors %}
|
||||
<div class="text-danger">
|
||||
{% for error in form.league.errors %}
|
||||
<small>{{ error }}</small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<small class="form-text text-muted">Enter the league/division (e.g., Premier Division, Division 1)</small>
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
|
||||
{{ form.cancel(class="btn btn-secondary me-md-2") }}
|
||||
{{ form.save_team(class="btn btn-primary") }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<a href="/admin/teams" class="btn btn-outline-secondary">Back to Team Management</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>HKFC Men's D Team - MOTM System</title>
|
||||
<title>HKFC Men's C Team - MOTM System</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
@@ -11,7 +11,7 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h1>HKFC Men's D Team - Man of the Match System</h1>
|
||||
<h1>HKFC Men's C Team - Man of the Match System</h1>
|
||||
<div class="jumbotron">
|
||||
<h2>Welcome to the MOTM Voting System</h2>
|
||||
<p>This system allows players to vote for Man of the Match and Dick of the Day, while providing admin tools for managing matches and squads.</p>
|
||||
@@ -31,18 +31,34 @@
|
||||
<div class="col-md-6">
|
||||
<h3>Admin Section</h3>
|
||||
<div class="list-group">
|
||||
<a href="/admin/players" class="list-group-item">
|
||||
<h4 class="list-group-item-heading">Player Management</h4>
|
||||
<p class="list-group-item-text">Add, edit, and manage players in the database</p>
|
||||
</a>
|
||||
<a href="/admin/clubs" class="list-group-item">
|
||||
<h4 class="list-group-item-heading">Club Management</h4>
|
||||
<p class="list-group-item-text">Add, edit, and manage hockey clubs</p>
|
||||
</a>
|
||||
<a href="/admin/teams" class="list-group-item">
|
||||
<h4 class="list-group-item-heading">Team Management</h4>
|
||||
<p class="list-group-item-text">Add, edit, and manage hockey teams</p>
|
||||
</a>
|
||||
<a href="/admin/squad" class="list-group-item">
|
||||
<h4 class="list-group-item-heading">Match Squad Selection</h4>
|
||||
<p class="list-group-item-text">Select players for the match squad</p>
|
||||
</a>
|
||||
<a href="/admin/squad/list" class="list-group-item">
|
||||
<h4 class="list-group-item-heading">View Current Squad</h4>
|
||||
<p class="list-group-item-text">View current match squad</p>
|
||||
</a>
|
||||
<a href="/admin/squad/reset" class="list-group-item">
|
||||
<h4 class="list-group-item-heading">Reset Squad</h4>
|
||||
<p class="list-group-item-text">Reset squad for new match</p>
|
||||
</a>
|
||||
<a href="/admin/motm" class="list-group-item">
|
||||
<h4 class="list-group-item-heading">MOTM Admin</h4>
|
||||
<p class="list-group-item-text">Manage match settings and activate voting</p>
|
||||
</a>
|
||||
<a href="/admin/squad" class="list-group-item">
|
||||
<h4 class="list-group-item-heading">Squad Management</h4>
|
||||
<p class="list-group-item-text">Add players to match squads</p>
|
||||
</a>
|
||||
<a href="/admin/squad/list" class="list-group-item">
|
||||
<h4 class="list-group-item-heading">View Squad</h4>
|
||||
<p class="list-group-item-text">View current match squad</p>
|
||||
</a>
|
||||
<a href="/admin/stats" class="list-group-item">
|
||||
<h4 class="list-group-item-heading">Goals & Assists</h4>
|
||||
<p class="list-group-item-text">Record goals and assists statistics</p>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>HKFC Men's D Team - Match Comments</title>
|
||||
<title>HKFC Men's C Team - Match Comments</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
|
||||
@@ -1,200 +1,73 @@
|
||||
<html>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
|
||||
<style>
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
#squadForm {
|
||||
background-color: #ffffff;
|
||||
margin: 100px auto;
|
||||
font-family: Raleway;
|
||||
padding: 40px;
|
||||
width: 40%;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
input {
|
||||
padding: 10px;
|
||||
width: 10%;
|
||||
font-size: 17px;
|
||||
font-family: Raleway;
|
||||
border: 1px solid #aaaaaa;
|
||||
}
|
||||
|
||||
/* Mark input boxes that gets an error on validation: */
|
||||
input.invalid {
|
||||
background-color: #ffdddd;
|
||||
}
|
||||
|
||||
/* Hide all steps by default: */
|
||||
.tab {
|
||||
display: none;
|
||||
}
|
||||
|
||||
button {
|
||||
background-color: #4CAF50;
|
||||
color: #ffffff;
|
||||
border: none;
|
||||
padding: 10px 20px;
|
||||
font-size: 17px;
|
||||
font-family: Raleway;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
#prevBtn {
|
||||
background-color: #bbbbbb;
|
||||
}
|
||||
|
||||
/* Make circles that indicate the steps of the form: */
|
||||
.step {
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
margin: 0 2px;
|
||||
background-color: #bbbbbb;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
display: inline-block;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.step.active {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Mark the steps that are finished and valid: */
|
||||
.step.finish {
|
||||
background-color: #4CAF50;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Match Squad Selection - HKFC Men's C Team</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<form id="squadForm" action="/admin/squad/submit" method="post">
|
||||
|
||||
<h1>Add Players to Squad</h1>
|
||||
|
||||
<!-- One "tab" for each step in the form: -->
|
||||
{% for team in teams %}
|
||||
<div class="tab">{{ team.team }} Team Players
|
||||
<p>
|
||||
{% for item in players %}
|
||||
{% if item.playerTeam == team.team %}
|
||||
<label><input type="checkbox" name="playerNumber" value="{{ item.playerNumber }}">{{ item.playerNumber }} {{ item.playerForenames }} {{ item.playerSurname }}</label>
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<div style="overflow:auto;">
|
||||
<div style="float:right;">
|
||||
<button type="button" id="prevBtn" onclick="nextPrev(-1)">Previous</button>
|
||||
<button type="button" id="nextBtn" onclick="nextPrev(1)">Next</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Circles which indicates the steps of the form: -->
|
||||
<div style="text-align:center;margin-top:40px;">
|
||||
<span class="step"></span>
|
||||
<span class="step"></span>
|
||||
<span class="step"></span>
|
||||
<span class="step"></span>
|
||||
<span class="step"></span>
|
||||
<span class="step"></span>
|
||||
<span class="step"></span>
|
||||
<span class="step"></span>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
var currentTab = 0; // Current tab is set to be the first tab (0)
|
||||
showTab(currentTab); // Display the crurrent tab
|
||||
|
||||
function showTab(n) {
|
||||
// This function will display the specified tab of the form...
|
||||
var x = document.getElementsByClassName("tab");
|
||||
x[n].style.display = "block";
|
||||
//... and fix the Previous/Next buttons:
|
||||
if (n == 0) {
|
||||
document.getElementById("prevBtn").style.display = "none";
|
||||
} else {
|
||||
document.getElementById("prevBtn").style.display = "inline";
|
||||
}
|
||||
if (n == (x.length - 1)) {
|
||||
document.getElementById("nextBtn").innerHTML = "Submit";
|
||||
} else {
|
||||
document.getElementById("nextBtn").innerHTML = "Next";
|
||||
}
|
||||
//... and run a function that will display the correct step indicator:
|
||||
fixStepIndicator(n)
|
||||
}
|
||||
|
||||
function nextPrev(n) {
|
||||
// This function will figure out which tab to display
|
||||
var x = document.getElementsByClassName("tab");
|
||||
// Exit the function if any field in the current tab is invalid:
|
||||
// JDE ** Need to validate for this to work? ** if (n == 1 && !validateForm()) return false;
|
||||
// Hide the current tab:
|
||||
x[currentTab].style.display = "none";
|
||||
// Increase or decrease the current tab by 1:
|
||||
currentTab = currentTab + n;
|
||||
// if you have reached the end of the form...
|
||||
if (currentTab >= x.length) {
|
||||
// ... the form gets submitted:
|
||||
document.getElementById("squadForm").submit();
|
||||
return false;
|
||||
}
|
||||
// Otherwise, display the correct tab:
|
||||
showTab(currentTab);
|
||||
}
|
||||
|
||||
function validateForm() {
|
||||
// This function deals with validation of the form fields
|
||||
var x, y, i, valid = true;
|
||||
x = document.getElementsByClassName("tab");
|
||||
y = x[currentTab].getElementsByTagName("input");
|
||||
// A loop that checks every input field in the current tab:
|
||||
for (i = 0; i < y.length; i++) {
|
||||
// If a field is empty...
|
||||
if (y[i].value == "") {
|
||||
// add an "invalid" class to the field:
|
||||
y[i].className += " invalid";
|
||||
// and set the current valid status to false
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
// If the valid status is true, mark the step as finished and valid:
|
||||
if (valid) {
|
||||
document.getElementsByClassName("step")[currentTab].className += " finish";
|
||||
}
|
||||
return valid; // return the valid status
|
||||
}
|
||||
|
||||
function fixStepIndicator(n) {
|
||||
// This function removes the "active" class of all steps...
|
||||
var i, x = document.getElementsByClassName("step");
|
||||
for (i = 0; i < x.length; i++) {
|
||||
x[i].className = x[i].className.replace(" active", "");
|
||||
}
|
||||
//... and adds the "active" class on the current step:
|
||||
x[n].className += " active";
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container mt-4">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h1>Match Squad Selection</h1>
|
||||
<p class="lead">Select players for the match squad from the available players</p>
|
||||
|
||||
<div class="mb-3">
|
||||
<a href="/admin/players" class="btn btn-outline-primary">Manage Players</a>
|
||||
<a href="/admin" class="btn btn-secondary">Back to Admin</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 %}
|
||||
|
||||
{% if players %}
|
||||
<form action="/admin/squad/submit" method="post">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5>Available Players</h5>
|
||||
<small class="text-muted">Select players to add to the match squad</small>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{% for player in players %}
|
||||
<div class="col-md-4 mb-3">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="playerNumber" value="{{ player.playerNumber }}" id="player{{ player.playerNumber }}">
|
||||
<label class="form-check-label" for="player{{ player.playerNumber }}">
|
||||
<strong>#{{ player.playerNumber }}</strong> {{ player.playerForenames }} {{ player.playerSurname }}
|
||||
<br>
|
||||
<small class="text-muted">{{ player.playerNickname }} - {{ player.playerTeam }}</small>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="submit" class="btn btn-primary">Add Selected Players to Squad</button>
|
||||
<a href="/admin/squad/list" class="btn btn-outline-secondary">View Current Squad</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% else %}
|
||||
<div class="alert alert-warning">
|
||||
<h5>No players available</h5>
|
||||
<p>There are no players in the database. <a href="/admin/players/add">Add some players</a> before selecting a squad.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>HKFC Men's D Team - Match Squad Selected</title>
|
||||
<title>HKFC Men's C Team - Match Squad Selected</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>HKFC Men's D Team - MotM and DotD vote admin</title>
|
||||
<title>HKFC Men's C Team - MotM and DotD vote admin</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<h2>HKFC Men's D Team MotM and DotD online vote admin page</h2>
|
||||
<h2>HKFC Men's C Team MotM and DotD online vote admin page</h2>
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
@@ -23,7 +23,7 @@
|
||||
<dl>
|
||||
<p>
|
||||
{{ form.csrf_token }}
|
||||
<b>HKFC D Next Opponent:</b>
|
||||
<b>HKFC C Next Opponent:</b>
|
||||
<br/>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
@@ -32,7 +32,7 @@
|
||||
<div class = "col-sm-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon1">Date:</span>
|
||||
{{ form.nextMatch(class_="form-control") }}
|
||||
{{ form.nextMatchDate(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -74,32 +74,8 @@
|
||||
</dl>
|
||||
|
||||
<script>
|
||||
var match_select = document.getElementById("nextMatch");
|
||||
var club_logo = document.getElementById("nextOppoLogo");
|
||||
var team_select = document.getElementById("nextOppoTeam");
|
||||
|
||||
match_select.onchange = function() {myFunction()};
|
||||
|
||||
function myFunction() {
|
||||
|
||||
match = match_select.value;
|
||||
|
||||
fetch('/admin/api/fixture/' + match).then(function(response) {
|
||||
response.json().then(function(team) {
|
||||
var optionHTML = '';
|
||||
optionHTML += team;
|
||||
team_select.value = optionHTML;
|
||||
})
|
||||
|
||||
});
|
||||
fetch('/admin/api/fixture/' + match + '/logo').then(function(response) {
|
||||
response.json().then(function(logo) {
|
||||
var HTML = '';
|
||||
HTML += logo;
|
||||
club_logo.src = HTML;
|
||||
})
|
||||
});
|
||||
}
|
||||
// Date input functionality - no longer needed to fetch fixture data
|
||||
// The date input will be handled by the browser's native date picker
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>HKFC Men's D Team - MotM and DotD online vote</title>
|
||||
<title>HKFC Men's C Team - MotM and DotD online vote</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<h3>HKFC Men's D Team MotM and DotD online vote</h3>
|
||||
<h3>HKFC Men's C Team MotM and DotD online vote</h3>
|
||||
<h5>{{ formatDate }}</h5>
|
||||
<h4><img src="{{ hkfcLogo }}" height="150"></img> <b> </b> <img src="{{ oppoLogo }}" height="140"></img></h4>
|
||||
<body>
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Player Management - HKFC Men's C Team</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-4">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h1>Player Management</h1>
|
||||
<p class="lead">Manage players in the HKFC Men's C Team database</p>
|
||||
|
||||
<div class="mb-3">
|
||||
<a href="/admin/players/add" class="btn btn-primary">Add New Player</a>
|
||||
<a href="/admin" class="btn btn-secondary">Back to Admin</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 %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5>All Players</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if players %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>Number</th>
|
||||
<th>First Names</th>
|
||||
<th>Surname</th>
|
||||
<th>Nickname</th>
|
||||
<th>Team</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for player in players %}
|
||||
<tr>
|
||||
<td>{{ player.playerNumber }}</td>
|
||||
<td>{{ player.playerForenames }}</td>
|
||||
<td>{{ player.playerSurname }}</td>
|
||||
<td>{{ player.playerNickname }}</td>
|
||||
<td>
|
||||
<span class="badge bg-{{ 'primary' if player.playerTeam == 'HKFC C' else 'secondary' }}">
|
||||
{{ player.playerTeam }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/admin/players/edit/{{ player.playerNumber }}" class="btn btn-sm btn-outline-primary">Edit</a>
|
||||
<form method="POST" action="/admin/players/delete/{{ player.playerNumber }}" style="display: inline;" onsubmit="return confirm('Are you sure you want to delete this player?')">
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-info">
|
||||
<h5>No players found</h5>
|
||||
<p>There are no players in the database. <a href="/admin/players/add">Add the first player</a> to get started.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,83 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Team Management - HKFC Men's C Team</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-4">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h1>Team Management</h1>
|
||||
<p class="lead">Manage hockey teams in the database</p>
|
||||
|
||||
<div class="mb-3">
|
||||
<a href="/admin/teams/add" class="btn btn-primary">Add New Team</a>
|
||||
<a href="/admin" class="btn btn-secondary">Back to Admin</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 %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5>All Teams</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if teams %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Club</th>
|
||||
<th>Team</th>
|
||||
<th>Display Name</th>
|
||||
<th>League</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for team in teams %}
|
||||
<tr>
|
||||
<td>{{ team.id }}</td>
|
||||
<td>{{ team.club }}</td>
|
||||
<td>{{ team.team }}</td>
|
||||
<td>{{ team.display_name }}</td>
|
||||
<td>{{ team.league }}</td>
|
||||
<td>
|
||||
<a href="/admin/teams/edit/{{ team.id }}" class="btn btn-sm btn-outline-primary">Edit</a>
|
||||
<form method="POST" action="/admin/teams/delete/{{ team.id }}" style="display: inline;" onsubmit="return confirm('Are you sure you want to delete this team?')">
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-info">
|
||||
<h5>No teams found</h5>
|
||||
<p>There are no teams in the database. <a href="/admin/teams/add">Add the first team</a> to get started.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>HKFC Men's D Team - MotM and DotD vote</title>
|
||||
<title>HKFC Men's C Team - MotM and DotD vote</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
|
||||
Reference in New Issue
Block a user