2020-08-18 15:44:21 +02:00
|
|
|
<template>
|
|
|
|
<div>
|
2021-11-19 11:36:12 +01:00
|
|
|
<div v-if="$i" class="_section" style="padding: 0;">
|
|
|
|
<MkTab v-model="tab" class="_content">
|
2021-04-20 16:22:59 +02:00
|
|
|
<option value="featured"><i class="fas fa-fire-alt"></i> {{ $ts._channel.featured }}</option>
|
|
|
|
<option value="following"><i class="fas fa-heart"></i> {{ $ts._channel.following }}</option>
|
|
|
|
<option value="owned"><i class="fas fa-edit"></i> {{ $ts._channel.owned }}</option>
|
2020-11-17 06:59:15 +01:00
|
|
|
</MkTab>
|
2020-08-18 15:44:21 +02:00
|
|
|
</div>
|
|
|
|
|
2020-10-17 13:12:00 +02:00
|
|
|
<div class="_section">
|
2021-11-19 11:36:12 +01:00
|
|
|
<div v-if="tab === 'featured'" class="_content grwlizim featured">
|
2021-12-02 12:09:12 +01:00
|
|
|
<MkPagination v-slot="{items}" :pagination="featuredPagination">
|
2021-11-19 11:36:12 +01:00
|
|
|
<MkChannelPreview v-for="channel in items" :key="channel.id" class="_gap" :channel="channel"/>
|
2020-10-17 13:12:00 +02:00
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2020-08-18 15:44:21 +02:00
|
|
|
|
2021-11-19 11:36:12 +01:00
|
|
|
<div v-if="tab === 'following'" class="_content grwlizim following">
|
2021-12-02 12:09:12 +01:00
|
|
|
<MkPagination v-slot="{items}" :pagination="followingPagination">
|
2021-11-19 11:36:12 +01:00
|
|
|
<MkChannelPreview v-for="channel in items" :key="channel.id" class="_gap" :channel="channel"/>
|
2020-10-17 13:12:00 +02:00
|
|
|
</MkPagination>
|
|
|
|
</div>
|
|
|
|
|
2021-11-19 11:36:12 +01:00
|
|
|
<div v-if="tab === 'owned'" class="_content grwlizim owned">
|
2021-04-20 16:22:59 +02:00
|
|
|
<MkButton class="new" @click="create()"><i class="fas fa-plus"></i></MkButton>
|
2021-12-02 12:09:12 +01:00
|
|
|
<MkPagination v-slot="{items}" :pagination="ownedPagination">
|
2021-11-19 11:36:12 +01:00
|
|
|
<MkChannelPreview v-for="channel in items" :key="channel.id" class="_gap" :channel="channel"/>
|
2020-10-17 13:12:00 +02:00
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2020-08-18 15:44:21 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 13:12:00 +02:00
|
|
|
import { defineComponent } from 'vue';
|
2021-11-11 18:02:25 +01:00
|
|
|
import MkChannelPreview from '@/components/channel-preview.vue';
|
|
|
|
import MkPagination from '@/components/ui/pagination.vue';
|
|
|
|
import MkButton from '@/components/ui/button.vue';
|
|
|
|
import MkTab from '@/components/tab.vue';
|
|
|
|
import * as symbols from '@/symbols';
|
2020-08-18 15:44:21 +02:00
|
|
|
|
2020-10-17 13:12:00 +02:00
|
|
|
export default defineComponent({
|
2020-08-18 15:44:21 +02:00
|
|
|
components: {
|
|
|
|
MkChannelPreview, MkPagination, MkButton, MkTab
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2021-04-10 05:54:12 +02:00
|
|
|
[symbols.PAGE_INFO]: {
|
2020-12-26 02:47:36 +01:00
|
|
|
title: this.$ts.channel,
|
2021-04-20 16:22:59 +02:00
|
|
|
icon: 'fas fa-satellite-dish',
|
2020-11-17 06:59:15 +01:00
|
|
|
action: {
|
2021-04-20 16:22:59 +02:00
|
|
|
icon: 'fas fa-plus',
|
2020-11-17 06:59:15 +01:00
|
|
|
handler: this.create
|
|
|
|
}
|
2020-10-17 13:12:00 +02:00
|
|
|
},
|
2020-08-18 15:44:21 +02:00
|
|
|
tab: 'featured',
|
|
|
|
featuredPagination: {
|
|
|
|
endpoint: 'channels/featured',
|
2020-08-30 11:18:34 +02:00
|
|
|
noPaging: true,
|
2020-08-18 15:44:21 +02:00
|
|
|
},
|
|
|
|
followingPagination: {
|
|
|
|
endpoint: 'channels/followed',
|
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
ownedPagination: {
|
|
|
|
endpoint: 'channels/owned',
|
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
create() {
|
|
|
|
this.$router.push(`/channels/new`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|