Reducing the files down to what is required

This commit is contained in:
jenkins-x-bot
2020-09-12 21:38:52 +08:00
parent 456f3b58eb
commit 8d6123db47
57 changed files with 48 additions and 3468 deletions
-51
View File
@@ -1,51 +0,0 @@
First off, this page needs to be formatted ...
This web application was first put together in an attempt to make the HKHA historical results more acccessible. The current HKHA page is fairly useless, and makes an attempt to conceal historical results, which means in order to review previous season(s) results, you need to use a tool such https://web.archive.org and pick out snapshots of the HKHA website from the date you want to check.
The sad thing is that the HKHA do have these records on their web server, and they are even publicly accessible, they're just not publicly exposed. There is, unsurprisingly, no public API to this data, and instead the results (both the current season and previous seasons) are saved as individual ASP pages. Presumably these are created programmatically and then uploaded to the web server. The data is suitably embedded to make it annoying to extract.
On a separate server I have a job set up to download all the ASP files (this is only done once and only new files on the HKHA web server are retrieved in future requests). A series of bash and python scripts then extract out the data from each match card ASP file so that the following data can be uploaded to a MySQL database:
- Match Number
- Match Date
- Match Time
- Home Club
- Home Team
- Home Score
- Away Club
- Away Team
- Away Score
- Umpire 1
- Umpire 2
- Match Official
Separately, the line ups are then extracted and also uploaded to a MySQL database keeping track of player names, player numbers, appearances, goals, captaincy, and potentially whether they are a goalkeeper. Some teams are better than others about submitting goalkeeper information, so that tends to be a bit random. Some matchcards are 'blank' with no good reason given. When these are encountered, if there is a result on the card, this is recorded, and the player records are updated to reflect that a match took place, but no players are marked as having played. This isn't great, but given there is no data available, there isn't much that can be done here. I should also be tracking yellow/red cards, although this data also appears to be a bit hit and miss on the matchcard data.
Previous seasons are being uploaded/processed as and when I have time. Currently, 2014/15 season is as far back as the database goes - the data should be available back to 2009/10 though, and if I have time this will be uploaded also. Likewise there also appears to be the data for the equivalent ladies matches. If time permits, then this will also be added to the database and application.
As an extension of the match/player tracking side, I decided to add some convenor and team related functionality. The convenor functionality allows me to track the details of the club players I enter the details of. Much more manageable system than the HKHA currently provide, and helps me understand how to connect python to MySQL etc. The team functionality is to create an online MotM/DotD vote.
Initially, the MotM vote would generate a list of players from the players who had previously represented the team. This list was using match card data previously uploaded to the database, and worked fairly well. The drawbacks here were that people could vote for players who were not present at the match which isn't ideal. The player list presented was also originally sorted by the player number which could result in certain players being selected by 'default'. The player list code has been revised so that:
- The 'admin' user must submit a player list before the vote can take place (this is not dis-similar to the HKHA match card system)
- The player list presented is randomised.
- The player names are taken from a convenor maintained database table which means I can incorporate nicknames instead of the formal names used by the HKHA (if no nickname is created in the table, it falls back to using the formal name)
A match comments system has also been added so that players can add a comment on the match they are voting on (if they wish). The voting form also includes one randomly selected match comment (to allow for anyone who wants to try and influence future voters ...). There is a separate comment form so that comments can be added without needing to submit more votes.
At the moment, the vote is 'open'. No login is required and there is limited tracking of votes, which means it is feasible for one person to vote many times. Currently I'm relying on the honour system to keep the process working. It would be relatively straightforward to add a login function required to vote, but this might/would discourage voters.
ARCHITECTURE
The web application is coded with python and uses the flask web framework to run. The backend database is a MySQL database, which python connects easiy to. The flask web application is hosted on the Google Application Engine and the MySQL database is provided by the Google Cloud SQL. The usage levels are low enough that GAE should always qualify for free tier and the Cloud SQL cost is low and is currently being paid for by the free trial credit. The static images/files are uploaded to Google Cloud Storage and their locations are saved into the MySQL database as fields of the objects they represent (typically these are player pictures and other images used on the web application).
It's all very low traffic and therefore a cheap deployment, but with enough activity that it I can understand what works and what doesn't.
Future changes will involve saving various parameters to a settings table so that there is less (no) hardcoding of values which should allow for the whole application to be managed via the webpage. Currently the MotM/DotD tables need to be manually referenced and the Chart that the admin can check to see the vote values also needs to be hardcoded to use the correct tables. This requires a certain amount of manual configuration by the admin before the match is played. If various parameters (such as match date) can be moved to a settings table and read as needed then this would allow the MotM set up and activation to be performed via the web page alone.
More future changes will involve uploading the remaining data from the men's seasons, and then the ladies matches as well.
I'd also like to tidy up the interface and make it more consistent.
The code also needs to be reviewed (again) - and there are undoubtedly repeated bits of code. This is the result of:
a) not knowing python very well
b) only getting to spend short spells on this at random times
-41
View File
@@ -1,41 +0,0 @@
<ooctype html>
<head>
<title>List of player team appearances from 2018/19 season - Python Flask MySQL app</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>
<body>
<p>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class=flashes>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</p>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
{%- for column in columns %}
<th>{{ column['Field'] }}</th>
{%- endfor %}
</thead>
<tbody>
{%- for row in rows %}
<tr>
{%- for column in columns %}
<td>{{ row[column['Field']] }}</td>
{%- endfor %}
</tr>
{%- endfor %}
</tbody>
</table>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
-31
View File
@@ -1,31 +0,0 @@
{% extends "bootstrap/base.html" %}
{% block title %}
Add Club Form
{% endblock %}
{% block head %}
<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>
{% endblock %}
{% block body %}
<form method="post" action="/convenor/clubAddResult">
<legend>Add Hockey Club Form</legend>
{{ form.hidden_tag() }}
<div>
{{ form.clubName.label }}<br>
{{ form.clubName(class_="form-control") }}
<br>
{{ form.submit(class_="btn btn-success") }}
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
</div>
</form>
{% endblock %}
-18
View File
@@ -1,18 +0,0 @@
<html>
<head>
<title>HKFC Men's D Team - MotM and DotD vote *TESTING*</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>Thanks for adding {{ data }} to the club database</h2>
<body>
This automatically adds the A team of {{ data }} to the database.
<p>
</p>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
</html>
-26
View File
@@ -1,26 +0,0 @@
<doctype html>
<head>
<title>List of Clubs and Teams - Python Flask MySQL CRUD</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>
<body>
<p>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class=flashes>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</p>
<table class="table table-bordered">
{{ table }}
</table>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
-18
View File
@@ -1,18 +0,0 @@
<html>
<head>
<title>*TESTING* Player Added to Database</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>Thanks for editting {{ firstname }} {{ surname }} in the {{ club }} database</h2>
<body>
{{ firstname }} {{ surname }} with shirt number {{ shirt }} has been modified in the {{ club }} database for this season.
<p>
</p>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
</html>
-48
View File
@@ -1,48 +0,0 @@
<html>
<head>
<title>Edit Team Members</title>
</head>
<body>
<h1>Edit Team</h1>
<div>
<form action="/convenor/editSquadEnd" method="post" accept-charset="utf-8">
Team: {{ team }}<br>
<div>
<table border="1">
<tr>
<th> Club </th>
<th> Team </th>
<th> Forenames </th>
<th> Surname </th>
<th> Nickname </th>
<th> Chinese Name </th>
<th> Email </th>
<th> Date of Birth </th>
<th> HKID Number </th>
<th> Shirt Number </th>
<th> Tel Number </th>
</tr>
{% for member in form %}
<tr>
<td>HKFC</td>
<td contenteditable="true">{{ member.playerTeam }}</td>
<td contenteditable="true">{{ member.playerForenames }}</td>
<td contenteditable="true">{{ member.playerSurname }}</td>
<td contenteditable="true">{{ member.playerNickname }}</td>
<td contenteditable="true">{{ member.playerChineseName }}</td>
<td contenteditable="true">{{ member.playerEmailAddress }}</td>
<td contenteditable="true">{{ member.playerDob }}</td>
<td contenteditable="true">{{ member.playerHkid }}</td>
<td contenteditable="true">{{ member.playerNumber }}</td>
<td contenteditable="true">{{ member.playerTelNumber }}</td>
</tr>
{% endfor %}
</table>
</div>
<p>
<button type="submit" class="btn btn-success">Submit</button>
</p>
</form>
</div>
</body>
</html>
@@ -1,35 +0,0 @@
{% extends "bootstrap/base.html" %}
{% block title %}
List Team Squad
{% endblock %}
{% block head %}
<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>
{% endblock %}
{% block body %}
<form method="post" action="/convenor/editSquadList">
<legend>List Team Squad</legend>
{{ form.hidden_tag() }}
<div style="width: 10%">
<p>
<label for="teamName">Team:</label>
<select class="form-control" name="teamName" required>
{% for item in data %}
<option value={{ item.team }}>{{ item.team }}</option>
{% endfor %}
</select>
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
<button type="submit" class="btn btn-success">Submit</button>
</p>
</div>
</form>
{% endblock %}
-26
View File
@@ -1,26 +0,0 @@
<doctype html>
<head>
<title>Fixture List 2019/20 season</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>
<body>
<p>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class=flashes>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</p>
<table class="table table-bordered">
{{ table }}
</table>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
-158
View File
@@ -1,158 +0,0 @@
<html>
<head>
<title>HKFC Men's Convenor - Player Add form *TESTING*</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 Convenor Add Player Record Form</h2>
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-warning alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
{{ message }}
</div>
{% endfor %}
{% endif %}
{% endwith %}
<body onload="myFunction()">
<dl>
<p>
{{ form.csrf_token }}
<div class="row">
<div class="col-xs-12">
<form class="col-sm-6" method="post" action="/convenor/playerAddResult" accept-charset="utf-8">
<legend>Add Player Form</legend>
<div class = "row">
<div class = "col-sm-4">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerClub.label }}</span>
{{ form.playerClub(class_="form-control") }}
</div>
</div>
<div class = "col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerTeam.label }}</span>
{{ form.playerTeam(class_="form-control") }}
</div>
</div>
<div class = "col-sm-3">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerNumber.label }}</span>
{{ form.playerNumber(class_="form-control") }}
</div>
</div>
</div>
<p/>
<div class = "row">
<div class = "col-sm-9">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerForenames.label }}</span>
{{ form.playerForenames(class_="form-control") }}
</div>
</div>
</div>
<div class = "row">
<div class="col-sm-9">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerSurnames.label }}</span>
{{ form.playerSurnames(class_="form-control") }}
</div>
</div>
</div>
<div class = "row">
<div class="col-sm-9">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerNickname.label }}</span>
{{ form.playerNickname(class_="form-control") }}
</div>
</div>
</div>
<div class = "row">
<div class="col-sm-9">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerChineseName.label }}</span>
{{ form.playerChineseName(class_="form-control") }}
</div>
</div>
</div>
<p/>
<div class = "row">
<div class = "col-sm-5">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerEmailAddress.label }}</span>
{{ form.playerEmailAddress(class_="form-control") }}
</div>
</div>
<div class = "col-sm-4">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerTelNumber.label }}</span>
{{ form.playerTelNumber(class_="form-control") }}
</div>
</div>
</div>
<div class = "row">
<div class = "col-sm-5">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerDob.label }}</span>
{{ form.playerDob(class_="form-control") }}
</div>
</div>
<div class = "col-sm-4">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerHkid.label }}</span>
{{ form.playerHkid(class_="form-control") }}
</div>
</div>
</div>
<br>
{{ form.submit(class_="btn btn-success") }}
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
</form>
<div class="col-sm-6">
<img src="{{ clubLogo }}" height="90" id="clubLogo"/>
</div>
</div>
</div>
</p>
</dl>
</body>
<script>
var club_select = document.getElementById("playerClub");
var club_logo = document.getElementById("clubLogo");
var team_select = document.getElementById("playerTeam");
club_select.onchange = function() {myFunction()};
function myFunction() {
club = club_select.value;
fetch('/hkfc-d/motmAdmin/' + club).then(function(response) {
response.json().then(function(data) {
var optionHTML = '';
for (var team of data) {
optionHTML += '<option value="' + team.team + '">' + team.team + '</option>';
}
team_select.innerHTML = optionHTML;
})
});
fetch('/hkfc-d/getLogo/' + club).then(function(response) {
response.json().then(function(data) {
var HTML = '';
for (var logo of data) {
HTML += logo.logoURL;
}
club_logo.src = HTML;
})
});
}
</script>
</html>
-18
View File
@@ -1,18 +0,0 @@
<html>
<head>
<title>*TESTING* Player Added to Database</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>Thanks for adding {{ firstname }} {{ surname }} to the {{ club }} database</h2>
<body>
{{ firstname }} {{ surname }} with shirt number {{ shirt }} has been added to the {{ club }} database for this season.
<p>
</p>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
</html>
-36
View File
@@ -1,36 +0,0 @@
{% extends "bootstrap/base.html" %}
{% block title %}
Add Team Table
{% endblock %}
{% block head %}
<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>
{% endblock %}
{% block body %}
<form method="post" action="/convenor/playerDbCreateResults">
<legend>Create Player Database for selected Club</legend>
{{ form.hidden_tag() }}
<div>
<p>
<label for="clubName">Club:</label>
<select class="form-control" name="clubName" required>
{% for item in data %}
<option value={{ item.club }}>{{ item.club }}</option>
{% endfor %}
</select>
</p>
<br>
{{ form.submit(class_="btn btn-success") }}
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
</div>
</form>
{% endblock %}
@@ -1,18 +0,0 @@
<html>
<head>
<title>*TESTING* CLub Player DB Creation Results</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>Adding {{ club }} player database for season starting {{ year }}</h2>
<body>
A player database for {{ club }} for the season starting {{ year }} should now exist.
<p>
</p>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
</html>
-159
View File
@@ -1,159 +0,0 @@
<html>
<head>
<title>HKFC Men's Convenor - Player Add form *TESTING*</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 Convenor Edit Player Record Form</h2>
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-warning alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
{{ message }}
</div>
{% endfor %}
{% endif %}
{% endwith %}
<body onload="myFunction()">
{{ data }}
<dl>
<p>
{{ form.csrf_token }}
<div class="row">
<div class="col-xs-12">
<form class="col-sm-6" method="post" action="/convenor/editPlayerResult" accept-charset="utf-8">
<legend>Edit Player Form</legend>
<div class = "row">
<div class = "col-sm-4">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerClub.label }}</span>
{{ form.playerClub(class_="form-control") }}
</div>
</div>
<div class = "col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerTeam.label }}</span>
{{ form.playerTeam(class_="form-control") }}
</div>
</div>
<div class = "col-sm-3">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerNumber.label }}</span>
{{ form.playerNumber(class_="form-control") }}
</div>
</div>
</div>
<p/>
<div class = "row">
<div class = "col-sm-9">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerForenames.label }}</span>
{{ form.playerForenames(class_="form-control") }}
</div>
</div>
</div>
<div class = "row">
<div class="col-sm-9">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerSurnames.label }}</span>
{{ form.playerSurnames(class_="form-control") }}
</div>
</div>
</div>
<div class = "row">
<div class="col-sm-9">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerNickname.label }}</span>
{{ form.playerNickname(class_="form-control") }}
</div>
</div>
</div>
<div class = "row">
<div class="col-sm-9">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerChineseName.label }}</span>
{{ form.playerChineseName(class_="form-control") }}
</div>
</div>
</div>
<p/>
<div class = "row">
<div class = "col-sm-5">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerEmailAddress.label }}</span>
{{ form.playerEmailAddress(class_="form-control") }}
</div>
</div>
<div class = "col-sm-4">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerTelNumber.label }}</span>
{{ form.playerTelNumber(class_="form-control") }}
</div>
</div>
</div>
<div class = "row">
<div class = "col-sm-5">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerDob.label }}</span>
{{ form.playerDob(class_="form-control") }}
</div>
</div>
<div class = "col-sm-4">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">{{ form.playerHkid.label }}</span>
{{ form.playerHkid(class_="form-control") }}
</div>
</div>
</div>
<br>
{{ form.submit(class_="btn btn-success") }}
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
</form>
<div class="col-sm-6">
<img src="{{ clubLogo }}" height="90" id="clubLogo"/>
</div>
</div>
</div>
</p>
</dl>
</body>
<script>
var club_select = document.getElementById("playerClub");
var club_logo = document.getElementById("clubLogo");
var team_select = document.getElementById("playerTeam");
club_select.onchange = function() {myFunction()};
function myFunction() {
club = club_select.value;
fetch('/hkfc-d/motmAdmin/' + club).then(function(response) {
response.json().then(function(data) {
var optionHTML = '';
for (var team of data) {
optionHTML += '<option value="' + team.team + '">' + team.team + '</option>';
}
team_select.innerHTML = optionHTML;
})
});
fetch('/hkfc-d/getLogo/' + club).then(function(response) {
response.json().then(function(data) {
var HTML = '';
for (var logo of data) {
HTML += logo.logoURL;
}
club_logo.src = HTML;
})
});
}
</script>
</html>
-35
View File
@@ -1,35 +0,0 @@
{% extends "bootstrap/base.html" %}
{% block title %}
List Team Squad
{% endblock %}
{% block head %}
<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>
{% endblock %}
{% block body %}
<form method="post" action="/convenor/squadListResults">
<legend>List Team Squad</legend>
{{ form.hidden_tag() }}
<div style="width: 10%">
<p>
<label for="teamName">Team:</label>
<select class="form-control" name="teamName" required>
{% for item in data %}
<option value={{ item.team }}>{{ item.team }}</option>
{% endfor %}
</select>
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
<button type="submit" class="btn btn-success">Submit</button>
</p>
</div>
</form>
{% endblock %}
-26
View File
@@ -1,26 +0,0 @@
<doctype html>
<head>
<title>List of players from HKFC {{ _team }} Team for 2017/18 season</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>
<body>
<p>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class=flashes>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</p>
<table class="table table-bordered">
{{ table }}
</table>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
-38
View File
@@ -1,38 +0,0 @@
{% extends "bootstrap/base.html" %}
{% block title %}
Add Team Table
{% endblock %}
{% block head %}
<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>
{% endblock %}
{% block body %}
<form method="post" action="/convenor/teamAddResult">
<legend>Add Team Form</legend>
{{ form.hidden_tag() }}
<div>
<p>
<label for="clubName">Club:</label>
<select class="form-control" name="clubName" required>
{% for item in data %}
<option value={{ item.club }}>{{ item.club }}</option>
{% endfor %}
</select>
</p>
{{ form.teamName.label }}<br>
{{ form.teamName(class_="form-control") }}
<br>
{{ form.submit(class_="btn btn-success") }}
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
</div>
</form>
{% endblock %}
-18
View File
@@ -1,18 +0,0 @@
<html>
<head>
<title>*TESTING* - Team Add Results</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>Thanks for adding {{ club }} {{ team }} to the club database</h2>
<body>
{{ club }} {{ team }} should now be added to the database.
<p>
</p>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
</html>
-1
View File
@@ -1 +0,0 @@
Bzzzzt. This is an error.
-173
View File
@@ -1,173 +0,0 @@
<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;
}
</style>
<head>
<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>
<body onload="myFunction()">
{{ form.csrf_token }}
<form action="/hkfc-d/goalsAssistsSubmit" method="post" accept-charset="utf-8">
<h1>Allocate goals and assists</h1>
<div class="row row-no-gutters">
<div class = "col-md-3 col-md-offset-1">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Fixture Date</span>
{{ form.match(class_="form-control") }}
</div>
</div>
<div class = "col-md-3">
<div class="input-group">
<span class="input-group-addon" id="basic-addon2">Home Team</span>
{{ form.homeTeam(class_="form-control") }}
</div>
</div>
</div>
<div class="row row-no-gutters">
<div class = "col-md-3 col-md-offset-4">
<div class="input-group">
<span class="input-group-addon" id="basic-addon3">Away Team</span>
{{ form.awayTeam(class_="form-control") }}
</div>
</div>
</div>
<div class="row row-no-gutters">
<div class = "col-md-1 col-md-offset-1">
<div class="input-group">
<span class="input-group-addon" id="basic-addon2">Number</span>
</div>
</div>
<div class = "col-md-2">
<div class="input-group">
<span class="input-group-addon" id="basic-addon2">Player</span>
</div>
</div>
<div class = "col-md-1">
<div class="input-group">
<span class="input-group-addon" id="basic-addon2">Assists</span>
</div>
</div>
<div class = "col-md-1">
<div class="input-group">
<span class="input-group-addon" id="basic-addon2">Goals</span>
</div>
</div>
</div>
</div>
<div id="data">
{% for item in data %}
<div class = "row row-no-gutters">
<div class = "col-md-1 col-md-offset-1" id="player-{{ loop.index }}">
{{ item.playerNumber }}
<input type="hidden" id="playerNumber" name="playerNumber" value="{{ item.playerNumber }}">
</div>
<div class = "col-md-2">
{{ item.playerNickname }}
<input type="hidden" id="playerName" name="playerName" value="{{ item.playerNickname }}">
</div>
<div class = "col-md-1">
{{ form.assists(class_="form-control") }}
</div>
<div class = "col-md-1">
{{ form.goals(class_="form-control") }}
</div>
</br>
</div>
{% endfor %}
</div>
<div class = "col-md-6 col-md-offset-1">
{{ form.submit(class_="btn btn-success") }}
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
</div>
</form>
<script>
var date_select = document.getElementById("match");
var homeTeam = document.getElementById("homeTeam");
var awayTeam = document.getElementById("awayTeam");
date_select.onchange = function() {myFunction()};
function myFunction() {
date = date_select.value;
fetch('/hkfc-d/statsAdmin/' + date).then(function(response) {
response.json().then(function(data) {
var HTML = '';
var HTML2 = '';
for (var team of data) {
HTML += team.homeTeam;
HTML2 += team.awayTeam;
}
homeTeam.value = HTML;
awayTeam.value = HTML2;
})
});
}
</script>
</body>
</html>
-14
View File
@@ -1,14 +0,0 @@
<html>
<head>
<title>HKFC Men's D Team - MotM and DotD admin *TESTING*</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>Thanks for activating the MotM and DotD votes</h2>
<a href="/dashboard">Back to the dashboard</a>
<body>
</body>
</html>
-18
View File
@@ -1,18 +0,0 @@
<html>
<head>
<title>HKFC Men's D Team - Goals and Assists</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>Thanks for submitting the goals and assists statistics</h2>
<body>
Smithers' army of Internet monkeys will now go about adding up the numbers ...
<p>
<img src="https://storage.googleapis.com/hk-hockey-data/images/monkey-typing-simpsons.jpg"></img>
</p>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
</html>
-35
View File
@@ -1,35 +0,0 @@
<html>
<head>
<title>HKFC Men's D Team - Match Comments *TESTING*</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 Match Comments</h3>
<h5>16th December 2018 - Aquila A</h5>
<h4><img src="{{ hkfcLogo }}" height="150"></img> <b>V</b> <img src="{{ oppoLogo }}" height="140"></img></h4>
<body>
This is an experimental option to add comments on the match - all submitted comments should appear here
<form method="post" action="/hkfc-d/comments" id="matchCommentForm">
<div>
<label for="matchComment">Match Comments (purely optional - 3000 character limit):</label>
<br/>
<textarea rows="4" cols="80" name="matchComment" form="matchCommentForm">Optional comments added here</textarea>
</div>
<button type="submit" class="btn btn-success">Submit</button>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</form>
<p><b>The wit and wisdom of the HKFC D team (in random order):</b>
<br/>
{% for item in comments %}
<i>{{ item.comment }}</i>
<br/>
<br/>
{% else %}
<i>No comments have been submitted yet.</i>
{% endfor %}
</p>
</body>
</html>
-200
View File
@@ -1,200 +0,0 @@
<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>
<body>
<form id="squadForm" action="/hkfc-d/matchSquadSubmit" 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>
</body>
</html>
-3
View File
@@ -1,3 +0,0 @@
The table for the HKFC D team has been deleted and recreated (empty)
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
-26
View File
@@ -1,26 +0,0 @@
<doctype html>
<head>
<title>List of players from HKFC {{ _team }} Team for 2017/18 season</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>
<body>
<p>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class=flashes>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</p>
<table class="table table-bordered">
{{ table }}
</table>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
-105
View File
@@ -1,105 +0,0 @@
<html>
<head>
<title>HKFC Men's D Team - MotM and DotD vote admin *TESTING*</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>
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-warning alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
{{ message }}
</div>
{% endfor %}
{% endif %}
{% endwith %}
<body onload="myFunction()">
<dl>
<p>
{{ form.csrf_token }}
<b>HKFC D Next Opponent:</b>
<br/>
<div class="row">
<div class="col-xs-12">
<form class="col-sm-6" method="post" action="/hkfc-d/motmAdmin">
<div class = "row">
<div class = "col-sm-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Date:</span>
{{ form.nextMatch(class_="form-control") }}
</div>
</div>
</div>
</br>
<div class = "row">
<div class = "col-sm-9">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Opposition</span>
{{ form.nextOppoTeam(class_="form-control") }}
</div>
</div>
</div>
<div class = "row">
<div class = "col-sm-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Current Man of the Match:</span>
{{ form.currMotM(class_="form-control") }}
</div>
</div>
<div class = "col-sm-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Current Dick of the Day:</span>
{{ form.currDotD(class_="form-control") }}
</div>
</div>
</div>
<p>
{{ form.saveButton(class_="btn btn-success") }}
{{ form.activateButton(class_="btn btn-primary") }}
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
</p>
</form>
<div class="col-sm-4">
<img src="{{ nextOppoLogo }}" height="90" id="nextOppoLogo"/>
</div>
</div>
</div>
</p>
</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('/hkfc-d/motmAdmin2/' + match).then(function(response) {
response.json().then(function(team) {
var optionHTML = '';
optionHTML += team;
team_select.value = optionHTML;
})
});
fetch('/hkfc-d/motmAdminLogo2/' + match).then(function(response) {
response.json().then(function(logo) {
var HTML = '';
HTML += logo;
club_logo.src = HTML;
})
});
}
</script>
</body>
</html>
-83
View File
@@ -1,83 +0,0 @@
<html>
<head>
<title>HKFC Men's D Team - MotM and DotD online vote *TESTING*</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>
<h5>{{ formatDate }}</h5>
<h4><img src="{{ hkfcLogo }}" height="150"></img> <b> </b> <img src="{{ oppoLogo }}" height="140"></img></h4>
<body>
<p><b>Randomly selected comment from the match:</b>
<br/>
{% for item in comment %}
<i>{{ item.comment }}</i>
{% endfor %}
</p>
<dl>
{{ form.csrf_token }}
<div class="row">
<div class="col-xs-12">
<form class="col-sm-6" method="post" action="/hkfc-d/vote-thanks" id="motmForm" accept-charset="utf-8">
<input type="hidden" id="matchNumber" name="matchNumber" value="{{ matchNumber }}">
<input type="hidden" id="oppo" name="oppo" value="{{ oppo }}">
<div class = "row">
<div class = "col-sm-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Man of the Match</span>
<select class="form-control" name="motmVote" required>
{% for item in data %}
{% if item.playerNickname != "" %}
<option value={{ item.playerNumber }}>{{ item.playerNickname }}</option>
{% else %}
<option value={{ item.playerNumber }}>{{ item.playerSurname }}, {{ item.playerForenames }}</option>
{% endif %}
{% endfor %}
</select>
</div>
</div>
<div class = "col-sm-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Dick of the Day</span>
<select class="form-control" name="dotdVote" required>
{% for item in data %}
{% if item.playerNickname != "" %}
<option value={{ item.playerNumber }}>{{ item.playerNickname }}</option>
{% else %}
<option value={{ item.playerNumber }}>{{ item.playerSurname }}, {{ item.playerForenames }}</option>
{% endif %}
{% endfor %}
</select>
</div>
</div>
</div>
<div class = "row">
<div class = "col-sm-6">
<div class = "input-group">
<span class = "input-group-addon" id = "basic-addon1">Match comments</span>
<textarea rows = "4" cols = "80" name = "motmComment" form = "motmForm">Optional comments added here</textarea>
</div>
</div>
</div>
<div class = "row">
<h3>Rogues Gallery</h3>
<div class = "col-sm-4">
<h4>Current Man of the Match</h4>
<img src="{{ motmURL }}" height="200"></img>
</div>
<div class = "col-sm-4">
<h4>Current Dick of the Day</h4>
<img src="{{ dotdURL }}" height="200"></img>
</div>
</div>
<button type="submit" class="btn btn-success">Submit</button>
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
</form>
</div>
</div>
</dl>
</body>
</html>
-18
View File
@@ -1,18 +0,0 @@
<html>
<head>
<title>HKFC Men's D Team - MotM and DotD vote *TESTING*</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>Player removed from matchday squad</h2>
<body>
Player number {{ number }} has been removed from the matchday squad.
<br/>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
<a class="btn btn-info" href="/hkfc-d/matchSquadList" role="button">Squad</a>
</body>
</html>
-56
View File
@@ -1,56 +0,0 @@
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="chart_div" style="width: 1600px; height: 1000px;"></div>
<script type="text/javascript">
google.charts.load('current', {
packages: ['corechart']
}).then(function () {
// create chart
var container = $('#chart_div').get(0);
var chart = new google.visualization.ColumnChart(container);
var options = {
legend: {
position: 'top'
}
};
// create data table
var data = new google.visualization.DataTable();
data.addColumn('string', 'Player');
data.addColumn('number', 'MotM');
data.addColumn('number', 'DotD');
// get data
$.ajax({
url: 'poty-results',
dataType: 'json'
}).done(function (jsonData) {
loadData(jsonData);
}).fail(function (jqXHR, textStatus, errorThrown) {
var jsonData = [{"motm_{{ _matchDate }}": 1, "playerName": "ERVINE Jonathan Desmond", "dotd_{{ _matchDate }}": 0}, {"motm_{{ _matchDate }}": 0, "playerName": "MCDONAGH Jerome Michael", "dotd_{{ _matchDate }}": 1}];
loadData(jsonData);
});
// load json data
function loadData(jsonData) {
$.each(jsonData, function(index, row) {
data.addRow([
row.playerName,
row.motmTotal,
row.dotdTotal
]);
});
drawChart();
}
// draw chart
$(window).resize(drawChart);
function drawChart() {
chart.draw(data, options);
}
});
</script>
-56
View File
@@ -1,56 +0,0 @@
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="chart_div" style="width: 800px; height: 1000px;"></div>
<script type="text/javascript">
google.charts.load('current', {
packages: ['corechart']
}).then(function () {
// create chart
var container = $('#chart_div').get(0);
var chart = new google.visualization.ColumnChart(container);
var options = {
legend: {
position: 'top'
}
};
// create data table
var data = new google.visualization.DataTable();
data.addColumn('string', 'Player');
data.addColumn('number', 'MotM');
data.addColumn('number', 'DotD');
// get data
$.ajax({
url: 'vote-results',
dataType: 'json'
}).done(function (jsonData) {
loadData(jsonData);
}).fail(function (jqXHR, textStatus, errorThrown) {
var jsonData = [{"motm_{{ _matchDate }}": 1, "playerName": "ERVINE Jonathan Desmond", "dotd_{{ _matchDate }}": 0}, {"motm_{{ _matchDate }}": 0, "playerName": "MCDONAGH Jerome Michael", "dotd_{{ _matchDate }}": 1}];
loadData(jsonData);
});
// load json data
function loadData(jsonData) {
$.each(jsonData, function(index, row) {
data.addRow([
row.playerName,
row.motm_{{ _matchDate }},
row.dotd_{{ _matchDate }}
]);
});
drawChart();
}
// draw chart
$(window).resize(drawChart);
function drawChart() {
chart.draw(data, options);
}
});
</script>
-19
View File
@@ -1,19 +0,0 @@
<html>
<head>
<title>HKFC Men's D Team - MotM and DotD vote *TESTING*</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>Thanks for submitting the MotM and DotD votes</h2>
<body>
Smithers' army of Internet monkeys will now go about adding up the votes ...
<p>
<img src="https://storage.googleapis.com/hk-hockey-data/images/monkey-typing-simpsons.jpg"></img>
</p>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
<a class="btn btn-info" href="/hkfc-d/comments" role="button">Comments</a>
</body>
</html>
-17
View File
@@ -1,17 +0,0 @@
<html>
<head>
<title>HKFC Convenor - Player Record Deletion</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>Player Deleted from database</h2>
<body>
Player number {{ number }} has been removed from the player database.
<br/>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
</html>
-34
View File
@@ -1,34 +0,0 @@
<doctype html>
<head>
<title>Match Details - Python Flask MySQL CRUD</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>
<body>
<p>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class=flashes>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</p>
<table class="table table-striped table-hover table-condensed">
{{ matchTable }}
</table>
<h3>Home Team</h3>
<table class="table table-striped table-hover table-condensed">
{{ homeTable }}
</table>
<h3>Away Team</h3>
<table class="table table-striped table-hover table-condensed">
{{ awayTable }}
</table>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
-70
View File
@@ -1,70 +0,0 @@
<html>
<head>
<title>Player Check *TESTING*</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>Search Parameters - select a club to search for players who have played for 2 or more teams</h2>
<body onload="myFunction()">
<dl>
<p>
{{ form.csrf_token }}
<div class="row">
<div class="col-xs-12">
<form class="col-sm-6" method="post" action="/playerCheckResults">
<div class = "row">
<div class = "col-sm-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Season data to search:</span>
{{ form.season(class_="form-control") }}
</div>
</div>
</div>
<div class = "row">
<div class = "col-sm-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Club:</span>
{{ form.clubName(class_="form-control") }}
</div>
</div>
</div>
<p>
{{ form.submitButton(class_="btn btn-success") }}
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
</p>
</form>
<div class="col-sm-0">
<img src="{{ selectedClubLogo }}" height="120" id="selectedClubLogo"/>
</div>
</div>
</div>
</p>
</dl>
<script>
var club_select = document.getElementById("clubName");
var club_logo = document.getElementById("selectedClubLogo");
club_select.onchange = function() {myFunction()};
function myFunction() {
club = club_select.value;
fetch('/hkfc-d/getLogo/' + club).then(function(response) {
response.json().then(function(data) {
var HTML = '';
for (var logo of data) {
HTML += logo.logoURL;
}
club_logo.src = HTML;
})
});
}
</script>
</body>
</html>
-41
View File
@@ -1,41 +0,0 @@
<ooctype html>
<head>
<title>List of player team appearances from 2018/19 season - Python Flask MySQL app</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>
<body>
<p>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class=flashes>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</p>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
{%- for column in columns %}
<th>{{ column['Field'] }}</th>
{%- endfor %}
</thead>
<tbody>
{%- for row in rows %}
<tr>
{%- for column in columns %}
<td>{{ row[column['Field']] }}</td>
{%- endfor %}
</tr>
{%- endfor %}
</tbody>
</table>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
-90
View File
@@ -1,90 +0,0 @@
<doctype html>
<head>
<title>List of players from 2018/19 season - Python Flask MySQL app</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>
<style>
tbody td {
border: 1px solid #ccc;
padding: 0px 0px;
}
th.rotate {
/* Something you can count on */
height: 120px;
white-space: nowrap;
}
th.rotate > div {
transform:
/* Magic Numbers */
translate(23px, 0px)
/* 45 is really 360 - 45 */
rotate(315deg);
width: 30px;
}
th.rotate > div > span {
border-bottom: 1px solid #ccc;
padding: 0px 0px;
}
</style>
<body>
<p>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class=flashes>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</p>
<table class="table table-striped table-hover table-condensed">
<thead>
{%- for column in columns %}
{% if column['Field'] == "playerNumber" %}
<th><div><span>Player Number</span></div></th>
{% elif column['Field'] == "playerName" %}
<th><div><span>Player Name</span></div></th>
{% elif column['Field'] == "appearances" %}
<th><div><span>Appearances</span></div></th>
{% elif column['Field'] == "goals" %}
<th><div><span>Goals</span></div></th>
{% elif column['Field'].startswith('22381goal') %}
<th class="rotate"><div><span>NBC A goals</span></div></th>
{% else %}
{%- for match in matchesList %}
{% if column['Field'].startswith(match) %}
{% if column['Field'].endswith('played') %}
<th class="rotate"><div><span>{{ matches[match] }} Played</span></div></th>
{% elif column['Field'].endswith('goals') %}
<th class="rotate"><div><span>{{ matches[match] }} Goals</span></div></th>
{% elif column['Field'].endswith('capt') %}
<th class="rotate"><div><span>{{ matches[match] }} Captain</span></div></th>
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{%- endfor %}
</thead>
<tbody>
{%- for row in rows %}
<tr>
{%- for column in columns %}
<td>{{ row[column['Field']] }}</td>
{%- endfor %}
</tr>
{%- endfor %}
</tbody>
</table>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
-87
View File
@@ -1,87 +0,0 @@
<html>
<head>
<title>Player Playing Record Results Search *TESTING*</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>Search Parameters - select both a club and team</h2>
<body onload="myFunction()">
<dl>
<p>
{{ form.csrf_token }}
<div class="row">
<div class="col-xs-12">
<form class="col-sm-6" method="post" action="/playerRecordSearch">
<div class = "row">
<div class = "col-sm-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Season data to search:</span>
{{ form.season(class_="form-control") }}
</div>
</div>
</div>
<div class = "row">
<div class = "col-sm-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Club:</span>
{{ form.clubName(class_="form-control") }}
</div>
</div>
<div class = "col-sm-4">
<div class="input-group">
<span class="input-group-addon" id="basic-addon2">Team:</span>
{{ form.teamName(class_="form-control") }}
</div>
</div>
</div>
<p>
{{ form.submitButton(class_="btn btn-success") }}
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
</p>
</form>
<div class="col-sm-0">
<img src="{{ selectedClubLogo }}" height="120" id="selectedClubLogo"/>
</div>
</div>
</div>
</p>
</dl>
<script>
var club_select = document.getElementById("clubName");
var club_logo = document.getElementById("selectedClubLogo");
var team_select = document.getElementById("teamName");
club_select.onchange = function() {myFunction()};
function myFunction() {
club = club_select.value;
fetch('/hkfc-d/motmAdmin/' + club).then(function(response) {
response.json().then(function(data) {
var optionHTML = '';
for (var team of data) {
optionHTML += '<option value="' + team.team + '">' + team.team + '</option>';
}
team_select.innerHTML = optionHTML;
})
});
fetch('/hkfc-d/getLogo/' + club).then(function(response) {
response.json().then(function(data) {
var HTML = '';
for (var logo of data) {
HTML += logo.logoURL;
}
club_logo.src = HTML;
})
});
}
</script>
</body>
</html>
-105
View File
@@ -1,105 +0,0 @@
<html>
<head>
<title>Deployment Selection *TESTING*</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>Select a namespace and a deployment</h2>
<body onload="myFunction()">
<dl>
<p>
{{ form.csrf_token }}
<div class="row">
<div class="col-xs-12">
<form class="col-sm-6" method="post" action="/get_namespace">
<div class = "row">
<div class = "col-sm-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Namespace:</span>
{{ form.season(class_="form-control") }}
</div>
</div>
</div>
<div class = "row">
<div class = "col-sm-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon2">Deployment:</span>
{{ form.clubName(class_="form-control") }}
</div>
</div>
<p>
{{ form.submitButton(class_="btn btn-success") }}
<a class="btn btn-danger" href="/" role="button">Cancel</a>
</p>
</form>
</div>
</div>
</p>
</dl>
<script>
var season_select = document.getElementById("season");
var season_start = document.getElementById("startDate");
var club_select = document.getElementById("clubName");
var club_logo = document.getElementById("selectedClubLogo");
var team_select = document.getElementById("teamName");
season_select.onchange = function() {seasonFunction()};
club_select.onchange = function() {myFunction()};
function myFunction() {
club = club_select.value;
fetch('/hkfc-d/motmAdmin/' + club).then(function(response) {
response.json().then(function(data) {
var optionHTML = '';
for (var team of data) {
optionHTML += '<option value="' + team.team + '">' + team.team + '</option>';
}
team_select.innerHTML = optionHTML;
})
});
fetch('/hkfc-d/getLogo/' + club).then(function(response) {
response.json().then(function(data) {
var HTML = '';
for (var logo of data) {
HTML += logo.logoURL;
}
club_logo.src = HTML;
})
});
}
function seasonFunction() {
season = season_select.value;
var startDate = '';
if (season == '2018') {
startDate = '2018-09-01'
} else if (season == '2017') {
startDate = '2017-01-09'
} else if (season == '2016') {
startDate = '2016-09-01'
} else if (season == '2015') {
startDate = '2015-09-01'
} else if (season == '2014') {
startDate = '2014-09-01'
} else if (season == '2013') {
startDate = '2013-09-01'
} else if (season == '2012') {
startDate = '2012-09-01'
} else if (season == '2011') {
startDate = '2011-09-01'
} else if (season == '2010') {
startDate = '2010-09-01'
}
season_start.value = startDate;
}
</script>
</body>
</html>
-26
View File
@@ -1,26 +0,0 @@
<doctype html>
<head>
<title>List of matches from 2018/19 season - Python Flask MySQL CRUD</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>
<body>
<p>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class=flashes>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</p>
<table class="table table-striped table-hover table-condensed">
{{ table }}
</table>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
-26
View File
@@ -1,26 +0,0 @@
<doctype html>
<head>
<title>Team Results from 2018/19 season - Python Flask MySQL app</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>
<body>
<p>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class=flashes>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</p>
<table class="table table-bordered table-striped table-hover table-condensed">
{{ table }}
</table>
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
</body>
-85
View File
@@ -1,85 +0,0 @@
<html>
<head>
<title>Team Results Record Search *TESTING*</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>Search Parameters - select both a club and team</h2>
<body onload="myFunction()">
<dl>
<p>
{{ form.csrf_token }}
<div class="row">
<div class="col-xs-12">
<form class="col-sm-6" method="post" action="/teamRecordSearch">
<div class = "row">
<div class = "col-sm-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Season data to search:</span>
{{ form.season(class_="form-control") }}
</div>
</div>
<div class = "col-sm-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Club:</span>
{{ form.clubName(class_="form-control") }}
</div>
</div>
<div class = "col-sm-4">
<div class="input-group">
<span class="input-group-addon" id="basic-addon2">Team:</span>
{{ form.teamName(class_="form-control") }}
</div>
</div>
</div>
<p>
{{ form.submitButton(class_="btn btn-success") }}
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
</p>
</form>
<div class="col-sm-0">
<img src="{{ selectedClubLogo }}" height="120" id="selectedClubLogo"/>
</div>
</div>
</div>
</p>
</dl>
<script>
var club_select = document.getElementById("clubName");
var club_logo = document.getElementById("selectedClubLogo");
var team_select = document.getElementById("teamName");
club_select.onchange = function() {myFunction()};
function myFunction() {
club = club_select.value;
fetch('/hkfc-d/motmAdmin/' + club).then(function(response) {
response.json().then(function(data) {
var optionHTML = '';
for (var team of data) {
optionHTML += '<option value="' + team.team + '">' + team.team + '</option>';
}
team_select.innerHTML = optionHTML;
})
});
fetch('/hkfc-d/getLogo/' + club).then(function(response) {
response.json().then(function(data) {
var HTML = '';
for (var logo of data) {
HTML += logo.logoURL;
}
club_logo.src = HTML;
})
});
}
</script>
</body>
</html>
-69
View File
@@ -1,69 +0,0 @@
{% extends "bootstrap/base.html" %}
{% block title %}
Dashboard
{% endblock %}
{% block head %}
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="/static/css/dashboard.css">
{% endblock %}
{% block body %}
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="dropdown">
<button class="dropbtn">Men's Hockey
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="/search">General Match Search</a>
<a href="/playerRecords">Player Record Search</a>
<a href="/teamRecords">Team Record Search</a>
<a href="/clubPlayingRecords">Club Player Playing Record</a>
<a href="/playerCheck">Played for multiple teams</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">HKFC D
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="/hkfc-d/matchSquad">HKFC D Match Day Squad Selection</a>
<a href="/hkfc-d/matchSquadList">HKFC D Match Day Squad List</a>
<a href="/hkfc-d/matchSquadReset">HKFC D Match Day Squad Reset</a>
<a href="/hkfc-d/motm">MotM and DotD Vote</a>
<a href="/hkfc-d/motmAdmin">MotM and DotD Vote Admin</a>
<a href="/hkfc-d/voting">MotM and DotD Vote Results</a>
<a href="/hkfc-d/comments">HKFC D Match Comments</a>
<a href="/hkfc-d/statAdmin">HKFC Match Stats Admin</a>
<a href="/hkfc-d/fixtureList">Fixture List</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Convenor Area
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="/convenor/clubList">List Clubs and Teams in Club Database</a>
<a href="/convenor/clubAdd">Add Club to Club Database</a>
<a href="/convenor/teamAdd">Add Team to HKFC Database</a>
<a href="/convenor/playerDbCreate">Create Club Player Database</a>
<a href="/convenor/playerAdd">Add Player to Club Database</a>
<a href="/convenor/squadList">Submitted Squad List</a>
<a href="/convenor/fixtureList">Fixture List</a>
<a href="/convenor/other">Other Stuff to be added</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">About
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="/about">About</a>
</div>
</div>
</div>
<h3>Dropdown Menu inside a Navigation Bar</h3>
<p>Hover over the "Dropdown" link to see the dropdown menu.</p>
{% endblock %}
@@ -1,68 +1,63 @@
<html>
<head>
<title>Club Player Playing Record Search *TESTING*</title>
<title>Select Namespace and Deployment *TESTING*</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>Search Parameters - select a club to search their playing record</h2>
<h2>Select both a namespace and deployment</h2>
<body onload="myFunction()">
<dl>
<p>
{{ form.csrf_token }}
<div class="row">
<div class="col-xs-12">
<form class="col-sm-6" method="post" action="/clubPlayingRecordSearch">
<form class="col-sm-6" method="post" action="/deploySelect">
<div class = "row">
<div class = "col-sm-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Season data to search:</span>
{{ form.season(class_="form-control") }}
<span class="input-group-addon" id="basic-addon1">Namespace:</span>
{{ form.namespace(class_="form-control") }}
</div>
</div>
</div>
<div class = "row">
<div class = "col-sm-6">
<div class = "col-sm-4">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Club:</span>
{{ form.clubName(class_="form-control") }}
<span class="input-group-addon" id="basic-addon2">Deployment:</span>
{{ form.deployment(class_="form-control") }}
</div>
</div>
</div>
<p>
{{ form.submitButton(class_="btn btn-success") }}
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
<a class="btn btn-danger" href="/" role="button">Cancel</a>
</p>
</form>
<div class="col-sm-0">
<img src="{{ selectedClubLogo }}" height="120" id="selectedClubLogo"/>
</div>
</div>
</div>
</p>
</dl>
<script>
var club_select = document.getElementById("clubName");
var club_logo = document.getElementById("selectedClubLogo");
var namespaceSelect = document.getElementById("namespace");
var deploymentSelect = document.getElementById("deployment");
club_select.onchange = function() {myFunction()};
namespaceSelect.onchange = function() {myFunction()};
function myFunction() {
club = club_select.value;
namespace = namespaceSelect.value;
fetch('/hkfc-d/getLogo/' + club).then(function(response) {
fetch('/nsLookup/' + namespace).then(function(response) {
response.json().then(function(data) {
var HTML = '';
for (var logo of data) {
HTML += logo.logoURL;
var optionHTML = '';
for (var deployment of data) {
optionHTML += '<option value="' + deployment.deployment + '">' + deployment.deployment + '</option>';
}
club_logo.src = HTML;
deploymentSelect.innerHTML = optionHTML;
})
});
}
</script>
-25
View File
@@ -1,25 +0,0 @@
<doctype html>
<head>
<title>List of matches - Python Flask MySQL CRUD</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>
<body>
<p>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class=flashes>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</p>
<table class="table table-bordered">
{{ table }}
</table>
</body>
-52
View File
@@ -1,52 +0,0 @@
<html>
<head>
<title>TESTING: Search Parameters - Python Flask Hockey Results Search App</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>Search Parameters</h2>
<body>
Please select your search parameters - search for both club and team
<form method="post" action="/search-results">
<dl>
<p>
<label for="inputClub">Club:</label>
<select class="form-control" name="inputClub" required>
{% for item in data %}
<option value={{ item.hockeyClub }}>{{ item.hockeyClub }}</option>
{% endfor %}
</select>
</p>
<p>
<label for="inputTeam">Team:</label>
<select class="form-control" name="inputTeam" required>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
<option value="E">E</option>
<option value="F">F</option>
<option value="G">G</option>
<option value="H">H</option>
</select>
</p>
<p>
<label for="startDate">Start Date:</label>
<p/>
<input type="date" name="startDate" data-date-format="DD-MM-YYYY"/>
<p/>
<label for="endDate">End Date:</label>
<p/>
<input type="date" name="endDate" data-date-format="DD-MM-YYYY"/>
</p>
</dl>
<p>
<button type="submit" class="btn btn-success">Submit</button>
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
</p>
</form>
</body>
</html>