diff --git a/referee_display.go b/referee_display.go index 5c04031..8cc7f60 100644 --- a/referee_display.go +++ b/referee_display.go @@ -15,8 +15,17 @@ import ( "text/template" ) -var rules = []string{"G4", "G5", "G6", "G6-1", "G16", "G17", "G18", "G19", "G20", "G21", "G22", "G23", "G24", - "G26", "G30", "G31", "G33", "G34"} +type Rule struct { + Rule string + IsTechnical bool +} + +var rules = []Rule{{"G4", false}, {"G11", false}, {"G12", false}, {"G12-1", false}, {"G13", false}, + {"G14", false}, {"G15", false}, {"G16", false}, {"G17", false}, {"G18", false}, {"G19-1", false}, + {"G20", false}, {"G20", true}, {"G21", true}, {"G22", false}, {"G23", false}, {"G24", false}, + {"G26", false}, {"G26", true}, {"G27", true}, {"G33", false}, {"G34", false}, {"G36", false}, + {"G37", false}, {"G38", false}, {"G39", true}, {"G40", true}, {"G40-1", true}, {"G41", true}, + {"G42", false}, {"G43", false}, {"G44", false}, {"G45", false}} // Renders the referee interface for assigning fouls. func RefereeDisplayHandler(w http.ResponseWriter, r *http.Request) { @@ -71,7 +80,7 @@ func RefereeDisplayHandler(w http.ResponseWriter, r *http.Request) { BlueFouls []Foul RedCards map[string]string BlueCards map[string]string - Rules []string + Rules []Rule EntryEnabled bool }{eventSettings, matchType, match.DisplayName, red1, red2, red3, blue1, blue2, blue3, mainArena.redRealtimeScore.CurrentScore.Fouls, mainArena.blueRealtimeScore.CurrentScore.Fouls, diff --git a/static/css/referee_display.css b/static/css/referee_display.css index a484c0f..da363a8 100644 --- a/static/css/referee_display.css +++ b/static/css/referee_display.css @@ -22,6 +22,9 @@ h3, h4 { font-size: 25px; cursor: default; } +.btn-rule { + font-size: 21px; +} .btn-referee-wide { width: 254px; margin: 5px 5px; diff --git a/static/js/referee_display.js b/static/js/referee_display.js index 12f12ad..0af8f33 100644 --- a/static/js/referee_display.js +++ b/static/js/referee_display.js @@ -56,13 +56,14 @@ var clearFoul = function() { // Sends the foul to the server to add it to the list. var commitFoul = function() { websocket.send("addFoul", {Alliance: foulTeamButton.attr("data-alliance"), - TeamId: parseInt(foulTeamButton.attr("data-team")), Rule: foulRuleButton.attr("data-rule")}); + TeamId: parseInt(foulTeamButton.attr("data-team")), Rule: foulRuleButton.attr("data-rule"), + IsTechnical: foulRuleButton.attr("data-is-technical") == "true"}); }; // Removes the foul with the given parameters from the list. -var deleteFoul = function(alliance, team, rule, timeSec) { +var deleteFoul = function(alliance, team, rule, isTechnical, timeSec) { websocket.send("deleteFoul", {Alliance: alliance, TeamId: parseInt(team), Rule: rule, - TimeInMatchSec: timeSec}); + IsTechnical: isTechnical, TimeInMatchSec: timeSec}); }; // Cycles through no card, yellow card, and red card. diff --git a/templates/referee_display.html b/templates/referee_display.html index 87c8c38..81c1653 100644 --- a/templates/referee_display.html +++ b/templates/referee_display.html @@ -21,9 +21,9 @@ {{if .EntryEnabled}} -

{{.MatchType}} Match {{.MatchDisplayName}}

+

{{.MatchType}} Match {{.MatchDisplayName}}

Fouls

{{range $foul := .RedFouls}} @@ -44,40 +44,42 @@ @@ -97,9 +99,9 @@ {{define "foul"}} - + + {{.foul.IsTechnical}}, {{.foul.TimeInMatchSec}});">Delete {{end}} {{define "card"}}
{{.foul.TeamId}}{{.foul.Rule}}{{.foul.Rule}}{{if .foul.IsTechnical}}T{{end}} Delete