Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions app/static/js/pit-scouting/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,21 @@ 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');
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';
}
});
});
});
38 changes: 38 additions & 0 deletions app/templates/scouting/matches.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ <h1 class="text-3xl font-bold mb-2">Match List</h1>
<p class="text-gray-600">View all recorded matches and alliance performance data</p>
</div>

<!-- Search Bar Section -->
<div class="mb-6">
<div class="relative max-w-md">
<div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none">
<svg class="w-5 h-5 text-gray-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</div>
<input id="teamSearchInput" type="text" class="block w-full p-2.5 pl-10 text-gray-900 border border-gray-300 rounded-lg bg-white focus:ring-blue-500 focus:border-blue-500" placeholder="Search by team number...">
</div>
<p class="mt-2 text-sm text-gray-500">Enter a team number to filter matches</p>
</div>

<div class="flex flex-col gap-4 mb-8">
<!-- Live Team Schedule Section -->
<div class="bg-gray-50 p-4 rounded-lg mb-2">
Expand Down Expand Up @@ -200,4 +213,29 @@ <h5 class="font-medium mb-1">Algae</h5>
{% endfor %}
</div>
</div>

<!-- Add JavaScript for search functionality -->
<script>
document.addEventListener('DOMContentLoaded', function() {
const searchInput = document.getElementById('teamSearchInput');
const matchCards = document.querySelectorAll('.bg-white.shadow-lg.rounded-lg');

searchInput.addEventListener('input', function() {
const searchTerm = searchInput.value.trim();

matchCards.forEach(card => {
const teamNumbers = [
...Array.from(card.querySelectorAll('.bg-red-50.rounded-lg')),
...Array.from(card.querySelectorAll('.bg-blue-50.rounded-lg'))
].map(teamDiv => teamDiv.textContent.trim());

// Check if any team number contains the search term
const matchFound = teamNumbers.some(text => text.toLowerCase().includes(searchTerm.toLowerCase()));

// Show/hide the card based on search results
card.style.display = searchTerm === '' || matchFound ? 'block' : 'none';
});
});
});
</script>
{% endblock %}
13 changes: 13 additions & 0 deletions app/templates/scouting/pit-scouting.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ <h1 class="text-3xl font-bold text-gray-900">Pit Scouting Data</h1>
</div>
</div>

<!-- Search Bar Section -->
<div class="mb-6">
<div class="relative max-w-md">
<div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none">
<svg class="w-5 h-5 text-gray-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</div>
<input id="teamSearchInput" type="text" class="block w-full p-2.5 pl-10 text-gray-900 border border-gray-300 rounded-lg bg-white focus:ring-blue-500 focus:border-blue-500" placeholder="Search by team number...">
</div>
<p class="mt-2 text-sm text-gray-500">Enter a team number to filter pit scouting data</p>
</div>

<!-- Table Section -->
<div class="bg-white rounded-lg shadow-lg overflow-hidden">
<div class="overflow-x-auto">
Expand Down