Add a history of posts and pages with restore

This commit is contained in:
Matthijs Iriks committed 2026-12-04 05:29:34 +01:00
1 parent eb37a7c6fb
commit 6fdb02040b
20 files changed
+482 -8

No files matched your search

+3 -1
View File
@@ -2,12 +2,13 @@
import { api, boot, useForm } from '../api';
import FormFields, { type Field } from '../components/FormFields.vue';
import Link from '../components/Link.vue';
import RevisionsPanel from '../components/RevisionsPanel.vue';
import { t } from '../i18n';
import { flash, navigate } from '../state';
const props = defineProps<{
page: {
slug: string; title: string; meta_description: string; defined: boolean; fields: Field[];
id: number | null; slug: string; title: string; meta_description: string; defined: boolean; fields: Field[];
content: Record<string, any> | null; body: string | null; is_published: boolean | null;
};
}>();
@@ -65,4 +66,5 @@ async function remove(): Promise<void> {
<button v-if="!page.defined" type="button" class="m-btn m-btn-danger" @click="remove">{{ t('Delete') }}</button>
</div>
</form>
<RevisionsPanel v-if="page.id && boot.permissions.includes('revisions.view')" type="pages" :id="page.id" />
</template>
+2
View File
@@ -3,6 +3,7 @@ import { boot, useForm } from '../api';
import { ref } from 'vue';
import Link from '../components/Link.vue';
import MediaPicker from '../components/MediaPicker.vue';
import RevisionsPanel from '../components/RevisionsPanel.vue';
import { t } from '../i18n';
import { flash, navigate } from '../state';
@@ -88,5 +89,6 @@ async function submit(): Promise<void> {
</div>
<button type="submit" class="m-btn m-btn-primary" :disabled="form.busy">{{ form.busy ? t('Saving…') : t('Save') }}</button>
</form>
<RevisionsPanel v-if="post && boot.permissions.includes('revisions.view')" type="posts" :id="post.id" />
<MediaPicker v-if="picking" @pick="(url) => { form.values.cover_image = url; picking = false; }" @close="picking = false" />
</template>