Add Get started, a guided walk through what is left to set up after installing (cron, email, backups, billing, support, the team, starter content - each pack or picked item by item - and a first client), each step a short form of its own with Skip for now and ticked off from the settings themselves, shown to the first admin to sign in on a new install and as a Finish setting up card on the dashboard until done, skipped or dismissed, and in Admin > Get started any time; database 3.4.7 adds settings.config_getting_started (on for a new install, off for an updated one), config_getting_started_skipped and config_getting_started_opened_at; the starter content loaders take the items to load, the mail server check moves to settingsMailServerCheck() for Admin > Mail and the Email step, app.js only starts DataTables where it is loaded, and setup's finish step points at Get started

This commit is contained in:
johnnyq
2026-10-25 14:46:02 -04:00
parent 58e502ad38
commit 6d29583cef
6 changed files with 305 additions and 52 deletions

View File

@@ -8,6 +8,9 @@
* [data-gs-cron-poll=url] asks that address every 10 seconds whether cron
* has been heard from, and shows the step again
* once it has
* [data-gs-pack] a starter content pack's tick and its Pick which
* list kept in step - ticking the pack ticks every
* item, and its count says how many are ticked
* form sent once, the button pressed showing it is on
* its way
*/
@@ -64,6 +67,37 @@
setInterval(ask, 10000);
}
// A pack and the items under its Pick which
function initPack(pack) {
var check = pack.querySelector('[data-gs-pack-check]');
var items = Array.prototype.slice.call(pack.querySelectorAll('[data-gs-item]'));
var count = pack.querySelector('[data-gs-pack-count]');
if (!check || !items.length) {
return;
}
var of = items.length;
var more = count && count.dataset.gsMore === '1';
function draw() {
var ticked = items.filter(function (item) { return item.checked; }).length;
check.checked = ticked > 0;
check.indeterminate = ticked > 0 && ticked < of;
if (count) {
count.textContent = ticked === of ? of + (more ? ' more to add' : ' to add') : (ticked ? ticked + ' of ' + of + ' to add' : 'None picked');
}
}
function setAll(on) {
items.forEach(function (item) { item.checked = on; });
draw();
}
check.addEventListener('change', function () { setAll(check.checked); });
items.forEach(function (item) { item.addEventListener('change', draw); });
var all = pack.querySelector('[data-gs-pick-all]');
var none = pack.querySelector('[data-gs-pick-none]');
if (all) { all.addEventListener('click', function () { setAll(true); }); }
if (none) { none.addEventListener('click', function () { setAll(false); }); }
draw();
}
function initBusy(form) {
form.addEventListener('submit', function (e) {
if (e.defaultPrevented) {
@@ -87,6 +121,7 @@
document.querySelectorAll('[data-gs-reveal]').forEach(initReveal);
document.querySelectorAll('[data-gs-show]').forEach(initShow);
document.querySelectorAll('[data-gs-cron-poll]').forEach(initCronPoll);
document.querySelectorAll('[data-gs-pack]').forEach(initPack);
document.querySelectorAll('form').forEach(initBusy);
}