2019-04-03 00:25:12 +02:00
|
|
|
<template lang="pug">
|
2019-07-11 22:29:18 +02:00
|
|
|
el-menu.d-flex.nav(mode='horizontal' background-color="#222C32")
|
2019-10-22 23:47:41 +02:00
|
|
|
Login(:show='showLogin', @close='showLogin=false')
|
|
|
|
Register(:show='showRegister', @close='showRegister=false')
|
2019-06-09 00:45:50 +02:00
|
|
|
nuxt-link(to='/about')
|
|
|
|
el-menu-item(:title="$t('common.info')")
|
|
|
|
img#logo(src='/favicon.ico')
|
2019-05-30 12:04:14 +02:00
|
|
|
|
2019-11-06 11:21:44 +01:00
|
|
|
nuxt-link(v-if='!$auth.loggedIn' to='/?ref=login')
|
|
|
|
el-menu-item(:title="$t('common.login')")
|
2019-06-06 23:54:32 +02:00
|
|
|
v-icon(color='lightgreen' name='user')
|
2019-05-30 12:04:14 +02:00
|
|
|
|
2019-06-25 01:05:38 +02:00
|
|
|
nuxt-link(v-if='could_add' to='/add')
|
2019-06-09 00:45:50 +02:00
|
|
|
el-menu-item(:title="$t('common.add_event')")
|
|
|
|
v-icon(color='lightgreen' name='plus')
|
2019-05-30 12:04:14 +02:00
|
|
|
|
2019-11-06 11:21:44 +01:00
|
|
|
el-popover(placement="bottom" trigger="click")
|
2019-07-11 23:31:37 +02:00
|
|
|
Search(past-filter recurrent-filter)
|
2019-06-25 01:05:38 +02:00
|
|
|
el-menu-item(slot='reference' :title="$t('common.search')" icon='el-share-button')
|
2019-05-30 12:04:14 +02:00
|
|
|
v-icon(color='lightblue' name='search')
|
2019-06-25 01:05:38 +02:00
|
|
|
el-badge(v-if='filters.tags.length+filters.places.length>0' is-dot type='warning')
|
2019-05-30 12:04:14 +02:00
|
|
|
|
2019-11-06 11:21:44 +01:00
|
|
|
nuxt-link(v-if='$auth.loggedIn' to='/settings')
|
|
|
|
el-menu-item(:title="$t('common.settings')")
|
2019-06-09 00:45:50 +02:00
|
|
|
v-icon(color='orange' name='cog')
|
|
|
|
|
2019-11-06 11:21:44 +01:00
|
|
|
nuxt-link(v-if='$auth.user && $auth.user.is_admin' to='/admin')
|
|
|
|
el-menu-item(:title="$t('common.admin')")
|
2019-06-09 00:45:50 +02:00
|
|
|
v-icon(color='lightblue' name='tools')
|
|
|
|
|
|
|
|
nuxt-link(to='/export')
|
|
|
|
el-menu-item(:title="$t('common.share')")
|
|
|
|
v-icon(name='share' color='yellow')
|
2019-05-30 12:04:14 +02:00
|
|
|
|
2019-11-06 11:22:22 +01:00
|
|
|
el-menu-item(v-if='$auth.loggedIn' @click='logout' :title="$t('common.logout')")
|
|
|
|
v-icon(color='red' name='sign-out-alt')
|
2019-04-03 00:25:12 +02:00
|
|
|
|
2019-11-13 16:59:20 +01:00
|
|
|
el-menu-item(:title="$t('common.feed')" v-clipboard:copy='`${settings.baseurl}/feed/rss`' v-clipboard:success='copyLink')
|
2019-11-06 11:22:22 +01:00
|
|
|
v-icon(color='orange' name='rss')
|
2019-11-03 00:53:24 +01:00
|
|
|
|
2019-04-03 00:25:12 +02:00
|
|
|
</template>
|
|
|
|
<script>
|
2019-05-30 12:04:14 +02:00
|
|
|
import { Message } from 'element-ui'
|
2019-06-25 01:05:38 +02:00
|
|
|
import { mapState } from 'vuex'
|
2019-05-30 12:04:14 +02:00
|
|
|
import Search from '@/components/Search'
|
2019-10-22 23:47:41 +02:00
|
|
|
import Login from '@/components/Login'
|
|
|
|
import Register from '@/components/Register'
|
2019-05-30 12:04:14 +02:00
|
|
|
|
2019-04-03 00:25:12 +02:00
|
|
|
export default {
|
|
|
|
name: 'Nav',
|
2019-10-22 23:47:41 +02:00
|
|
|
components: { Search, Login, Register },
|
2019-11-06 11:21:44 +01:00
|
|
|
data () {
|
2019-10-22 23:47:41 +02:00
|
|
|
return {
|
|
|
|
showLogin: this.$route.query.ref === 'login',
|
|
|
|
showRegister: this.$route.query.ref === 'register'
|
|
|
|
}
|
|
|
|
},
|
2019-06-25 01:05:38 +02:00
|
|
|
computed: {
|
|
|
|
could_add () {
|
|
|
|
return (this.$auth.loggedIn || this.settings.allow_anon_event)
|
|
|
|
},
|
2019-09-11 19:12:24 +02:00
|
|
|
...mapState(['filters', 'settings'])
|
2019-06-25 01:05:38 +02:00
|
|
|
},
|
2019-10-22 23:47:41 +02:00
|
|
|
watch: {
|
|
|
|
'$route.query.ref' (value) {
|
|
|
|
if (value === 'register') {
|
|
|
|
this.showRegister = true
|
|
|
|
this.showLogin = false
|
|
|
|
} else if (value === 'login') {
|
|
|
|
this.showLogin = true
|
|
|
|
this.showRegister = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-05-30 12:04:14 +02:00
|
|
|
methods: {
|
2019-11-06 11:21:44 +01:00
|
|
|
copyLink () {
|
|
|
|
Message({ message: this.$t('common.feed_url_copied'), type: 'success', showClose: true })
|
|
|
|
},
|
2019-05-30 12:04:14 +02:00
|
|
|
logout () {
|
2019-11-06 11:21:44 +01:00
|
|
|
Message({ showClose: true, message: this.$t('common.logout_ok'), type: 'success' })
|
2019-05-30 12:04:14 +02:00
|
|
|
this.$auth.logout()
|
|
|
|
}
|
|
|
|
}
|
2019-04-03 00:25:12 +02:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2019-05-30 12:04:14 +02:00
|
|
|
<style>
|
|
|
|
|
|
|
|
.el-menu.el-menu--horizontal {
|
|
|
|
border-bottom: none;
|
|
|
|
}
|
|
|
|
|
2019-09-19 16:23:46 +02:00
|
|
|
#logo {
|
|
|
|
height: 30px;
|
|
|
|
}
|
2019-05-30 12:04:14 +02:00
|
|
|
</style>
|