9cb78c9c98
- Fix saveCourseToDB returning 0 on conflict by falling back to SELECT
- Fix inactive layouts showing 'Never played' when last_played exists
- Add .icon-btn.spinning to courses.css for refresh button feedback
- Remove duplicate .btn-primary from courses.css (use shared.css version)
- Tokenize rating tier colors into --rating-tier-{high,mid,low} CSS vars
- Convert var to const/let throughout courses.js
- Fix logger.error calls to use {err} object form (pino convention)
- Extract RATING_TIER_HIGH/MID constants in course-layouts.ejs scriptlet
- Remove dead href='#' View all link from courses.ejs (deferred)
- Pass total prop explicitly from course-table.ejs to course-cards.ejs
- Remove dead #search-results-info selector from mobile.css
- Remove redundant .replace(/"/g, '"') from data attributes in course-table.ejs
40 lines
1.8 KiB
Plaintext
40 lines
1.8 KiB
Plaintext
<% var body = `
|
|
<main class="page-courses">
|
|
<section class="action-card">
|
|
<div class="action-card-tabs" role="tablist">
|
|
<button class="action-tab is-active" role="tab" aria-selected="true" data-tab="find" id="tab-find">Find courses</button>
|
|
<button class="action-tab" role="tab" aria-selected="false" data-tab="tjing" id="tab-tjing">Import from Tjing</button>
|
|
</div>
|
|
<div class="action-card-body">
|
|
<div class="action-pane is-active" id="tab-pane-find" role="tabpanel" aria-labelledby="tab-find">
|
|
<input type="text" id="course-filter-input" placeholder="Find a course…" autocomplete="off">
|
|
<p class="action-hint">Filters the list below as you type.</p>
|
|
</div>
|
|
<div class="action-pane" id="tab-pane-tjing" role="tabpanel" aria-labelledby="tab-tjing" hidden>
|
|
<div class="tjing-search-row">
|
|
<input type="text" id="tjing-search-input" placeholder="Search Tjing courses…" autocomplete="off">
|
|
<button id="tjing-search-btn" class="btn-primary" onclick="searchTjing()">Search Tjing</button>
|
|
</div>
|
|
<p class="action-hint">Find and import Swedish courses from tjing.se.</p>
|
|
<div id="tjing-results"></div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<div class="results-bar">
|
|
<span class="results-count">Showing <strong id="visible-count">0</strong> of <strong id="total-count">0</strong> courses</span>
|
|
<%# "View all" link deferred — design spec includes it but functionality not yet implemented %>
|
|
</div>
|
|
|
|
<div id="course-table-region" hx-get="/partials/course-table" hx-trigger="load, refresh from:body" hx-swap="innerHTML"></div>
|
|
</main>
|
|
`; %>
|
|
|
|
<%- include('../partials/layout', {
|
|
title: 'PDGA Courses - Sweden',
|
|
activePage: 'courses',
|
|
cssFiles: ['courses.css'],
|
|
jsFiles: ['courses.js'],
|
|
body: body
|
|
}) %>
|