Files
cheesy-arena-lite/templates/edit_match_result.html
2015-08-17 22:58:29 -07:00

199 lines
8.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{/*
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" action="/match_review/{{.Match.Id}}/edit" 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}}"}}">
<legend>Autonomous</legend>
<div class="form-group">
<label class="col-lg-4 control-label">Robot Set</label>
<div class="col-lg-2"><input type="checkbox" class="input-sm" name="{{"{{alliance}}"}}AutoRobotSet"></div>
<label class="col-lg-4 control-label">Container Set</label>
<div class="col-lg-2"><input type="checkbox" class="input-sm" name="{{"{{alliance}}"}}AutoContainerSet"></div>
<label class="col-lg-4 control-label">Tote Set</label>
<div class="col-lg-2"><input type="checkbox" class="input-sm" name="{{"{{alliance}}"}}AutoToteSet"></div>
<label class="col-lg-4 control-label">Stacked Tote Set</label>
<div class="col-lg-2"><input type="checkbox" class="input-sm" name="{{"{{alliance}}"}}AutoStackedToteSet"></div>
</div>
<legend>Teleoperated</legend>
<div class="form-group">
<label class="col-lg-4 control-label">Co-op Set</label>
<div class="col-lg-2"><input type="checkbox" class="input-sm" name="{{"{{alliance}}"}}CoopertitionSet"></div>
<label class="col-lg-4 control-label">Co-op Stack</label>
<div class="col-lg-2"><input type="checkbox" class="input-sm" name="{{"{{alliance}}"}}CoopertitionStack"></div>
</div>
{{"{{#each score.Stacks}}"}}
<div class="well well-sm well-dark{{"{{../alliance}}"}}">
<b id="{{"{{../alliance}}"}}Stack{{"{{@index}}"}}Title">Stack</b>
<button type="button" class="close" onclick="deleteStack('{{"{{../alliance}}"}}', {{"{{@index}}"}});">×</button>
<br />
<div class="form-group">
<label class="col-lg-2 control-label"># Totes</label>
<div class="col-lg-2"><input type="text" class="form-control input-sm" name="{{"{{../alliance}}"}}Stack{{"{{@index}}"}}Totes"></div>
<label class="col-lg-2 control-label">Container</label>
<div class="col-lg-2"><input type="checkbox" class="input-sm" name="{{"{{../alliance}}"}}Stack{{"{{@index}}"}}Container"></div>
<label class="col-lg-2 control-label">Litter</label>
<div class="col-lg-2"><input type="checkbox" class="input-sm" name="{{"{{../alliance}}"}}Stack{{"{{@index}}"}}Litter"></div>
</div>
</div>
{{"{{/each}}"}}
<button type="button" class="btn btn-default btn-sm" onclick="addStack('{{"{{alliance}}"}}');">
Add Stack
</button>
<br /><br />
<legend>Fouls</legend>
{{"{{#each score.Fouls}}"}}
<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">
<input type="text" class="form-control input-sm" name="{{"{{../alliance}}"}}Foul{{"{{@index}}"}}Rule">
</div>
</div>
<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>
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team1}}"}}Card" value="" checked>
None
</label>
</div>
<div class="radio col-lg-3">
<label>
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team1}}"}}Card" value="yellow">
Yellow
</label>
</div>
<div class="radio col-lg-6">
<label>
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team1}}"}}Card" value="red">
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>
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team2}}"}}Card" value="" checked>
None
</label>
</div>
<div class="radio col-lg-3">
<label>
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team2}}"}}Card" value="yellow">
Yellow
</label>
</div>
<div class="radio col-lg-6">
<label>
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team2}}"}}Card" value="red">
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>
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team3}}"}}Card" value="" checked>
None
</label>
</div>
<div class="radio col-lg-3">
<label>
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team3}}"}}Card" value="yellow">
Yellow
</label>
</div>
<div class="radio col-lg-6">
<label>
<input type="radio" name="{{"{{alliance}}"}}Team{{"{{team3}}"}}Card" value="red">
Red
</label>
</div>
</div>
</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}}'),
cards: jQuery.parseJSON('{{.MatchResultJson.RedCardsJson}}')};
allianceResults["blue"] = {alliance: "blue", team1: {{.Match.Blue1}}, team2: {{.Match.Blue2}},
team3: {{.Match.Blue3}}, score: jQuery.parseJSON('{{.MatchResultJson.BlueScoreJson}}'),
cards: jQuery.parseJSON('{{.MatchResultJson.BlueCardsJson}}')};
renderResults("red");
renderResults("blue");
</script>
{{end}}