mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Fix some UI bugs.
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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}));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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}}"}}
|
||||
|
||||
@@ -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}}
|
||||
|
||||
Reference in New Issue
Block a user