Skip to content

Commit

Permalink
Adds normal ref mode for referee panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Kython89 committed Jun 18, 2024
1 parent ed84e9f commit cf459e8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions static/css/referee_panel.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ h3 {
flex-direction: column;
align-items: center;
}
#cards[data-hr="false"] {
display: none;
}
.alliance-cards {
padding: 0.5vw 1vw;
display: flex;
Expand Down Expand Up @@ -175,6 +178,9 @@ h3 {
flex-direction: row;
justify-content: center;
}
#controlButtons[data-hr="false"] {
display: none;
}
.control-button {
width: 20vw;
height: 4vw;
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 @@ -128,6 +128,10 @@ const hashObject = function(object) {
}

$(function() {
// Read the configuration for this display from the URL query string.
var urlParams = new URLSearchParams(window.location.search);
$(".headRef-dependent").attr("data-hr", urlParams.get("hr"));

// Set up the websocket back to the server.
websocket = new CheesyWebsocket("/panels/referee/websocket", {
matchLoad: function(event) { handleMatchLoad(event.data); },
Expand Down
3 changes: 2 additions & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
<li class="nav-item dropdown">
<a href="#" class="nav-link" data-bs-toggle="dropdown" role="button">Panel</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="/panels/referee">Referee</a>
<a class="dropdown-item" href="/panels/referee">Head Referee</a>
<a class="dropdown-item" href="/panels/referee?hr=false">Referee</a>
<div class="dropdown-divider"></div>
<div class="dropdown-header">Scoring</div>
<a class="dropdown-item" href="/panels/scoring/red">Red</a>
Expand Down
4 changes: 2 additions & 2 deletions templates/referee_panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{define "body"}}
<div id="matchName"></div>
<div id="refereePanel">
<div id="cards">
<div id="cards" class="headRef-dependent">
<h3>Red/Yellow Cards</h3>
<div class="alliance-cards" id="redCards">
{{range $i := seq 3}}
Expand All @@ -35,7 +35,7 @@ <h3>Fouls</h3>
</div>
</div>
<p>Note: Team and rule assignment are optional.</p>
<div id="controlButtons">
<div id="controlButtons" class="headRef-dependent">
<div class="control-button" id="resetButton" onclick="signalReset();">Signal Reset</div>
<div class="control-button" id="commitButton" onclick="commitMatch();">Commit Match</div>
</div>
Expand Down

0 comments on commit cf459e8

Please sign in to comment.