Add screens for media, the audit log and statistics

This commit is contained in:
Matthijs Iriks committed 2026-12-04 04:06:39 +01:00
1 parent 0caa196908
commit 1c9ccadf4e
10 files changed
+478 -6

No files matched your search

+8 -1
View File
@@ -1,6 +1,8 @@
<script setup lang="ts">
import { boot, useForm } from '../api';
import { ref } from 'vue';
import Link from '../components/Link.vue';
import MediaPicker from '../components/MediaPicker.vue';
import { t } from '../i18n';
import { flash, navigate } from '../state';
@@ -12,6 +14,7 @@ const form = useForm({
cover_image: post?.cover_image ?? '', category: post?.category ?? '', tags: (post?.tags ?? []) as string[],
is_featured: post?.is_featured ?? false, is_published: post?.is_published ?? false, published_at: post?.published_at ?? '',
});
const picking = ref(false);
// Tags are typed as one comma separated line.
let tagLine = (post?.tags ?? []).join(', ');
@@ -64,7 +67,10 @@ async function submit(): Promise<void> {
<div class="grid gap-5 sm:grid-cols-2">
<div>
<label for="cover" class="m-label">{{ t('Cover image') }}</label>
<input id="cover" v-model="form.values.cover_image" maxlength="2048" class="m-input" />
<div class="flex gap-2">
<input id="cover" v-model="form.values.cover_image" maxlength="2048" class="m-input" />
<button v-if="boot.permissions.includes('media.view')" type="button" class="m-btn m-btn-secondary shrink-0" @click="picking = true">{{ t('Choose') }}</button>
</div>
</div>
<div>
<label for="tags" class="m-label">{{ t('Tags (comma separated)') }}</label>
@@ -82,4 +88,5 @@ 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>
<MediaPicker v-if="picking" @pick="(url) => { form.values.cover_image = url; picking = false; }" @close="picking = false" />
</template>