mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
linkable admin tabs
This commit is contained in:
parent
5baff1adb1
commit
d00ef15811
1 changed files with 31 additions and 24 deletions
|
@ -6,56 +6,56 @@ v-container.container.pa-0.pa-md-3
|
|||
v-tabs(v-model='selectedTab' show-arrows :next-icon='mdiChevronRight' :prev-icon='mdiChevronLeft')
|
||||
|
||||
//- SETTINGS
|
||||
v-tab {{$t('common.settings')}}
|
||||
v-tab-item
|
||||
v-tab(href='#settings') {{$t('common.settings')}}
|
||||
v-tab-item(value='settings')
|
||||
Settings
|
||||
|
||||
//- THEME
|
||||
v-tab {{$t('common.theme')}}
|
||||
v-tab-item
|
||||
v-tab(href='#theme') {{$t('common.theme')}}
|
||||
v-tab-item(value='theme')
|
||||
Theme
|
||||
|
||||
//- USERS
|
||||
v-tab
|
||||
v-tab(href='#users')
|
||||
v-badge(:value='!!unconfirmedUsers.length' :content='unconfirmedUsers.length') {{$t('common.users')}}
|
||||
v-tab-item
|
||||
v-tab-item(value='users')
|
||||
Users(:users='users' @update='updateUsers')
|
||||
|
||||
//- PLACES
|
||||
v-tab {{$t('common.places')}}
|
||||
v-tab-item
|
||||
v-tab(href='#places') {{$t('common.places')}}
|
||||
v-tab-item(value='places')
|
||||
Places
|
||||
|
||||
//- Collections
|
||||
v-tab {{$t('common.collections')}}
|
||||
v-tab-item
|
||||
v-tab(href='#collections') {{$t('common.collections')}}
|
||||
v-tab-item(value='collections')
|
||||
Collections
|
||||
|
||||
//- EVENTS
|
||||
v-tab
|
||||
v-tab(href='#unconfirmed_events')
|
||||
v-badge(:value='!!unconfirmedEvents.length' :content='unconfirmedEvents.length') {{$t('common.events')}}
|
||||
v-tab-item
|
||||
v-tab-item(value='unconfirmed_events')
|
||||
Events(:unconfirmedEvents='unconfirmedEvents'
|
||||
@confirmed='id => { unconfirmedEvents = unconfirmedEvents.filter(e => e.id !== id)}')
|
||||
|
||||
//- ANNOUNCEMENTS
|
||||
v-tab {{$t('common.announcements')}}
|
||||
v-tab-item
|
||||
v-tab(href='#announcements') {{$t('common.announcements')}}
|
||||
v-tab-item(value='announcements')
|
||||
Announcement
|
||||
|
||||
//- PLUGINS
|
||||
v-tab {{$t('common.plugins')}}
|
||||
v-tab-item
|
||||
v-tab(href='#plugins') {{$t('common.plugins')}}
|
||||
v-tab-item(value='plugins')
|
||||
Plugin
|
||||
|
||||
//- FEDERATION
|
||||
v-tab {{$t('common.federation')}}
|
||||
v-tab-item
|
||||
v-tab(href='#federation') {{$t('common.federation')}}
|
||||
v-tab-item(value='federation')
|
||||
Federation
|
||||
|
||||
//- MODERATION
|
||||
v-tab(v-if='settings.enable_federation') {{$t('common.moderation')}}
|
||||
v-tab-item
|
||||
v-tab(v-if='settings.enable_federation' href='#moderation') {{$t('common.moderation')}}
|
||||
v-tab-item(value='moderation')
|
||||
Moderation
|
||||
</template>
|
||||
<script>
|
||||
|
@ -88,9 +88,9 @@ export default {
|
|||
try {
|
||||
const users = await $axios.$get('/users')
|
||||
const unconfirmedEvents = await $axios.$get('/event/unconfirmed')
|
||||
return { users, unconfirmedEvents, selectedTab: 0, url }
|
||||
return { users, unconfirmedEvents, url }
|
||||
} catch (e) {
|
||||
return { users: [], unconfirmedEvents: [], selectedTab: 0, url }
|
||||
return { users: [], unconfirmedEvents: [], url }
|
||||
}
|
||||
},
|
||||
data () {
|
||||
|
@ -99,7 +99,6 @@ export default {
|
|||
users: [],
|
||||
description: '',
|
||||
unconfirmedEvents: [],
|
||||
selectedTab: 0
|
||||
}
|
||||
},
|
||||
head () {
|
||||
|
@ -109,6 +108,14 @@ export default {
|
|||
...mapState(['settings']),
|
||||
unconfirmedUsers () {
|
||||
return this.users.filter(u => !u.is_active)
|
||||
},
|
||||
selectedTab: {
|
||||
set (tab) {
|
||||
this.$router.replace({ query: { ...this.$route.query, tab } })
|
||||
},
|
||||
get () {
|
||||
return this.$route.query.tab
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
Loading…
Reference in a new issue