Files
cheesy-arena-lite/templates/edit_match_result.html
2020-04-14 19:38:14 -05:00

56 lines
1.9 KiB
HTML

{{/*
Copyright 2014 Team 254. All Rights Reserved.
Author: pat@patfairbank.com (Patrick Fairbank)
UI for manually editing the result for a match.
*/}}
{{define "title"}}Edit Match Results{{end}}
{{define "body"}}
<div class="row">
<div class="well">
<form class="form-horizontal" method="POST">
<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}}"}}">
<div class="form-group">
<label>Autonomous</label>
<input name="{{"{{alliance}}"}}AutoPoints" class="form-control"/>
</div>
<div class="form-group">
<label>Teleoperated</label>
<input name="{{"{{alliance}}"}}TeleopPoints" class="form-control"/>
</div>
<div class="form-group">
<label>Endgame</label>
<input name="{{"{{alliance}}"}}EndgamePoints" class="form-control"/>
</div>
</div>
</div>
{{end}}
{{define "script"}}
<script src="/static/js/match_review.js"></script>
<script>
var matchId = {{.Match.Id}};
var allianceResults = {};
allianceResults["red"] = {alliance: "red", team1: {{.Match.Red1}}, team2: {{.Match.Red2}},
team3: {{.Match.Red3}}, score: jQuery.parseJSON('{{.MatchResultJson.RedScoreJson}}')};
allianceResults["blue"] = {alliance: "blue", team1: {{.Match.Blue1}}, team2: {{.Match.Blue2}},
team3: {{.Match.Blue3}}, score: jQuery.parseJSON('{{.MatchResultJson.BlueScoreJson}}')};
renderResults("red");
renderResults("blue");
</script>
{{end}}