Skip to content

Commit

Permalink
Add scoring panel commit statuses to referee panel (closes #174).
Browse files Browse the repository at this point in the history
  • Loading branch information
patfair committed May 30, 2024
1 parent 8b665c7 commit df30be6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions static/css/referee_panel.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ h3 {
.team-card[data-old-yellow-card="true"] {
border: 0.3vw solid #ff0;
}
.scoring-status {
margin-top: 1vw;
padding: 0.5vw 1vw;
border-radius: 0.5vw;
background-color: #e66;
font-size: 1.5vw;
color: #000;
}
.scoring-status[data-ready=true] {
background-color: #0c6;
}
#fouls {
display: flex;
flex-direction: column;
Expand Down
4 changes: 4 additions & 0 deletions static/js/referee_panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ const handleScoringStatus = function(data) {
if (data.RefereeScoreReady) {
$("#commitButton").attr("data-enabled", false);
}
$("#redScoreStatus").text("Red Scoring " + data.NumRedScoringPanelsReady + "/" + data.NumRedScoringPanels);
$("#redScoreStatus").attr("data-ready", data.RedScoreReady);
$("#blueScoreStatus").text("Blue Scoring " + data.NumBlueScoringPanelsReady + "/" + data.NumBlueScoringPanels);
$("#blueScoreStatus").attr("data-ready", data.BlueScoreReady);
}

// Populates the red/yellow card button for a given team.
Expand Down
2 changes: 2 additions & 0 deletions templates/referee_panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ <h3>Red/Yellow Cards</h3>
{{template "teamCard" dict "alliance" "blue" "position" $i}}
{{end}}
</div>
<div class="scoring-status" id="redScoreStatus"></div>
<div class="scoring-status" id="blueScoreStatus"></div>
</div>
<div id="fouls">
<h3>Fouls</h3>
Expand Down

0 comments on commit df30be6

Please sign in to comment.