2020-01-29 20:37:25 +01:00
|
|
|
<template>
|
|
|
|
<div>
|
2021-10-09 05:33:08 +02:00
|
|
|
<MkHeader :info="header"/>
|
|
|
|
|
|
|
|
<!-- TODO: MkHeaderに統合 -->
|
2021-09-29 17:50:45 +02:00
|
|
|
<MkTab v-model="tab" v-if="$i">
|
2021-04-20 16:22:59 +02:00
|
|
|
<option value="featured"><i class="fas fa-fire-alt"></i> {{ $ts._pages.featured }}</option>
|
|
|
|
<option value="my"><i class="fas fa-edit"></i> {{ $ts._pages.my }}</option>
|
|
|
|
<option value="liked"><i class="fas fa-heart"></i> {{ $ts._pages.liked }}</option>
|
2020-11-17 06:59:15 +01:00
|
|
|
</MkTab>
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2020-10-18 14:21:52 +02:00
|
|
|
<div class="_section">
|
2020-11-17 06:59:15 +01: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 14:21:52 +02:00
|
|
|
<div class="rknalgpo _content my" v-if="tab === 'my'">
|
2021-04-20 16:22:59 +02:00
|
|
|
<MkButton class="new" @click="create()"><i class="fas fa-plus"></i></MkButton>
|
2020-10-18 14:21:52 +02:00
|
|
|
<MkPagination :pagination="myPagesPagination" #default="{items}">
|
|
|
|
<MkPagePreview v-for="page in items" class="ckltabjg" :page="page" :key="page.id"/>
|
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2020-07-28 03:08:08 +02:00
|
|
|
|
2020-10-18 14:21:52 +02: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-28 03:08:08 +02:00
|
|
|
</div>
|
2020-01-29 20:37:25 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 13:12:00 +02:00
|
|
|
import { defineComponent } from 'vue';
|
2021-03-23 09:30:14 +01:00
|
|
|
import MkPagePreview from '@client/components/page-preview.vue';
|
|
|
|
import MkPagination from '@client/components/ui/pagination.vue';
|
|
|
|
import MkButton from '@client/components/ui/button.vue';
|
|
|
|
import MkTab from '@client/components/tab.vue';
|
2021-04-10 05:54:12 +02:00
|
|
|
import * as symbols from '@client/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: {
|
2020-07-28 03:08:08 +02:00
|
|
|
MkPagePreview, MkPagination, MkButton, MkTab
|
2020-01-29 20:37:25 +01:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2021-04-10 05:54:12 +02:00
|
|
|
[symbols.PAGE_INFO]: {
|
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)',
|
|
|
|
},
|
|
|
|
header: {
|
|
|
|
title: this.$ts.pages,
|
|
|
|
icon: 'fas fa-sticky-note',
|
|
|
|
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,
|
|
|
|
}],
|
2020-10-17 13:12:00 +02:00
|
|
|
},
|
2020-11-17 06:59:15 +01:00
|
|
|
tab: 'featured',
|
|
|
|
featuredPagesPagination: {
|
|
|
|
endpoint: 'pages/featured',
|
|
|
|
noPaging: true,
|
|
|
|
},
|
2020-01-29 20:37:25 +01:00
|
|
|
myPagesPagination: {
|
|
|
|
endpoint: 'i/pages',
|
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
likedPagesPagination: {
|
|
|
|
endpoint: 'i/page-likes',
|
|
|
|
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>
|