mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 21:56:50 -04:00
116 lines
5.0 KiB
HTML
116 lines
5.0 KiB
HTML
{{define "title"}}Match Play{{end}}
|
|
{{define "body"}}
|
|
<div class="row">
|
|
<div class="col-lg-4">
|
|
<a href="/match_play/0/load"><b class="btn btn-info">Load Test Match</b></a><br /><br />
|
|
<ul class="nav nav-tabs" style="margin-bottom: 15px;">
|
|
<li{{if eq .CurrentMatchType "practice" }} class="active"{{end}}>
|
|
<a href="#practice" data-toggle="tab">Practice</a>
|
|
</li>
|
|
<li{{if eq .CurrentMatchType "qualification" }} class="active"{{end}}>
|
|
<a href="#qualification" data-toggle="tab">Qualification</a>
|
|
</li>
|
|
<li{{if eq .CurrentMatchType "elimination" }} class="active"{{end}}>
|
|
<a href="#elimination" data-toggle="tab">Elimination</a>
|
|
</li>
|
|
</ul>
|
|
<div class="tab-content">
|
|
{{range $type, $matches := .MatchesByType}}
|
|
<div class="tab-pane {{if eq $.CurrentMatchType $type }} active{{end}}" id="{{$type}}">
|
|
<table class="table table-striped table-hover ">
|
|
<thead>
|
|
<tr>
|
|
<th>Match</th>
|
|
<th>Time</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range $match := $matches}}
|
|
<tr class="{{$match.ColorClass}}">
|
|
<td>{{$match.DisplayName}}</td>
|
|
<td>{{$match.Time}}</td>
|
|
<td class="text-center" style="white-space: nowrap;">
|
|
<a href="/match_play/{{$match.Id}}/generate_fake_result">
|
|
<b class="btn btn-info btn-xs">Generate Fake Result</b>
|
|
</a>
|
|
<a href="/match_play/{{$match.Id}}/load">
|
|
<b class="btn btn-info btn-xs">Load</b>
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
<div class="col-lg-8 text-center">
|
|
<div class="row">
|
|
<div class="col-lg-6 well well-darkblue">
|
|
<div class="row form-group">
|
|
<div class="col-lg-4">Blue Teams</div>
|
|
<div class="col-lg-2" data-toggle="tooltip" title="Driver Station">DS</div>
|
|
<div class="col-lg-2" data-toggle="tooltip" title="Robot">R</div>
|
|
<div class="col-lg-2" data-toggle="tooltip" title="Battery">B</div>
|
|
<div class="col-lg-2" data-toggle="tooltip" title="Bypass/Disable">Byp</div>
|
|
</div>
|
|
{{template "matchPlayTeam" dict "team" .Match.Blue1 "color" "B" "position" 1 "data" .}}
|
|
{{template "matchPlayTeam" dict "team" .Match.Blue2 "color" "B" "position" 2 "data" .}}
|
|
{{template "matchPlayTeam" dict "team" .Match.Blue3 "color" "B" "position" 3 "data" .}}
|
|
</div>
|
|
<div class="col-lg-6 well well-darkred">
|
|
<div class="row form-group">
|
|
<div class="col-lg-4">Red Teams</div>
|
|
<div class="col-lg-2" data-toggle="tooltip" title="Driver Station">DS</div>
|
|
<div class="col-lg-2" data-toggle="tooltip" title="Robot">R</div>
|
|
<div class="col-lg-2" data-toggle="tooltip" title="Battery">B</div>
|
|
<div class="col-lg-2" data-toggle="tooltip" title="Bypass/Disable">Byp</div>
|
|
</div>
|
|
{{template "matchPlayTeam" dict "team" .Match.Red3 "color" "R" "position" 3 "data" .}}
|
|
{{template "matchPlayTeam" dict "team" .Match.Red2 "color" "R" "position" 2 "data" .}}
|
|
{{template "matchPlayTeam" dict "team" .Match.Red1 "color" "R" "position" 1 "data" .}}
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<button type="button" id="startMatch" class="btn btn-success btn-lg btn-match-play"
|
|
onclick="startMatch();" disabled>
|
|
Start Match
|
|
</button>
|
|
<button type="button" id="abortMatch" class="btn btn-primary btn-lg btn-match-play"
|
|
onclick="abortMatch();" disabled>
|
|
Abort Match
|
|
</button>
|
|
<button type="button" id="commitResults" class="btn btn-info btn-lg btn-match-play"
|
|
onclick="commitResults();" disabled>
|
|
Commit Results
|
|
</button>
|
|
<button type="button" id="discardResults" class="btn btn-danger btn-lg btn-match-play"
|
|
onclick="discardResults();" disabled>
|
|
Discard Results
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{define "script"}}
|
|
<script src="/static/js/match_play.js"></script>
|
|
{{end}}
|
|
{{define "matchPlayTeam"}}
|
|
<div class="row form-group" id="status{{.color}}{{.position}}">
|
|
<div class="col-lg-1">{{.position}} </div>
|
|
<div class="col-lg-3">
|
|
<input type="text" class="form-control input-sm" value="{{if ne 0 .team}}{{.team}}{{end}}"
|
|
onblur="substituteTeam($(this).val(), '{{.color}}{{.position}}');"
|
|
{{if not .data.AllowSubstitution}}disabled{{end}}>
|
|
</div>
|
|
<div class="col-lg-2 col-no-padding"><div class="ds-status"></div></div>
|
|
<div class="col-lg-2 col-no-padding"><div class="robot-status"></div></div>
|
|
<div class="col-lg-2 col-no-padding"><div class="battery-status"></div></div>
|
|
<div class="col-lg-2 col-no-padding">
|
|
<div class="bypass-status" onclick="toggleBypass('{{.color}}{{.position}}');"></div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|