2020-01-29 12:37:25 -07:00
|
|
|
<template>
|
|
|
|
<div>
|
2020-11-16 22:59:15 -07:00
|
|
|
<MkTab v-model:value="tab" v-if="this.$store.getters.isSignedIn">
|
|
|
|
<option value="featured"><Fa :icon="faFireAlt"/> {{ $t('_pages.featured') }}</option>
|
|
|
|
<option value="my"><Fa :icon="faEdit"/> {{ $t('_pages.my') }}</option>
|
|
|
|
<option value="liked"><Fa :icon="faHeart"/> {{ $t('_pages.liked') }}</option>
|
|
|
|
</MkTab>
|
2020-01-29 12:37:25 -07:00
|
|
|
|
2020-10-18 06:21:52 -06:00
|
|
|
<div class="_section">
|
2020-11-16 22:59:15 -07:00
|
|
|
<div class="rknalgpo _content" v-if="tab === 'featured'">
|
|
|
|
<MkPagination :pagination="featuredPagesPagination" #default="{items}">
|
|
|
|
<MkPagePreview v-for="page in items" class="ckltabjg" :page="page" :key="page.id"/>
|
|
|
|
</MkPagination>
|
|
|
|
</div>
|
|
|
|
|
2020-10-18 06:21:52 -06:00
|
|
|
<div class="rknalgpo _content my" v-if="tab === 'my'">
|
|
|
|
<MkButton class="new" @click="create()"><Fa :icon="faPlus"/></MkButton>
|
|
|
|
<MkPagination :pagination="myPagesPagination" #default="{items}">
|
|
|
|
<MkPagePreview v-for="page in items" class="ckltabjg" :page="page" :key="page.id"/>
|
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2020-07-27 19:08:08 -06:00
|
|
|
|
2020-10-18 06:21:52 -06:00
|
|
|
<div class="rknalgpo _content" v-if="tab === 'liked'">
|
|
|
|
<MkPagination :pagination="likedPagesPagination" #default="{items}">
|
|
|
|
<MkPagePreview v-for="like in items" class="ckltabjg" :page="like.page" :key="like.page.id"/>
|
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2020-07-27 19:08:08 -06:00
|
|
|
</div>
|
2020-01-29 12:37:25 -07:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 05:12:00 -06:00
|
|
|
import { defineComponent } from 'vue';
|
2020-11-16 22:59:15 -07:00
|
|
|
import { faPlus, faEdit, faFireAlt } from '@fortawesome/free-solid-svg-icons';
|
2020-01-29 12:37:25 -07:00
|
|
|
import { faStickyNote, faHeart } from '@fortawesome/free-regular-svg-icons';
|
2020-10-17 05:12:00 -06:00
|
|
|
import MkPagePreview from '@/components/page-preview.vue';
|
|
|
|
import MkPagination from '@/components/ui/pagination.vue';
|
|
|
|
import MkButton from '@/components/ui/button.vue';
|
|
|
|
import MkTab from '@/components/tab.vue';
|
2020-01-29 12:37:25 -07:00
|
|
|
|
2020-10-17 05:12:00 -06:00
|
|
|
export default defineComponent({
|
2020-01-29 12:37:25 -07:00
|
|
|
components: {
|
2020-07-27 19:08:08 -06:00
|
|
|
MkPagePreview, MkPagination, MkButton, MkTab
|
2020-01-29 12:37:25 -07:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2020-10-17 05:12:00 -06:00
|
|
|
INFO: {
|
2020-11-03 04:36:12 -07:00
|
|
|
title: this.$t('pages'),
|
|
|
|
icon: faStickyNote,
|
2020-10-17 05:12:00 -06:00
|
|
|
action: {
|
|
|
|
icon: faPlus,
|
|
|
|
handler: this.create
|
|
|
|
}
|
|
|
|
},
|
2020-11-16 22:59:15 -07:00
|
|
|
tab: 'featured',
|
|
|
|
featuredPagesPagination: {
|
|
|
|
endpoint: 'pages/featured',
|
|
|
|
noPaging: true,
|
|
|
|
},
|
2020-01-29 12:37:25 -07:00
|
|
|
myPagesPagination: {
|
|
|
|
endpoint: 'i/pages',
|
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
likedPagesPagination: {
|
|
|
|
endpoint: 'i/page-likes',
|
|
|
|
limit: 5,
|
|
|
|
},
|
2020-11-16 22:59:15 -07:00
|
|
|
faStickyNote, faPlus, faEdit, faHeart, faFireAlt
|
2020-01-29 12:37:25 -07:00
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
create() {
|
2020-11-16 22:59:15 -07:00
|
|
|
this.$router.push(`/pages/new`);
|
2020-01-29 12:37:25 -07: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>
|