Updated code to populate database

This commit is contained in:
2025-09-29 22:39:57 +08:00
parent 1b36a283d5
commit aabc01382c
23 changed files with 1470 additions and 371 deletions
+6 -30
View File
@@ -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>