-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixes the ds in match play to not get cut off * add alliance selection buttons * button fun * added data to the fieldstatus funciton to make it work lol * fix alliance selection visual * fixed bug where the modal show was throwing errors * forgot to remove commented out old code
- Loading branch information
1 parent
302a77b
commit 17d0bf9
Showing
5 changed files
with
188 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,127 +1,128 @@ | ||
{{/* | ||
Copyright 2014 Team 254. All Rights Reserved. | ||
Author: [email protected] (Patrick Fairbank) | ||
Copyright 2014 Team 254. All Rights Reserved. | ||
Author: [email protected] (Patrick Fairbank) | ||
|
||
UI for controlling the alliance selection process. | ||
UI for controlling the alliance selection process. | ||
*/}} | ||
{{define "title"}}Alliance Selection{{end}} | ||
{{define "body"}} | ||
<div class="row"> | ||
{{if .ErrorMessage}} | ||
<div class="alert alert-dismissible alert-danger"> | ||
<button type="button" class="btn-close" data-bs-dismiss="alert"></button> | ||
{{.ErrorMessage}} | ||
</div> | ||
<div class="alert alert-dismissible alert-danger"> | ||
<button type="button" class="btn-close" data-bs-dismiss="alert"></button> | ||
{{.ErrorMessage}} | ||
</div> | ||
{{end}} | ||
{{if len .Alliances | eq 0}} | ||
<div class="col-lg-3"> | ||
<form action="/alliance_selection/start" method="POST"> | ||
<legend>Alliance Selection</legend> | ||
<button type="submit" class="btn btn-primary">Start Alliance Selection</button> | ||
</form> | ||
</div> | ||
{{else}} | ||
<div class="col-lg-3 "> | ||
<div class="col-lg-3"> | ||
<form action="/alliance_selection/start" method="POST"> | ||
<legend>Alliance Selection</legend> | ||
<div class="mb-2"> | ||
<button type="submit" class="btn btn-primary" form="alliancesForm">Update</button> | ||
</div> | ||
<div class="mb-2"> | ||
<button type="button" class="btn btn-warning" | ||
onclick="$('#confirmResetAllianceSelection').modal('show');"> | ||
Reset Alliance Selection | ||
</button> | ||
</div> | ||
<div> | ||
<button type="button" class="btn btn-danger" | ||
onclick="$('#confirmFinalizeAllianceSelection').modal('show');"> | ||
Finalize Alliance Selection | ||
</button> | ||
</div> | ||
<button type="submit" class="btn btn-primary">Start Alliance Selection</button> | ||
</form> | ||
</div> | ||
{{else}} | ||
<div class="col-lg-3 "> | ||
<legend>Alliance Selection</legend> | ||
<div class="mb-2"> | ||
<button type="submit" class="btn btn-primary" form="alliancesForm">Update</button> | ||
</div> | ||
<div class="col-lg-5"> | ||
<form id="alliancesForm" action="" method="POST"> | ||
<table class="table table-striped table-hover"> | ||
<thead> | ||
<tr> | ||
<th>Alliance #</th> | ||
<th>Captain</th> | ||
<th>Pick 1</th> | ||
<th>Pick 2</th> | ||
{{if (index .Alliances 0).TeamIds | len | eq 4}} | ||
<th>Pick 3</th> | ||
{{end}} | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{{range $i, $alliance := .Alliances}} | ||
<tr> | ||
<td class="col-lg-2">{{add $i 1}}</td> | ||
{{range $j, $allianceTeamId := $alliance.TeamIds}} | ||
{{if eq $allianceTeamId 0}} | ||
<td class="col-lg-2"> | ||
<input type="text" class="form-control input-sm" name="selection{{$i}}_{{$j}}" value="" | ||
{{if and (eq $i $.NextRow) (eq $j $.NextCol)}}autofocus{{end}} | ||
oninput="$(this).parent().addClass('has-warning');" /> | ||
</td> | ||
{{else}} | ||
<td class="col-lg-2"> | ||
<input type="text" class="form-control input-sm" name="selection{{$i}}_{{$j}}" | ||
value="{{$allianceTeamId}}" oninput="$(this).parent().addClass('has-warning');" /> | ||
</td> | ||
{{end}} | ||
{{end}} | ||
</tr> | ||
{{end}} | ||
</tbody> | ||
</table> | ||
Hint: Press 'Enter' after entering each team number for easiest use. | ||
<div class="card card-body bg-body-secondary mt-4"> | ||
<div class="row"> | ||
<div class="col-lg-8"> | ||
<legend>Selection Timer</legend> | ||
</div> | ||
<div class="col-lg-4 text-end"> | ||
<legend id="timer"></legend> | ||
</div> | ||
</div> | ||
<p>Timer is hidden on the audience overlay until the Start/Show button below is pressed.</p> | ||
<div class="row"> | ||
<label class="col-lg-5 control-label">Time limit in seconds<br />(0 = disabled)</label> | ||
<div class="col-lg-3"> | ||
<input type="text" class="form-control" name="timeLimitSec" value="{{.TimeLimitSec}}" | ||
onblur="setTimer(this);"> | ||
</div> | ||
</div> | ||
<div class="mt-3 row justify-content-center"> | ||
<div class="col-lg-8 text-center"> | ||
<button type="button" class="btn btn-success" onclick="startTimer();">Start/Show Timer</button> | ||
<button type="button" class="btn btn-secondary" onclick="stopTimer();">Stop/Hide Timer</button> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
<div class="mb-2"> | ||
<button type="button" class="btn btn-warning" onclick="$('#confirmResetAllianceSelection').modal('show');"> | ||
Reset Alliance Selection | ||
</button> | ||
</div> | ||
<div> | ||
<button type="button" class="btn btn-danger" onclick="$('#confirmFinalizeAllianceSelection').modal('show');"> | ||
Finalize Alliance Selection | ||
</button> | ||
</div> | ||
<div class="col-lg-2"> | ||
</div> | ||
<div class="col-lg-5"> | ||
<form id="alliancesForm" action="" method="POST"> | ||
<table class="table table-striped table-hover"> | ||
<thead> | ||
<tr> | ||
<th>Rank</th> | ||
<th>Team</th> | ||
<th>Alliance #</th> | ||
<th>Captain</th> | ||
<th>Pick 1</th> | ||
<th>Pick 2</th> | ||
{{if (index .Alliances 0).TeamIds | len | eq 4}} | ||
<th>Pick 3</th> | ||
{{end}} | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{{range $team := .RankedTeams}} | ||
{{if not $team.Picked}} | ||
<tr> | ||
<td>{{$team.Rank}}</td> | ||
<td>{{$team.TeamId}}</td> | ||
</tr> | ||
{{range $i, $alliance := .Alliances}} | ||
<tr> | ||
<td class="col-lg-2">{{add $i 1}}</td> | ||
{{range $j, $allianceTeamId := $alliance.TeamIds}} | ||
{{if eq $allianceTeamId 0}} | ||
<td class="col-lg-2"> | ||
<input type="text" class="form-control input-sm" name="selection{{$i}}_{{$j}}" value="" {{if and (eq $i | ||
$.NextRow) (eq $j $.NextCol)}}autofocus{{end}} oninput="$(this).parent().addClass('has-warning');" /> | ||
</td> | ||
{{else}} | ||
<td class="col-lg-2"> | ||
<input type="text" class="form-control input-sm" name="selection{{$i}}_{{$j}}" value="{{$allianceTeamId}}" | ||
oninput="$(this).parent().addClass('has-warning');" /> | ||
</td> | ||
{{end}} | ||
{{end}} | ||
</tr> | ||
{{end}} | ||
</tbody> | ||
</table> | ||
</div> | ||
Hint: Press 'Enter' after entering each team number for easiest use. | ||
<div class="card card-body bg-body-secondary mt-4"> | ||
<div class="row"> | ||
<div class="col-lg-8"> | ||
<legend>Selection Timer</legend> | ||
</div> | ||
<div class="col-lg-4 text-end"> | ||
<legend id="timer"></legend> | ||
</div> | ||
</div> | ||
<p>Timer is hidden on the audience overlay until the Start/Show button below is pressed.</p> | ||
<div class="row"> | ||
<label class="col-lg-5 control-label">Time limit in seconds<br />(0 = disabled)</label> | ||
<div class="col-lg-6"> | ||
<input type="radio" name="timeLimitSec" value="45" onclick="setTimer(this);"> 45 Seconds( 1st Round Picks ) </br> | ||
<input type="radio" name="timeLimitSec" value="90" onclick="setTimer(this);"> 90 Seconds( 2+ Round Picks ) </br> | ||
<input type="radio" name="timeLimitSec" value="120" onclick="setTimer(this);"> 120 Seconds( Break Time | ||
between Rounds ) </br> | ||
<input type="text" class="form-control" name="timeLimitSec" value="{{.TimeLimitSec}}" | ||
onblur="setTimer(this);"> | ||
</div> | ||
</div> | ||
<div class="mt-3 row justify-content-center"> | ||
<div class="col-lg-8 text-center"> | ||
<button type="button" class="btn btn-success" onclick="startTimer();">Start/Show Timer</button> | ||
<button type="button" class="btn btn-secondary" onclick="stopTimer();">Stop/Hide Timer</button> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
<div class="col-lg-2"> | ||
<table class="table table-striped table-hover"> | ||
<thead> | ||
<tr> | ||
<th>Rank</th> | ||
<th>Team</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{{range $team := .RankedTeams}} | ||
{{if not $team.Picked}} | ||
<tr> | ||
<td>{{$team.Rank}}</td> | ||
<td>{{$team.TeamId}}</td> | ||
</tr> | ||
{{end}} | ||
{{end}} | ||
</tbody> | ||
</table> | ||
</div> | ||
{{end}} | ||
</div> | ||
<div id="confirmResetAllianceSelection" class="modal" style="top: 20%;"> | ||
|
@@ -176,9 +177,9 @@ <h4 class="modal-title">Confirm</h4> | |
<script src="/static/js/match_timing.js"></script> | ||
<script src="/static/js/alliance_selection.js"></script> | ||
<script> | ||
$(function() { | ||
$(function () { | ||
var startTime = moment(new Date()).hour(13).minute(0).second(0); | ||
newDateTimePicker("startTimePicker", startTime.toDate()); | ||
}); | ||
</script> | ||
{{end}} | ||
{{end}} |
Oops, something went wrong.