2020-01-29 11:37:25 -08:00
|
|
|
<template>
|
|
|
|
<div>
|
2020-03-22 03:46:07 -07:00
|
|
|
<portal to="icon"><fa :icon="faStickyNote"/></portal>
|
2020-07-24 09:56:52 -07:00
|
|
|
<portal to="title">{{ $t('pages') }}</portal>
|
2020-03-22 03:46:07 -07:00
|
|
|
|
2020-07-27 18:08:08 -07:00
|
|
|
<mk-tab v-model="tab" :items="[{ label: $t('_pages.my'), value: 'my', icon: faEdit }, { label: $t('_pages.liked'), value: 'liked', icon: faHeart }]"/>
|
2020-01-29 11:37:25 -08:00
|
|
|
|
2020-07-27 18:08:08 -07:00
|
|
|
<div class="rknalgpo my" v-if="tab === 'my'">
|
|
|
|
<mk-button class="new" @click="create()"><fa :icon="faPlus"/></mk-button>
|
|
|
|
<mk-pagination :pagination="myPagesPagination" #default="{items}">
|
|
|
|
<mk-page-preview v-for="page in items" class="ckltabjg" :page="page" :key="page.id"/>
|
|
|
|
</mk-pagination>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="rknalgpo" v-if="tab === 'liked'">
|
|
|
|
<mk-pagination :pagination="likedPagesPagination" #default="{items}">
|
|
|
|
<mk-page-preview v-for="like in items" class="ckltabjg" :page="like.page" :key="like.page.id"/>
|
|
|
|
</mk-pagination>
|
|
|
|
</div>
|
2020-01-29 11:37:25 -08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
import { faPlus, faEdit } from '@fortawesome/free-solid-svg-icons';
|
|
|
|
import { faStickyNote, faHeart } from '@fortawesome/free-regular-svg-icons';
|
|
|
|
import MkPagePreview from '../components/page-preview.vue';
|
|
|
|
import MkPagination from '../components/ui/pagination.vue';
|
|
|
|
import MkButton from '../components/ui/button.vue';
|
2020-07-27 18:08:08 -07:00
|
|
|
import MkTab from '../components/tab.vue';
|
2020-01-29 11:37:25 -08:00
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
components: {
|
2020-07-27 18:08:08 -07:00
|
|
|
MkPagePreview, MkPagination, MkButton, MkTab
|
2020-01-29 11:37:25 -08:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2020-07-27 18:08:08 -07:00
|
|
|
tab: 'my',
|
2020-01-29 11:37:25 -08:00
|
|
|
myPagesPagination: {
|
|
|
|
endpoint: 'i/pages',
|
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
likedPagesPagination: {
|
|
|
|
endpoint: 'i/page-likes',
|
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
faStickyNote, faPlus, faEdit, faHeart
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
create() {
|
|
|
|
this.$router.push(`/my/pages/new`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.rknalgpo {
|
|
|
|
padding: 16px;
|
|
|
|
|
|
|
|
&.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>
|