add a layout option to the authors page Cards|Table

This commit is contained in:
Shaun 2024-08-26 14:59:05 +10:00
parent c72eac9987
commit 9246e46423
4 changed files with 113 additions and 6 deletions

View file

@ -98,6 +98,7 @@
<!-- author sort select -->
<controls-sort-select v-if="authors?.length" v-model="settings.authorSortBy" :descending.sync="settings.authorSortDesc" :items="authorSortItems" class="w-36 sm:w-44 md:w-48 h-7.5 ml-1 sm:ml-4" @change="updateAuthorSort" />
<controls-layout-select v-if="authors?.length" v-model="settings.authorPageLayout" :items="layoutSelectItems" class="w-24 sm:w-44 md:w-48 h-7.5 ml-1 sm:ml-4" @change="updateAuthorLayout" />
</template>
<!-- home page -->
<template v-else-if="isHome">
@ -195,6 +196,18 @@ export default {
}
]
},
layoutSelectItems() {
return [
{
text: 'Cards',
value: 'cards'
},
{
text: 'Table',
value: 'table'
}
]
},
authorSortItems() {
return [
{
@ -593,6 +606,9 @@ export default {
updateAuthorSort() {
this.saveSettings()
},
updateAuthorLayout() {
this.saveSettings()
},
saveSettings() {
this.$store.dispatch('user/updateUserSettings', this.settings)
},