Skip to content

Commit

Permalink
got team name to show on match summary yay
Browse files Browse the repository at this point in the history
  • Loading branch information
joypan1 committed Mar 19, 2024
1 parent 7581fba commit e04ba71
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pages/matchsummary.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<title>Match Summary</title>
<link rel="stylesheet" href="../css/teams.css"/>
<link rel="stylesheet" href="../css/matchsummary.css"/>
<script src="../js/dexie.js"></script>
</head>
<body>
<nav class="nav">
Expand Down Expand Up @@ -35,7 +36,7 @@ <h1> Match Summary (Concept Page) </h1>
<!-- CONCEPTUAL MATCH SUMMARY PAGE BELOW, DELETE LATER (NONFUNCTIONAL)-->
<p> note: this is really inefficient, needs to be redesigned </p><br>

<h2> Team: <h2 class="teamnameeditable" id="teamnameeditable">LongMetal</h2> </h2><br>
<h2> Team: <span class="teamnameeditable" id="teamnameeditable">NULL_TEAMNAME</span>, <span class="teamnumbereditable">NULL_TEAMNUMBER</span> </h2><br>

<p> Average Autonomous Accuracy: 89% </p>
<p> Average Speaker Accuracy: 93% </p>
Expand Down
19 changes: 17 additions & 2 deletions pages/matchsummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ const urlParams = new URLSearchParams(window.location.search);
const globalid = parseInt(urlParams.get('globalid'), 10);
//const thismatch = urlParams.get('match'); NOT NEEDED

document.addEventListener('DOMContentLoaded', function(){
document.getElementById("teamnameeditable").textContent = "hello world";
//document.getElementById("teamnameeditable").textContent = "hello world";

document.addEventListener('DOMContentLoaded', async () => {
try {
const team = await db.teams.where('globalid').equals(parseInt(globalid,10)).first();
if (team) {

document.getElementById("teamnameeditable").innerHTML = team.teamname;
document.getElementById("teamnumbereditable").innerHTML = team.teamnumber;
// FIX BROKEN TEAM NUMBER UPDATE ^^^

} else {
console.log(`Team with ID ${globalid} not found.`);
}
} catch (error) {
console.error("Error:", error);
}
});

0 comments on commit e04ba71

Please sign in to comment.