Add saved layouts, and make /stp an ordinary canvas page
A layout is a named copy of one canvas page's boxes and background (models.Layout, layout.graphql), saved from the canvas's new Layouts button and loaded onto any page from there or from the admin Pages tab. Loading onto a page with boxes asks whether to replace them or add on top; a replace first saves the page as a "<page> before <layout>" layout so it can be undone. Copies, not links: editing a page never changes a layout or another page. The copying is server-side in one transaction, and everything is @admin since a layout keeps admin-only boxes. /stp loses its static route and becomes a Page with slug "stp", created once at start-up (ensureStpPage), so it can be renamed, hidden or deleted like a shrine. Its boxes were already keyed "stp". Home3.vue is kept as legacy; its starter is now "Old /stp grid" in pageStarters.js. ConfirmDialog gains an optional second button. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -3,7 +3,12 @@
|
||||
* (PageForm.vue). Each `boxes(title)` returns box inputs for
|
||||
* stores/boxes.js — without `page`, which the store adds. Everything is an
|
||||
* ordinary box afterwards: move it, edit it, delete it.
|
||||
*
|
||||
* These are built into the code; layouts saved from a page in the browser
|
||||
* live in stores/layouts.js and are loaded from the canvas's Layouts panel.
|
||||
*/
|
||||
import { defaultLayout } from "@/views/home3/defaultLayout";
|
||||
|
||||
const html = (title, body, geom, extra = {}) => ({ kind: "html", title, html: body, ...geom, ...extra });
|
||||
|
||||
function notes() {
|
||||
@@ -29,4 +34,7 @@ function notes() {
|
||||
export const STARTERS = [
|
||||
{ id: "blank", label: "Blank", boxes: () => [] },
|
||||
{ id: "notes", label: "Notes board (admin-only notes)", boxes: notes },
|
||||
// What /stp's "Import current layout" button used to add, from when /stp
|
||||
// was its own route.
|
||||
{ id: "stp-grid", label: "Old /stp grid", boxes: defaultLayout },
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user