Added actor revision overviews to actor and user pages.

This commit is contained in:
2024-10-23 01:28:54 +02:00
parent d0cf9bf5d0
commit 05bd7b703d
21 changed files with 424 additions and 219 deletions

View File

@@ -345,7 +345,7 @@
>Edit scene</a>
<a
:href="`/scene/revisions/${scene.id}/${scene.slug}`"
:href="`/scene/revs/${scene.id}/${scene.slug}`"
target="_blank"
class="link"
>Revisions</a>

View File

@@ -24,7 +24,7 @@
<li>
<a
:href="`/scene/revisions/${scene.id}/${scene.slug}`"
:href="`/scene/revs/${scene.id}/${scene.slug}`"
class="link"
>Go to scene revisions</a>
</li>
@@ -320,7 +320,7 @@ function setDuration(unit, event) {
async function submit() {
try {
await post('/revisions', {
await post('/revisions/scenes', {
sceneId: scene.value.id,
edits: {
...edits.value,

View File

@@ -21,7 +21,7 @@ export async function onBeforeRender(pageContext) {
return {
pageContext: {
title: `Revisions for '${scene.title}'`,
title: `Revs for '${scene.title}'`,
pageProps: {
scene,
revisions,

View File

@@ -1 +1,19 @@
export default '/scene/revisions/@sceneId/*';
import { match } from 'path-to-regexp';
const path = '/scene/revs/:sceneId/:slug?';
const urlMatch = match(path, { decode: decodeURIComponent });
export default (pageContext) => {
const matched = urlMatch(pageContext.urlPathname);
if (matched) {
return {
routeParams: {
sceneId: matched.params.sceneId,
domain: 'scenes',
},
};
}
return false;
};