new file: appengine_config.py new file: dbWrite.py new file: forms.py new file: main.py new file: readSettings.py new file: requirements.txt new file: routes/__init__.py new file: routes/_convenor.py new file: routes/_hkfcD_motm.py new file: routes/_matches.py new file: routes/_search.py new file: routes/dashboard.py new file: static/css/bootstrap-theme.css new file: static/css/bootstrap-theme.css.map new file: static/css/bootstrap-theme.min.css new file: static/css/bootstrap-theme.min.css.map new file: static/css/bootstrap.css new file: static/css/bootstrap.css.map new file: static/css/bootstrap.min.css new file: static/css/bootstrap.min.css.map new file: static/css/dashboard.css new file: static/css/dashboard.css.orig new file: static/fonts/glyphicons-halflings-regular.eot new file: static/fonts/glyphicons-halflings-regular.svg new file: static/fonts/glyphicons-halflings-regular.ttf new file: static/fonts/glyphicons-halflings-regular.woff new file: static/fonts/glyphicons-halflings-regular.woff2 new file: static/js/bootstrap.js new file: static/js/bootstrap.min.js new file: static/js/dashboard.js new file: static/js/npm.js new file: tables.py new file: templates/_about.html new file: templates/_clubPlayingRecordResults.html new file: templates/_clubPlayingRecords.html new file: templates/_convenorClubAdd.html new file: templates/_convenorClubAddResults.html new file: templates/_convenorClubList.html new file: templates/_convenorEditPlayerResults.html new file: templates/_convenorEditSquadList.html new file: templates/_convenorEditSquadListTeamSelect.html new file: templates/_convenorFixtureList.html new file: templates/_convenorPlayerAdd.html new file: templates/_convenorPlayerAddResults.html new file: templates/_convenorPlayerDbCreate.html new file: templates/_convenorPlayerDbCreateResults.html new file: templates/_convenorPlayerEdit.html new file: templates/_convenorSquadList.html new file: templates/_convenorSquadListResults.html new file: templates/_convenorTeamAdd.html new file: templates/_convenorTeamAddResults.html new file: templates/_error.html new file: templates/_goalsAssistsAdmin.html new file: templates/_hkfcDAdminThanks.html new file: templates/_hkfcDGoalsThanks.html new file: templates/_hkfcDMatchComments.html new file: templates/_hkfcDMatchSquad.html new file: templates/_hkfcDMatchSquadReset.html new file: templates/_hkfcDMatchSquadSelected.html new file: templates/_hkfcDMotmAdmin.html new file: templates/_hkfcDMotmVote.html new file: templates/_hkfcDPlayerRemoved.html new file: templates/_hkfcDPotYChart.html new file: templates/_hkfcDVoteChart.html new file: templates/_hkfcDVoteThanks.html new file: templates/_hkfcPlayerDeleted.html new file: templates/_matchDetails.html new file: templates/_playerCheck.html new file: templates/_playerCheckResults.html new file: templates/_playerRecordResults.html new file: templates/_playerRecords.html new file: templates/_search.html new file: templates/_searchResults.html new file: templates/_teamRecordResults.html new file: templates/_teamRecords.html new file: templates/dashboard.html new file: templates/results.html new file: templates/search.html Initial commit
201 lines
4.9 KiB
HTML
201 lines
4.9 KiB
HTML
<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>
|