From ec8640037f3723afc31cb8f6aee2b609fa3e73f6 Mon Sep 17 00:00:00 2001 From: Jerry Date: Fri, 4 Apr 2025 23:05:12 -0400 Subject: [PATCH 1/2] Testing --- app/static/js/pit-scouting/list.js | 15 ++++++++++ app/templates/scouting/matches.html | 38 ++++++++++++++++++++++++ app/templates/scouting/pit-scouting.html | 13 ++++++++ 3 files changed, 66 insertions(+) diff --git a/app/static/js/pit-scouting/list.js b/app/static/js/pit-scouting/list.js index f68ca46..ab4d632 100644 --- a/app/static/js/pit-scouting/list.js +++ b/app/static/js/pit-scouting/list.js @@ -147,4 +147,19 @@ document.addEventListener('DOMContentLoaded', function() { if (exportButton) { exportButton.addEventListener('click', exportToCSV); } + + const searchInput = document.getElementById('teamSearchInput'); + const tableRows = document.querySelectorAll('tbody tr'); + + searchInput.addEventListener('input', function() { + const searchTerm = searchInput.value.trim(); + + tableRows.forEach(row => { + const teamNumberCell = row.querySelector('td:first-child'); + const teamNumberText = teamNumberCell.textContent.trim(); + + // Show/hide the row based on whether the team number contains the search term + row.style.display = searchTerm === '' || teamNumberText.includes(searchTerm) ? '' : 'none'; + }); + }); }); \ No newline at end of file diff --git a/app/templates/scouting/matches.html b/app/templates/scouting/matches.html index 79d885d..d010c93 100644 --- a/app/templates/scouting/matches.html +++ b/app/templates/scouting/matches.html @@ -7,6 +7,19 @@

Match List

View all recorded matches and alliance performance data

+ +
+
+
+ + + +
+ +
+

Enter a team number to filter matches

+
+
@@ -200,4 +213,29 @@
Algae
{% endfor %}
+ + + {% endblock %} \ No newline at end of file diff --git a/app/templates/scouting/pit-scouting.html b/app/templates/scouting/pit-scouting.html index d6b2e50..75bab0d 100644 --- a/app/templates/scouting/pit-scouting.html +++ b/app/templates/scouting/pit-scouting.html @@ -64,6 +64,19 @@

Pit Scouting Data

+ +
+
+
+ + + +
+ +
+

Enter a team number to filter pit scouting data

+
+
From 7bcd31db6cc216e782dcd586fd771d84c8106257 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 5 Apr 2025 10:06:17 -0400 Subject: [PATCH 2/2] Update app/static/js/pit-scouting/list.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- app/static/js/pit-scouting/list.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/static/js/pit-scouting/list.js b/app/static/js/pit-scouting/list.js index ab4d632..1b8efe2 100644 --- a/app/static/js/pit-scouting/list.js +++ b/app/static/js/pit-scouting/list.js @@ -156,10 +156,12 @@ document.addEventListener('DOMContentLoaded', function() { tableRows.forEach(row => { const teamNumberCell = row.querySelector('td:first-child'); - const teamNumberText = teamNumberCell.textContent.trim(); - - // Show/hide the row based on whether the team number contains the search term - row.style.display = searchTerm === '' || teamNumberText.includes(searchTerm) ? '' : 'none'; + if (teamNumberCell) { + const teamNumberText = teamNumberCell.textContent.trim(); + + // Show/hide the row based on whether the team number contains the search term + row.style.display = searchTerm === '' || teamNumberText.includes(searchTerm) ? '' : 'none'; + } }); }); }); \ No newline at end of file