client: show own pages as first tab

This commit is contained in:
Johann150 2023-02-24 20:28:19 +01:00
parent e4a7e9f9b0
commit 145a949480
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -2,15 +2,15 @@
<MkStickyContainer> <MkStickyContainer>
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="700"> <MkSpacer :content-max="700">
<div v-if="tab === 'featured'" class="rknalgpo"> <div v-if="tab === 'my'" class="rknalgpo my">
<MkPagination v-slot="{items}" :pagination="featuredPagesPagination"> <MkButton class="new" @click="create()"><i class="fas fa-plus"></i></MkButton>
<MkPagination v-slot="{items}" :pagination="myPagesPagination">
<MkPagePreview v-for="page in items" :key="page.id" class="ckltabjg" :page="page"/> <MkPagePreview v-for="page in items" :key="page.id" class="ckltabjg" :page="page"/>
</MkPagination> </MkPagination>
</div> </div>
<div v-else-if="tab === 'my'" class="rknalgpo my"> <div v-else-if="tab === 'featured'" class="rknalgpo">
<MkButton class="new" @click="create()"><i class="fas fa-plus"></i></MkButton> <MkPagination v-slot="{items}" :pagination="featuredPagesPagination">
<MkPagination v-slot="{items}" :pagination="myPagesPagination">
<MkPagePreview v-for="page in items" :key="page.id" class="ckltabjg" :page="page"/> <MkPagePreview v-for="page in items" :key="page.id" class="ckltabjg" :page="page"/>
</MkPagination> </MkPagination>
</div> </div>
@ -35,7 +35,7 @@ import { definePageMetadata } from '@/scripts/page-metadata';
const router = useRouter(); const router = useRouter();
let tab = $ref('featured'); let tab = $ref('my');
const featuredPagesPagination = { const featuredPagesPagination = {
endpoint: 'pages/featured' as const, endpoint: 'pages/featured' as const,
@ -61,13 +61,13 @@ const headerActions = $computed(() => [{
}]); }]);
const headerTabs = $computed(() => [{ const headerTabs = $computed(() => [{
key: 'featured',
title: i18n.ts._pages.featured,
icon: 'fas fa-fire-alt',
}, {
key: 'my', key: 'my',
title: i18n.ts._pages.my, title: i18n.ts._pages.my,
icon: 'fas fa-edit', icon: 'fas fa-edit',
}, {
key: 'featured',
title: i18n.ts._pages.featured,
icon: 'fas fa-fire-alt',
}, { }, {
key: 'liked', key: 'liked',
title: i18n.ts._pages.liked, title: i18n.ts._pages.liked,