2020-01-29 20:37:25 +01:00
|
|
|
<template>
|
2021-12-02 12:09:12 +01:00
|
|
|
<MkSpacer :content-max="700">
|
|
|
|
<div v-if="tab === 'featured'" class="rknalgpo">
|
|
|
|
<MkPagination v-slot="{items}" :pagination="featuredPagesPagination">
|
|
|
|
<MkPagePreview v-for="page in items" :key="page.id" class="ckltabjg" :page="page"/>
|
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2020-11-17 06:59:15 +01:00
|
|
|
|
2021-12-02 12:09:12 +01:00
|
|
|
<div v-else-if="tab === 'my'" class="rknalgpo my">
|
|
|
|
<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"/>
|
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2020-07-28 03:08:08 +02:00
|
|
|
|
2021-12-02 12:09:12 +01:00
|
|
|
<div v-else-if="tab === 'liked'" class="rknalgpo">
|
|
|
|
<MkPagination v-slot="{items}" :pagination="likedPagesPagination">
|
|
|
|
<MkPagePreview v-for="like in items" :key="like.page.id" class="ckltabjg" :page="like.page"/>
|
|
|
|
</MkPagination>
|
2021-10-23 21:03:07 +02:00
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
2020-01-29 20:37:25 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-12-02 12:09:12 +01:00
|
|
|
import { computed, defineComponent } from 'vue';
|
2021-11-11 18:02:25 +01:00
|
|
|
import MkPagePreview from '@/components/page-preview.vue';
|
|
|
|
import MkPagination from '@/components/ui/pagination.vue';
|
|
|
|
import MkButton from '@/components/ui/button.vue';
|
|
|
|
import * as symbols from '@/symbols';
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2020-10-17 13:12:00 +02:00
|
|
|
export default defineComponent({
|
2020-01-29 20:37:25 +01:00
|
|
|
components: {
|
2021-12-02 12:09:12 +01:00
|
|
|
MkPagePreview, MkPagination, MkButton
|
2020-01-29 20:37:25 +01:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2021-12-02 12:09:12 +01:00
|
|
|
[symbols.PAGE_INFO]: computed(() => ({
|
2020-12-26 02:47:36 +01:00
|
|
|
title: this.$ts.pages,
|
2021-04-20 16:22:59 +02:00
|
|
|
icon: 'fas fa-sticky-note',
|
2021-10-09 05:33:08 +02:00
|
|
|
bg: 'var(--bg)',
|
2021-04-10 17:03:31 +02:00
|
|
|
actions: [{
|
2021-04-20 16:22:59 +02:00
|
|
|
icon: 'fas fa-plus',
|
2021-04-10 17:03:31 +02:00
|
|
|
text: this.$ts.create,
|
2021-10-09 05:33:08 +02:00
|
|
|
handler: this.create,
|
|
|
|
}],
|
2021-12-02 12:09:12 +01:00
|
|
|
tabs: [{
|
|
|
|
active: this.tab === 'featured',
|
|
|
|
title: this.$ts._pages.featured,
|
|
|
|
icon: 'fas fa-fire-alt',
|
|
|
|
onClick: () => { this.tab = 'featured'; },
|
|
|
|
}, {
|
|
|
|
active: this.tab === 'my',
|
|
|
|
title: this.$ts._pages.my,
|
|
|
|
icon: 'fas fa-edit',
|
|
|
|
onClick: () => { this.tab = 'my'; },
|
|
|
|
}, {
|
|
|
|
active: this.tab === 'liked',
|
|
|
|
title: this.$ts._pages.liked,
|
|
|
|
icon: 'fas fa-heart',
|
|
|
|
onClick: () => { this.tab = 'liked'; },
|
|
|
|
},]
|
|
|
|
})),
|
2020-11-17 06:59:15 +01:00
|
|
|
tab: 'featured',
|
|
|
|
featuredPagesPagination: {
|
2022-01-12 18:26:10 +01:00
|
|
|
endpoint: 'pages/featured' as const,
|
2020-11-17 06:59:15 +01:00
|
|
|
noPaging: true,
|
|
|
|
},
|
2020-01-29 20:37:25 +01:00
|
|
|
myPagesPagination: {
|
2022-01-12 18:26:10 +01:00
|
|
|
endpoint: 'i/pages' as const,
|
2020-01-29 20:37:25 +01:00
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
likedPagesPagination: {
|
2022-01-12 18:26:10 +01:00
|
|
|
endpoint: 'i/page-likes' as const,
|
2020-01-29 20:37:25 +01:00
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
create() {
|
2020-11-17 06:59:15 +01:00
|
|
|
this.$router.push(`/pages/new`);
|
2020-01-29 20:37:25 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.rknalgpo {
|
|
|
|
&.my .ckltabjg:first-child {
|
|
|
|
margin-top: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ckltabjg:not(:last-child) {
|
|
|
|
margin-bottom: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media (min-width: 500px) {
|
|
|
|
.ckltabjg:not(:last-child) {
|
|
|
|
margin-bottom: 16px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|