gancio-upstream/layouts/default.vue

63 lines
1.8 KiB
Vue
Raw Normal View History

2022-05-03 11:43:38 +02:00
<template>
<v-app app>
<Snackbar/>
<Confirm/>
<Nav/>
<v-main app>
2022-06-07 21:08:47 +02:00
<v-container fluid class='pa-0'>
2022-06-18 01:11:08 +02:00
<div v-if='showCollections || showBack'>
2022-06-07 21:08:47 +02:00
<v-btn class='ml-2 mt-2' v-if='showBack' outlined color='primary' to='/'><v-icon v-text='mdiChevronLeft'></v-icon></v-btn>
2022-06-18 01:11:08 +02:00
<v-btn class='ml-2 mt-2' outlined v-for='collection in collections' color='primary' :key='collection.id' :to='`/collection/${collection.name}`'>{{collection.name}}</v-btn>
2022-06-07 21:08:47 +02:00
</div>
<v-fade-transition hide-on-leave>
<nuxt />
</v-fade-transition>
</v-container>
2022-05-03 11:43:38 +02:00
</v-main>
<Footer/>
2020-07-28 12:24:39 +02:00
2022-05-03 11:43:38 +02:00
</v-app>
2020-07-25 21:41:22 +02:00
2019-04-03 00:25:12 +02:00
</template>
2020-01-15 23:27:11 +01:00
<script>
import Nav from '~/components/Nav.vue'
2020-07-25 21:41:22 +02:00
import Snackbar from '../components/Snackbar'
import Footer from '../components/Footer'
2020-07-28 12:24:39 +02:00
import Confirm from '../components/Confirm'
2020-07-29 00:25:45 +02:00
import { mapState } from 'vuex'
import { mdiChevronLeft } from '@mdi/js'
2020-02-05 00:42:05 +01:00
2020-01-15 23:27:11 +01:00
export default {
head () {
return {
htmlAttrs: {
lang: this.locale
2022-06-23 15:51:03 +02:00
},
link: [{ rel: 'icon', type: 'image/png', href: this.settings.baseurl + '/logo.png' }],
}
},
data () {
2022-06-18 01:11:08 +02:00
return { collections: [], mdiChevronLeft }
},
async fetch () {
2022-06-18 01:11:08 +02:00
this.collections = await this.$axios.$get('collections')
},
2020-07-25 21:41:22 +02:00
name: 'Default',
2021-05-19 16:17:48 +02:00
components: { Nav, Snackbar, Footer, Confirm },
computed: {
...mapState(['settings', 'locale']),
showBack () {
2022-06-18 01:11:08 +02:00
return ['tag-tag', 'collection-collection', 'place-place', 'search', 'announcement-id'].includes(this.$route.name)
},
2022-06-18 01:11:08 +02:00
showCollections () {
if (!this.collections || this.collections.length === 0) return false
return ['tag-tag', 'index', 'g-collection', 'p-place'].includes(this.$route.name)
}
},
2020-07-29 00:25:45 +02:00
created () {
this.$vuetify.theme.dark = this.settings['theme.is_dark']
}
2020-01-15 23:27:11 +01:00
}
2021-05-19 16:17:48 +02:00
</script>