7e5fa6cbf1
- Add HTMX CDN to layout - Replace client-side table rendering (displayRatings, displayCourses) with server-rendered EJS partials via hx-get - Add server-side course search with debounced hx-trigger - Lazy-load player history and course layouts via htmx.ajax() - Render rating chart via htmx:afterSwap with data attributes - Add partial routes: ratings-table, course-table, player-history, course-layouts
47 lines
2.0 KiB
Plaintext
47 lines
2.0 KiB
Plaintext
<div id="search-results-info" class="search-results-info">
|
|
<% if (typeof query !== 'undefined' && query) { %>
|
|
Showing <%= courses.length %> of <%= total %> courses
|
|
<% } else { %>
|
|
Showing all <%= courses.length %> courses
|
|
<% } %>
|
|
</div>
|
|
|
|
<% if (courses.length === 0) { %>
|
|
<p>No courses found. Click "Scrape Courses" to load Swedish courses from PDGA.</p>
|
|
<% } else { %>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Course Name</th>
|
|
<th class="mobile-hide">City</th>
|
|
<th class="mobile-hide">Last Updated</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% courses.forEach(function(course) {
|
|
var lastUpdated = new Date(course.last_updated).toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' });
|
|
%>
|
|
<tr id="row-<%= course.id %>" class="expandable-row" onclick="toggleCourseLayouts(<%= course.id %>)">
|
|
<td>
|
|
<a href="<%= course.link %>" target="_blank" onclick="event.stopPropagation()"><%= course.name %></a>
|
|
<div class="mobile-only" style="font-size: 11px; color: #999; margin-top: 2px;"><%= course.city %></div>
|
|
</td>
|
|
<td class="mobile-hide"><%= course.city %></td>
|
|
<td class="mobile-hide"><%= lastUpdated %></td>
|
|
<td>
|
|
<i class="fas fa-sync-alt refresh-icon" onclick="scrapeLayouts(<%= course.id %>, '<%= course.name.replace(/'/g, "\\'") %>'); event.stopPropagation();" title="Scrape layouts for this course"></i>
|
|
</td>
|
|
</tr>
|
|
<tr id="layouts-<%= course.id %>" class="expanded-content">
|
|
<td colspan="4">
|
|
<div class="layouts-container" id="layouts-container-<%= course.id %>">
|
|
<div class="no-layouts">Click to load layouts...</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<% }); %>
|
|
</tbody>
|
|
</table>
|
|
<% } %>
|