2014-09-06 17:38:21 -07:00
|
|
|
|
{{/*
|
|
|
|
|
|
Copyright 2014 Team 254. All Rights Reserved.
|
|
|
|
|
|
Author: pat@patfairbank.com (Patrick Fairbank)
|
|
|
|
|
|
|
|
|
|
|
|
UI for manually editing the result for a match.
|
|
|
|
|
|
*/}}
|
2014-06-28 22:03:30 -07:00
|
|
|
|
{{define "title"}}Edit Match Results{{end}}
|
|
|
|
|
|
{{define "body"}}
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="well">
|
2015-08-19 22:35:04 -07:00
|
|
|
|
<form class="form-horizontal" method="POST">
|
2014-06-28 22:03:30 -07:00
|
|
|
|
<fieldset>
|
|
|
|
|
|
<legend>Edit Match {{.Match.DisplayName}} Results</legend>
|
|
|
|
|
|
<div class="col-lg-6" id="redScore"></div>
|
|
|
|
|
|
<div class="col-lg-6" id="blueScore"></div>
|
|
|
|
|
|
<div class="row form-group">
|
|
|
|
|
|
<div class="text-center col-lg-12">
|
|
|
|
|
|
<a href="/match_review"><button type="button" class="btn btn-default">Cancel</button></a>
|
|
|
|
|
|
<button type="submit" class="btn btn-info">Save</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</fieldset>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div id="scoreTemplate" style="display: none;">
|
|
|
|
|
|
<div class="well well-{{"{{alliance}}"}}">
|
|
|
|
|
|
<legend>Autonomous</legend>
|
|
|
|
|
|
<div class="form-group">
|
2018-05-22 21:35:14 -07:00
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-lg-6">
|
2018-05-19 13:37:07 -07:00
|
|
|
|
<label class="col-lg-8 control-label">Auto Runs</label>
|
|
|
|
|
|
<div class="col-lg-4">
|
|
|
|
|
|
<input type="text" class="form-control input-sm" name="{{"{{alliance}}"}}AutoRuns">
|
|
|
|
|
|
</div>
|
2016-08-07 20:18:53 -07:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2018-05-22 21:35:14 -07:00
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-lg-6">
|
2018-05-19 13:37:07 -07:00
|
|
|
|
<label class="col-lg-8 control-label">Ownership Points</label>
|
|
|
|
|
|
<div class="col-lg-4">
|
|
|
|
|
|
<input type="text" class="form-control input-sm" name="{{"{{alliance}}"}}AutoOwnershipPoints">
|
|
|
|
|
|
</div>
|
2016-08-07 20:18:53 -07:00
|
|
|
|
</div>
|
2018-05-22 21:35:14 -07:00
|
|
|
|
<div class="col-lg-6">
|
|
|
|
|
|
<label class="col-lg-9 control-label">Owned Switch at End</label>
|
|
|
|
|
|
<div class="col-lg-3">
|
2018-05-19 13:37:07 -07:00
|
|
|
|
<input type="checkbox" class="input-sm" name="{{"{{alliance}}"}}AutoEndSwitchOwnership">
|
|
|
|
|
|
</div>
|
2016-08-07 20:18:53 -07:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2014-06-28 22:03:30 -07:00
|
|
|
|
</div>
|
2015-08-17 22:58:29 -07:00
|
|
|
|
<legend>Teleoperated</legend>
|
2014-06-28 22:03:30 -07:00
|
|
|
|
<div class="form-group">
|
2018-05-22 21:35:14 -07:00
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-lg-6">
|
2018-05-19 13:37:07 -07:00
|
|
|
|
<label class="col-lg-8 control-label">Ownership Points</label>
|
|
|
|
|
|
<div class="col-lg-4">
|
|
|
|
|
|
<input type="text" class="form-control input-sm" name="{{"{{alliance}}"}}TeleopOwnershipPoints">
|
|
|
|
|
|
</div>
|
2016-08-07 20:18:53 -07:00
|
|
|
|
</div>
|
2018-05-22 21:35:14 -07:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-lg-6">
|
|
|
|
|
|
<label class="col-lg-8 control-label">Force Cubes</label>
|
2018-05-19 13:37:07 -07:00
|
|
|
|
<div class="col-lg-4">
|
2018-05-22 21:35:14 -07:00
|
|
|
|
<input type="text" class="form-control input-sm" name="{{"{{alliance}}"}}ForceCubes">
|
2018-05-19 13:37:07 -07:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2018-05-22 21:35:14 -07:00
|
|
|
|
<div class="col-lg-6">
|
|
|
|
|
|
<label class="col-lg-9 control-label">Force Played</label>
|
|
|
|
|
|
<div class="col-lg-3">
|
|
|
|
|
|
<input type="checkbox" class="input-sm" name="{{"{{alliance}}"}}ForcePlayed">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-lg-6">
|
|
|
|
|
|
<label class="col-lg-8 control-label">Levitate Cubes</label>
|
2018-05-19 13:37:07 -07:00
|
|
|
|
<div class="col-lg-4">
|
2018-05-22 21:35:14 -07:00
|
|
|
|
<input type="text" class="form-control input-sm" name="{{"{{alliance}}"}}LevitateCubes">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-lg-6">
|
|
|
|
|
|
<label class="col-lg-9 control-label">Levitate Played</label>
|
|
|
|
|
|
<div class="col-lg-3">
|
|
|
|
|
|
<input type="checkbox" class="input-sm" name="{{"{{alliance}}"}}LevitatePlayed">
|
2018-05-19 13:37:07 -07:00
|
|
|
|
</div>
|
2016-08-07 20:18:53 -07:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2018-05-22 21:35:14 -07:00
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-lg-6">
|
|
|
|
|
|
<label class="col-lg-8 control-label">Boost Cubes</label>
|
2018-05-19 13:37:07 -07:00
|
|
|
|
<div class="col-lg-4">
|
2018-05-22 21:35:14 -07:00
|
|
|
|
<input type="text" class="form-control input-sm" name="{{"{{alliance}}"}}BoostCubes">
|
2018-05-19 13:37:07 -07:00
|
|
|
|
</div>
|
2016-08-07 20:18:53 -07:00
|
|
|
|
</div>
|
2018-05-22 21:35:14 -07:00
|
|
|
|
<div class="col-lg-6">
|
|
|
|
|
|
<label class="col-lg-9 control-label">Boost Played</label>
|
|
|
|
|
|
<div class="col-lg-3">
|
|
|
|
|
|
<input type="checkbox" class="input-sm" name="{{"{{alliance}}"}}BoostPlayed">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-lg-6">
|
2018-05-19 13:37:07 -07:00
|
|
|
|
<label class="col-lg-8 control-label">Parks</label>
|
|
|
|
|
|
<div class="col-lg-4">
|
|
|
|
|
|
<input type="text" class="form-control input-sm" name="{{"{{alliance}}"}}Parks">
|
|
|
|
|
|
</div>
|
2014-06-28 22:03:30 -07:00
|
|
|
|
</div>
|
2018-05-22 21:35:14 -07:00
|
|
|
|
<div class="col-lg-6">
|
|
|
|
|
|
<label class="col-lg-8 control-label">Climbs</label>
|
|
|
|
|
|
<div class="col-lg-4">
|
|
|
|
|
|
<input type="text" class="form-control input-sm" name="{{"{{alliance}}"}}Climbs">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2014-06-28 22:03:30 -07:00
|
|
|
|
</div>
|
2016-08-07 20:18:53 -07:00
|
|
|
|
</div>
|
2014-06-28 22:03:30 -07:00
|
|
|
|
<br /><br />
|
|
|
|
|
|
<legend>Fouls</legend>
|
2015-08-17 22:58:29 -07:00
|
|
|
|
{{"{{#each score.Fouls}}"}}
|
2014-06-28 22:03:30 -07:00
|
|
|
|
<div class="well well-sm well-dark{{"{{../alliance}}"}}">
|
|
|
|
|
|
<button type="button" class="close" onclick="deleteFoul('{{"{{../alliance}}"}}', {{"{{@index}}"}});">×</button>
|
|
|
|
|
|
<br />
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
<label class="col-lg-4 control-label">Team</label>
|
|
|
|
|
|
<div class="col-lg-8">
|
|
|
|
|
|
<div class="radio col-lg-3">
|
|
|
|
|
|
<label>
|
|
|
|
|
|
<input type="radio" name="{{"{{../alliance}}"}}Foul{{"{{@index}}"}}Team" value="{{"{{../team1}}"}}">
|
|
|
|
|
|
{{"{{../team1}}"}}
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="radio col-lg-3">
|
|
|
|
|
|
<label>
|
|
|
|
|
|
<input type="radio" name="{{"{{../alliance}}"}}Foul{{"{{@index}}"}}Team" value="{{"{{../team2}}"}}">
|
|
|
|
|
|
{{"{{../team2}}"}}
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="radio col-lg-3">
|
|
|
|
|
|
<label>
|
|
|
|
|
|
<input type="radio" name="{{"{{../alliance}}"}}Foul{{"{{@index}}"}}Team" value="{{"{{../team3}}"}}">
|
|
|
|
|
|
{{"{{../team3}}"}}
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
<label class="col-lg-4 control-label">Rule Violated</label>
|
|
|
|
|
|
<div class="col-lg-3">
|
2017-08-05 20:48:17 -07:00
|
|
|
|
<input type="text" class="form-control input-sm" name="{{"{{../alliance}}"}}Foul{{"{{@index}}"}}RuleNumber">
|
2014-06-28 22:03:30 -07:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2016-08-07 20:18:53 -07:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
<label class="col-lg-4 control-label">Is Technical</label>
|
|
|
|
|
|
<div class="col-lg-3">
|
|
|
|
|
|
<input type="checkbox" class="input-sm" name="{{"{{../alliance}}"}}Foul{{"{{@index}}"}}IsTechnical">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2014-06-28 22:03:30 -07:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
<label class="col-lg-4 control-label">Seconds Into Match</label>
|
|
|
|
|
|
<div class="col-lg-3">
|
|
|
|
|
|
<input type="text" class="form-control input-sm" name="{{"{{../alliance}}"}}Foul{{"{{@index}}"}}Time">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{{"{{/each}}"}}
|
|
|
|
|
|
<button type="button" class="btn btn-default btn-sm" onclick="addFoul('{{"{{alliance}}"}}');">
|
|
|
|
|
|
Add Foul
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<br /><br />
|
|
|
|
|
|
<legend>Cards</legend>
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
<label class="col-lg-4 control-label">Team {{"{{team1}}"}}</label>
|
|
|
|
|
|
<div class="col-lg-8">
|
|
|
|
|
|
<div class="radio col-lg-3">
|
|
|
|
|
|
<label>
|
2014-08-20 03:07:34 -07:00
|
|
|
|
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team1}}"}}Card" value="" checked>
|
2014-06-28 22:03:30 -07:00
|
|
|
|
None
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="radio col-lg-3">
|
|
|
|
|
|
<label>
|
2014-08-20 03:07:34 -07:00
|
|
|
|
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team1}}"}}Card" value="yellow">
|
2014-06-28 22:03:30 -07:00
|
|
|
|
Yellow
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="radio col-lg-6">
|
|
|
|
|
|
<label>
|
2014-08-20 03:07:34 -07:00
|
|
|
|
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team1}}"}}Card" value="red">
|
2014-06-28 22:03:30 -07:00
|
|
|
|
Red
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
<label class="col-lg-4 control-label">Team {{"{{team2}}"}}</label>
|
|
|
|
|
|
<div class="col-lg-8">
|
|
|
|
|
|
<div class="radio col-lg-3">
|
|
|
|
|
|
<label>
|
2014-08-20 03:07:34 -07:00
|
|
|
|
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team2}}"}}Card" value="" checked>
|
2014-06-28 22:03:30 -07:00
|
|
|
|
None
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="radio col-lg-3">
|
|
|
|
|
|
<label>
|
2014-08-20 03:07:34 -07:00
|
|
|
|
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team2}}"}}Card" value="yellow">
|
2014-06-28 22:03:30 -07:00
|
|
|
|
Yellow
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="radio col-lg-6">
|
|
|
|
|
|
<label>
|
2014-08-20 03:07:34 -07:00
|
|
|
|
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team2}}"}}Card" value="red">
|
2014-06-28 22:03:30 -07:00
|
|
|
|
Red
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
<label class="col-lg-4 control-label">Team {{"{{team3}}"}}</label>
|
|
|
|
|
|
<div class="col-lg-8">
|
|
|
|
|
|
<div class="radio col-lg-3">
|
|
|
|
|
|
<label>
|
2014-08-20 03:07:34 -07:00
|
|
|
|
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team3}}"}}Card" value="" checked>
|
2014-06-28 22:03:30 -07:00
|
|
|
|
None
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="radio col-lg-3">
|
|
|
|
|
|
<label>
|
2014-08-20 03:07:34 -07:00
|
|
|
|
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team3}}"}}Card" value="yellow">
|
2014-06-28 22:03:30 -07:00
|
|
|
|
Yellow
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="radio col-lg-6">
|
|
|
|
|
|
<label>
|
2014-08-20 03:07:34 -07:00
|
|
|
|
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team3}}"}}Card" value="red">
|
2014-06-28 22:03:30 -07:00
|
|
|
|
Red
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{{end}}
|
|
|
|
|
|
{{define "script"}}
|
|
|
|
|
|
<script src="/static/js/match_review.js"></script>
|
|
|
|
|
|
<script>
|
2018-09-03 12:51:52 -07:00
|
|
|
|
var matchId = {{.Match.Id}};
|
2014-06-28 22:03:30 -07:00
|
|
|
|
var allianceResults = {};
|
|
|
|
|
|
allianceResults["red"] = {alliance: "red", team1: {{.Match.Red1}}, team2: {{.Match.Red2}},
|
|
|
|
|
|
team3: {{.Match.Red3}}, score: jQuery.parseJSON('{{.MatchResultJson.RedScoreJson}}'),
|
2014-08-20 03:07:34 -07:00
|
|
|
|
cards: jQuery.parseJSON('{{.MatchResultJson.RedCardsJson}}')};
|
2014-06-28 22:03:30 -07:00
|
|
|
|
allianceResults["blue"] = {alliance: "blue", team1: {{.Match.Blue1}}, team2: {{.Match.Blue2}},
|
|
|
|
|
|
team3: {{.Match.Blue3}}, score: jQuery.parseJSON('{{.MatchResultJson.BlueScoreJson}}'),
|
2014-08-20 03:07:34 -07:00
|
|
|
|
cards: jQuery.parseJSON('{{.MatchResultJson.BlueCardsJson}}')};
|
2014-06-28 22:03:30 -07:00
|
|
|
|
renderResults("red");
|
|
|
|
|
|
renderResults("blue");
|
|
|
|
|
|
</script>
|
|
|
|
|
|
{{end}}
|