Fix some UI bugs.

This commit is contained in:
Patrick Fairbank
2017-09-03 22:23:48 -07:00
parent bc63a99e2e
commit d91b530bef
4 changed files with 10 additions and 9 deletions

View File

@@ -106,8 +106,8 @@ var handleMatchTime = function(data) {
// Handles a websocket message to update the match score.
var handleRealtimeScore = function(data) {
$("#redScore").text(data.RedScoreFields.Score);
$("#blueScore").text(data.BlueScoreFields.Score);
$("#redScore").text(data.RedScore);
$("#blueScore").text(data.BlueScore);
};
$(function() {

View File

@@ -106,10 +106,11 @@ var handlePlaySound = function(sound) {
// Handles a websocket message to update the alliance selection screen.
var handleAllianceSelection = function(alliances) {
if (alliances) {
var numColumns = alliances[0].length + 1;
$.each(alliances, function(k, v) {
v.Index = k + 1;
});
$("#allianceSelection").html(allianceSelectionTemplate(alliances));
$("#allianceSelection").html(allianceSelectionTemplate({alliances: alliances, numColumns: numColumns}));
}
};

View File

@@ -140,11 +140,11 @@
<script id="allianceSelectionTemplate" type="text/x-handlebars-template">
<table id="allianceSelectionTable">
<tr>
<td colspan="4">
<td colspan="{{"{{numColumns}}"}}">
<img src="/static/img/alliance-selection-logo.png" alt="logo" />
</td>
</tr>
{{"{{#each this}}"}}
{{"{{#each alliances}}"}}
<tr>
<td class="alliance-cell">{{"{{Index}}"}}</td>
{{"{{#each this}}"}}

View File

@@ -60,8 +60,8 @@
<div class="row">
{{range $rule := .Rules}}
<a class="btn btn-sm {{if $rule.IsTechnical}}btn-danger{{else}}btn-warning{{end}} btn-referee btn-rule"
data-rule="{{$rule.Rule}}" data-is-technical="{{$rule.IsTechnical}}" onclick="setFoulRule(this);">
{{$rule.Rule}}{{if $rule.IsTechnical}}<sup>T</sup>{{end}}
data-rule="{{$rule.RuleNumber}}" data-is-technical="{{$rule.IsTechnical}}" onclick="setFoulRule(this);">
{{$rule.RuleNumber}}{{if $rule.IsTechnical}}<sup>T</sup>{{end}}
</a>
{{end}}
</div>
@@ -99,8 +99,8 @@
{{define "foul"}}
<tr class="row-{{.color}}">
<td>{{.foul.TeamId}}</td>
<td>{{.foul.Rule}}{{if .foul.IsTechnical}}<sup>T</sup>{{end}}</td>
<td><a class="btn btn-sm btn-danger" onclick="deleteFoul('{{.color}}', {{.foul.TeamId}}, '{{.foul.Rule}}',
<td>{{.foul.RuleNumber}}{{if .foul.IsTechnical}}<sup>T</sup>{{end}}</td>
<td><a class="btn btn-sm btn-danger" onclick="deleteFoul('{{.color}}', {{.foul.TeamId}}, '{{.foul.RuleNumber}}',
{{.foul.IsTechnical}}, {{.foul.TimeInMatchSec}});">Delete</a></td>
</tr>
{{end}}