gcp-hockey-results/motm_app/templates/club_management.html

84 lines
4.3 KiB
HTML

<!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>