Files
pdga-rating/views/pages/courses.ejs
T
Samuel Enocsson eb77b1f32b feat: add Tjing course import
Search and import courses with layouts from Tjing's GraphQL API.
Total par is calculated from individual hole data. Courses are saved
with a tjing.se link as unique identifier to prevent duplicates.
2026-03-20 08:45:16 +01:00

50 lines
1.8 KiB
Plaintext

<% var body = `
<div class="card-section">
<h3>Find Courses</h3>
<div class="card-section-form">
<input
type="text"
class="input"
id="course-search"
name="q"
placeholder="Search courses by name or city..."
hx-get="/partials/course-table"
hx-trigger="input changed delay:300ms, search"
hx-target="#courses-table"
style="width: 340px;"
/>
<button class="btn" onclick="scrapeCourses()" id="scrape-courses-btn">
<i class="fas fa-sync-alt"></i> Scrape Courses
</button>
</div>
</div>
<div class="card-section">
<h3>Import from Tjing</h3>
<div class="card-section-form">
<input
type="text"
class="input"
id="tjing-search"
placeholder="Search Tjing by name or city..."
style="width: 340px;"
/>
<button class="btn" onclick="searchTjing()" id="tjing-search-btn">
<i class="fas fa-search"></i> Search
</button>
</div>
<div id="tjing-results"></div>
</div>
<div id="loading" class="loading" style="display: none;">Loading courses...</div>
<div id="courses-table" hx-get="/partials/course-table" hx-trigger="load"></div>
`; %>
<%- include('../partials/layout', {
title: 'PDGA Courses - Sweden',
heading: 'PDGA Courses - Sweden',
activePage: 'courses',
cssFiles: ['courses.css'],
jsFiles: ['courses.js'],
body: body
}) %>