Fix the landing notes editor, drop-to-upload pictures, retire Demoman

The box editor rendered inside the landing page's overlay canvas, which
is pointer-events: none so the page underneath stays clickable; the
panel inherited it and ignored every click and keystroke. It is now
teleported to <body>.

Image and video files dropped onto a canvas in edit mode are uploaded
and each becomes an unframed box at the drop point, sized to its aspect
ratio. The upload code moves to home3/upload.js, shared with the
editor's "Insert upload".

The hand-written Demoman shrine is unrouted (and its slug unreserved)
so it can be remade as a canvas page. /shrines lists only canvas pages
and keeps the admin-only create form behind a "+ New shrine" button.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-14 23:47:15 +01:00
co-authored by Claude Opus 5.5
parent bb5fd2bef9
commit 30e1fb31d8
10 changed files with 248 additions and 134 deletions
+5 -1
View File
@@ -1,6 +1,10 @@
<script setup>
/**
* Route `/shrines/demoman` — a wall of TF2 Demoman clips via <VideoTable>.
* STATUS: no route points here — removed so /shrines/demoman can be made
* again as a canvas page (views/canvas/CanvasPage.vue). The clips are still
* in public/img/demoman/.
*
* Was route `/shrines/demoman` — a wall of TF2 Demoman clips via <VideoTable>.
*/
import VideoTable from "@/components/util/VideoTable.vue";
import Link from "@/components/text/Link.vue";
+20 -15
View File
@@ -1,11 +1,12 @@
<script setup>
/**
* Route `/shrines` — index of the shrine pages. Demoman is a hand-written
* view; every other shrine is a canvas page (views/canvas/) whose address
* starts with "shrines/", listed from the pages query. Admins get a form to
* start a new one from the Shrine layout.
* Route `/shrines` — index of the shrine pages: every canvas page
* (views/canvas/) whose address starts with "shrines/", from the pages query.
* Admins — and only admins; the server refuses createPage to anyone else
* anyway — get a button that opens a form to start one from the Shrine
* layout.
*/
import { computed } from "vue";
import { computed, ref } from "vue";
import RouterTable from "@/components/util/RouterTable.vue";
import { useAuthStore } from "@/stores/auth";
import { usePagesStore } from "@/stores/pages";
@@ -17,14 +18,13 @@ auth.ensureLoaded();
pages.fetch();
const isAdmin = computed(() => auth.loggedIn && !!auth.user.admin);
const creating = ref(false);
const shrine_links = computed(() =>
[
{ name: "Demoman", link: "/shrines/demoman" },
...pages.pages
.filter((p) => p.slug.startsWith("shrines/"))
.map((p) => ({ name: p.adminOnly ? `${p.title} 🔒` : p.title, link: `/${p.slug}` })),
].sort((a, b) => a.name.localeCompare(b.name)),
pages.pages
.filter((p) => p.slug.startsWith("shrines/"))
.map((p) => ({ name: p.adminOnly ? `${p.title} 🔒` : p.title, link: `/${p.slug}` }))
.sort((a, b) => a.name.localeCompare(b.name)),
);
</script>
@@ -34,10 +34,15 @@ const shrine_links = computed(() =>
class="page-a4 bdr-1 flex flex-col relative overflow-scroll gap-1"
>
<RouterTable :linkArr="shrine_links" />
<section v-if="isAdmin" class="mt-4">
<h3>New shrine</h3>
<PageForm prefix="shrines/" starter="shrine" />
</section>
<p v-if="pages.loaded && !shrine_links.length" class="text-muted text-center">
No shrines yet.
</p>
<template v-if="isAdmin">
<button type="button" class="bdr-2 bg-surface mt-4 cursor-pointer" @click="creating = !creating">
{{ creating ? "Cancel" : "+ New shrine" }}
</button>
<PageForm v-if="creating" prefix="shrines/" starter="shrine" />
</template>
</div>
</main>
</template>