Default lessons to a week view on the booking page and in wp-admin
CI / Tests (PHP 8.2) (pull_request) Successful in 1m15s
CI / Tests (PHP 8.1) (pull_request) Successful in 1m16s
CI / No Debug Code (pull_request) Successful in 2s
CI / Coding Standards (pull_request) Successful in 3m15s
CI / PHPStan (pull_request) Successful in 3m14s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m37s
CI / Build Plugin Zip (pull_request) Skipped
CI / Tests (PHP 8.2) (pull_request) Successful in 1m15s
CI / Tests (PHP 8.1) (pull_request) Successful in 1m16s
CI / No Debug Code (pull_request) Successful in 2s
CI / Coding Standards (pull_request) Successful in 3m15s
CI / PHPStan (pull_request) Successful in 3m14s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m37s
CI / Build Plugin Zip (pull_request) Skipped
The front-end booking calendar now opens in the Week view (anchored to the week of the earliest open slot) with List still available. The Scheduler and My Lessons admin pages gain a week calendar (usc_view/usc_week, bucketed via a new generic WeekCalendar::bucket()) and open in it by default; the original table remains as the List view since it carries the HST / e-transfer forms. Closes #76 Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
@@ -76,9 +76,9 @@
|
||||
return [...groups.entries()].sort((a, b) => a[0].localeCompare(b[0]));
|
||||
}
|
||||
|
||||
// --- calendar view state (list is the default; week keeps its position) ---
|
||||
// --- calendar view state (week is the default; week keeps its position) ---
|
||||
let allSlots = [];
|
||||
let view = 'list';
|
||||
let view = 'week';
|
||||
let weekStart = null;
|
||||
|
||||
const pad = (n) => String(n).padStart(2, '0');
|
||||
@@ -156,6 +156,10 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// Anchor the week view to the week of the earliest open slot (the API
|
||||
// returns slots ordered by start), so the first look is never empty.
|
||||
if (view === 'week' && !weekStart) weekStart = weekStartOf(dayKey(allSlots[0].start_dt));
|
||||
|
||||
slotList.innerHTML = toggleHtml() + (view === 'week' ? weekHtml() : listHtml());
|
||||
wireCalendarEvents();
|
||||
}
|
||||
@@ -167,9 +171,6 @@
|
||||
});
|
||||
document.getElementById('us-view-week').addEventListener('click', () => {
|
||||
view = 'week';
|
||||
// Default to the week of the earliest open slot (the API returns
|
||||
// slots ordered by start), so the first look is never empty.
|
||||
if (!weekStart) weekStart = weekStartOf(dayKey(allSlots[0].start_dt));
|
||||
render();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user