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:
@@ -7,9 +7,12 @@ defineProps({
|
||||
title: { type: String, default: "Are you sure?" },
|
||||
message: { type: String, required: true },
|
||||
confirmLabel: { type: String, default: "Confirm" },
|
||||
// A second, milder choice beside the confirm button, e.g. "Add on top"
|
||||
// next to "Replace". Omitted, there are only Confirm and Cancel.
|
||||
secondaryLabel: { type: String, default: "" },
|
||||
});
|
||||
|
||||
const emit = defineEmits(["confirm", "cancel"]);
|
||||
const emit = defineEmits(["confirm", "secondary", "cancel"]);
|
||||
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
@@ -20,6 +23,11 @@ function confirm() {
|
||||
open.value = false;
|
||||
emit("confirm");
|
||||
}
|
||||
|
||||
function secondary() {
|
||||
open.value = false;
|
||||
emit("secondary");
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -29,6 +37,7 @@ function confirm() {
|
||||
<p>{{ message }}</p>
|
||||
<div class="actions">
|
||||
<button type="button" class="confirm-button" @click="confirm">{{ confirmLabel }}</button>
|
||||
<button v-if="secondaryLabel" type="button" @click="secondary">{{ secondaryLabel }}</button>
|
||||
<button type="button" class="cancel-button" @click="cancel">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user