2018-10-26 16:17:18 +01:00
|
|
|
<template>
|
2022-02-19 06:18:01 +01:00
|
|
|
<div class="fd-page-with-tabs">
|
2022-02-19 06:39:14 +01:00
|
|
|
<tabs-music />
|
2018-10-26 16:17:18 +01:00
|
|
|
<content-with-heading>
|
2022-02-19 06:39:14 +01:00
|
|
|
<template #options>
|
2022-02-19 07:47:54 +01:00
|
|
|
<index-button-list :index="genres.indexList" />
|
2018-12-08 08:48:15 +01:00
|
|
|
</template>
|
2022-02-19 06:39:14 +01:00
|
|
|
<template #heading-left>
|
2022-05-20 13:44:22 +02:00
|
|
|
<p class="title is-4" v-text="$t('page.genres.title')" />
|
2022-05-29 18:49:00 +02:00
|
|
|
<p
|
|
|
|
class="heading"
|
|
|
|
v-text="$t('page.genres.count', { count: genres.total })"
|
|
|
|
/>
|
2018-10-26 16:17:18 +01:00
|
|
|
</template>
|
2022-02-19 06:39:14 +01:00
|
|
|
<template #content>
|
2023-07-24 19:51:00 +02:00
|
|
|
<list-genres :genres="genres" :media_kind="'music'" />
|
2018-10-26 16:17:18 +01:00
|
|
|
</template>
|
|
|
|
</content-with-heading>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2023-07-18 15:48:56 +02:00
|
|
|
import { GroupByList, byName } from '@/lib/GroupByList'
|
2023-07-24 19:51:00 +02:00
|
|
|
import ContentWithHeading from '@/templates/ContentWithHeading.vue'
|
2022-02-19 06:18:01 +01:00
|
|
|
import IndexButtonList from '@/components/IndexButtonList.vue'
|
2022-02-19 07:47:54 +01:00
|
|
|
import ListGenres from '@/components/ListGenres.vue'
|
2023-07-18 15:48:56 +02:00
|
|
|
import TabsMusic from '@/components/TabsMusic.vue'
|
2018-10-26 16:17:18 +01:00
|
|
|
import webapi from '@/webapi'
|
|
|
|
|
2022-02-19 06:18:01 +01:00
|
|
|
const dataObject = {
|
2023-06-07 21:25:54 +02:00
|
|
|
load(to) {
|
2022-03-26 22:01:47 +01:00
|
|
|
return webapi.library_genres('music')
|
2018-10-26 16:17:18 +01:00
|
|
|
},
|
|
|
|
|
2023-06-07 21:25:54 +02:00
|
|
|
set(vm, response) {
|
2018-10-26 16:17:18 +01:00
|
|
|
vm.genres = response.data
|
2022-02-19 07:47:54 +01:00
|
|
|
vm.genres = new GroupByList(response.data)
|
|
|
|
vm.genres.group(byName('name_sort'))
|
2018-10-26 16:17:18 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'PageGenres',
|
2022-02-19 06:39:14 +01:00
|
|
|
components: {
|
|
|
|
ContentWithHeading,
|
|
|
|
IndexButtonList,
|
2023-07-24 19:51:00 +02:00
|
|
|
ListGenres,
|
|
|
|
TabsMusic
|
2022-02-19 06:39:14 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
beforeRouteEnter(to, from, next) {
|
|
|
|
dataObject.load(to).then((response) => {
|
|
|
|
next((vm) => dataObject.set(vm, response))
|
|
|
|
})
|
|
|
|
},
|
|
|
|
beforeRouteUpdate(to, from, next) {
|
|
|
|
const vm = this
|
|
|
|
dataObject.load(to).then((response) => {
|
|
|
|
dataObject.set(vm, response)
|
|
|
|
next()
|
|
|
|
})
|
|
|
|
},
|
2018-10-26 16:17:18 +01:00
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
data() {
|
2018-10-26 16:17:18 +01:00
|
|
|
return {
|
2022-02-19 07:47:54 +01:00
|
|
|
genres: new GroupByList()
|
2018-10-26 16:17:18 +01:00
|
|
|
}
|
2023-06-30 03:51:38 +02:00
|
|
|
}
|
2018-10-26 16:17:18 +01:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
<style></style>
|