From 17d0bf926bbc2bbe8fe051c6f0f9a48d5cf68e36 Mon Sep 17 00:00:00 2001 From: Ruth Nuttall Date: Mon, 4 Nov 2024 17:05:24 -0800 Subject: [PATCH] Ruth/bug-fixes (#203) * fixes the ds in match play to not get cut off * add alliance selection buttons * button fun * added data to the fieldstatus funciton to make it work lol * fix alliance selection visual * fixed bug where the modal show was throwing errors * forgot to remove commented out old code --- static/css/cheesy-arena.css | 2 +- static/js/announcer_display.js | 7 +- static/js/field_monitor_display.js | 3 + templates/alliance_selection.html | 209 ++++++++++++++------------- templates/field_monitor_display.html | 135 +++++++++-------- 5 files changed, 188 insertions(+), 168 deletions(-) diff --git a/static/css/cheesy-arena.css b/static/css/cheesy-arena.css index bfd0efb1..210ebb20 100644 --- a/static/css/cheesy-arena.css +++ b/static/css/cheesy-arena.css @@ -61,7 +61,7 @@ border: 1px solid #999; border-radius: 4px; padding: 0px; - width: 50px; + width: 60px; height: 27px; line-height: 25px; font-size: 14px; diff --git a/static/js/announcer_display.js b/static/js/announcer_display.js index 2c2818fa..9d185fb7 100644 --- a/static/js/announcer_display.js +++ b/static/js/announcer_display.js @@ -58,12 +58,13 @@ var handleScorePosted = function(data) { return; } - const matchResult = $("#matchResult"); + const matchResult = document.getElementById("matchResult"); fetch("/displays/announcer/score_posted") .then(response => response.text()) .then(html => { - matchResult.html(html); - matchResult.modal("show"); + matchResult.innerHTML = html; + const modal = new bootstrap.Modal(matchResult); + modal.show(); // Activate tooltips above the foul listings. const tooltipTriggerList = document.querySelectorAll("[data-bs-toggle=tooltip]"); diff --git a/static/js/field_monitor_display.js b/static/js/field_monitor_display.js index 8e03ea8b..80fef6d3 100644 --- a/static/js/field_monitor_display.js +++ b/static/js/field_monitor_display.js @@ -80,6 +80,9 @@ var handleArenaStatus = function(data) { const wifiStatus = stationStatus.WifiStatus; teamRadioTextElement.text(wifiStatus.TeamId); + $("#accessPointStatus").attr("data-status", data.AccessPointStatus); + $("#switchStatus").attr("data-status", data.SwitchStatus); + if (stationStatus.DsConn) { // Format the driver station status box. var dsConn = stationStatus.DsConn; diff --git a/templates/alliance_selection.html b/templates/alliance_selection.html index 27d4abda..91a35a6f 100644 --- a/templates/alliance_selection.html +++ b/templates/alliance_selection.html @@ -1,127 +1,128 @@ {{/* - Copyright 2014 Team 254. All Rights Reserved. - Author: pat@patfairbank.com (Patrick Fairbank) +Copyright 2014 Team 254. All Rights Reserved. +Author: pat@patfairbank.com (Patrick Fairbank) - UI for controlling the alliance selection process. +UI for controlling the alliance selection process. */}} {{define "title"}}Alliance Selection{{end}} {{define "body"}}
{{if .ErrorMessage}} -
- - {{.ErrorMessage}} -
+
+ + {{.ErrorMessage}} +
{{end}} {{if len .Alliances | eq 0}} -
-
- Alliance Selection - -
-
- {{else}} -
+
+
Alliance Selection -
- -
-
- -
-
- -
+ +
+
+ {{else}} +
+ Alliance Selection +
+
-
-
- - - - - - - - {{if (index .Alliances 0).TeamIds | len | eq 4}} - - {{end}} - - - - {{range $i, $alliance := .Alliances}} - - - {{range $j, $allianceTeamId := $alliance.TeamIds}} - {{if eq $allianceTeamId 0}} - - {{else}} - - {{end}} - {{end}} - - {{end}} - -
Alliance #CaptainPick 1Pick 2Pick 3
{{add $i 1}} - - - -
- Hint: Press 'Enter' after entering each team number for easiest use. -
-
-
- Selection Timer -
-
- -
-
-

Timer is hidden on the audience overlay until the Start/Show button below is pressed.

-
- -
- -
-
-
-
- - -
-
-
-
+
+ +
+
+
-
+
+
+
- - + + + + + {{if (index .Alliances 0).TeamIds | len | eq 4}} + + {{end}} - {{range $team := .RankedTeams}} - {{if not $team.Picked}} - - - - + {{range $i, $alliance := .Alliances}} + + + {{range $j, $allianceTeamId := $alliance.TeamIds}} + {{if eq $allianceTeamId 0}} + + {{else}} + {{end}} + {{end}} + {{end}}
RankTeamAlliance #CaptainPick 1Pick 2Pick 3
{{$team.Rank}}{{$team.TeamId}}
{{add $i 1}} + + + +
-
+ Hint: Press 'Enter' after entering each team number for easiest use. +
+
+
+ Selection Timer +
+
+ +
+
+

Timer is hidden on the audience overlay until the Start/Show button below is pressed.

+
+ +
+ 45 Seconds( 1st Round Picks )
+ 90 Seconds( 2+ Round Picks )
+ 120 Seconds( Break Time + between Rounds )
+ +
+
+
+
+ + +
+
+
+ +
+
+ + + + + + + + + {{range $team := .RankedTeams}} + {{if not $team.Picked}} + + + + + {{end}} + {{end}} + +
RankTeam
{{$team.Rank}}{{$team.TeamId}}
+
{{end}}