2019-04-03 00:25:12 +02:00
|
|
|
<template lang="pug">
|
2020-07-25 21:41:22 +02:00
|
|
|
v-app-bar(app)
|
|
|
|
|
|
|
|
//- logo, title and description
|
|
|
|
v-list-item(:to='$route.name==="index"?"/about":"/"')
|
|
|
|
v-list-item-avatar(tile)
|
|
|
|
v-img(src='/logo.png')
|
|
|
|
v-list-item-content.d-none.d-sm-flex
|
|
|
|
v-list-item-title
|
|
|
|
h2 {{settings.title}}
|
|
|
|
v-list-item-subtitle {{settings.description}}
|
|
|
|
|
|
|
|
v-spacer
|
|
|
|
|
2020-10-16 14:47:18 +02:00
|
|
|
v-tooltip(bottom) {{$t('common.add_event')}}
|
2020-07-25 21:41:22 +02:00
|
|
|
template(v-slot:activator='{ on }')
|
2021-07-15 23:40:58 +02:00
|
|
|
v-btn(v-if='could_add' icon nuxt to='/add' v-on='on' :aria-label='$t("common.add_event")')
|
2021-01-22 21:16:22 +01:00
|
|
|
v-icon(large color='primary') mdi-plus
|
2020-07-25 21:41:22 +02:00
|
|
|
|
|
|
|
v-tooltip(bottom) {{$t('common.share')}}
|
|
|
|
template(v-slot:activator='{ on }')
|
2021-07-15 23:40:58 +02:00
|
|
|
v-btn(icon nuxt to='/export' v-on='on' :aria-label='$t("common.share")')
|
2020-07-25 21:41:22 +02:00
|
|
|
v-icon mdi-share-variant
|
|
|
|
|
2021-01-11 00:17:56 +01:00
|
|
|
v-tooltip(v-if='!$auth.loggedIn' bottom) {{$t('common.login')}}
|
|
|
|
template(v-slot:activator='{ on }')
|
2021-07-15 23:40:58 +02:00
|
|
|
v-btn(icon nuxt to='/login' v-on='on' :aria-label='$t("common.login")')
|
2021-01-11 00:17:56 +01:00
|
|
|
v-icon mdi-login
|
2020-07-25 21:41:22 +02:00
|
|
|
|
|
|
|
v-menu(v-else
|
|
|
|
offset-y bottom open-on-hover transition="slide-y-transition")
|
|
|
|
template(v-slot:activator="{ on, attrs }")
|
2021-07-15 23:40:58 +02:00
|
|
|
v-btn(icon v-bind='attrs' v-on='on' aria-label='Menu')
|
2020-07-25 21:41:22 +02:00
|
|
|
v-icon mdi-dots-vertical
|
|
|
|
v-list
|
|
|
|
v-list-item(nuxt to='/settings')
|
|
|
|
v-list-item-icon
|
|
|
|
v-icon mdi-cog
|
|
|
|
v-list-item-content
|
|
|
|
v-list-item-title {{$t('common.settings')}}
|
|
|
|
|
|
|
|
v-list-item(v-if='$auth.user.is_admin' nuxt to='/admin')
|
|
|
|
v-list-item-icon
|
|
|
|
v-icon mdi-account
|
|
|
|
v-list-item-content
|
|
|
|
v-list-item-title {{$t('common.admin')}}
|
|
|
|
|
|
|
|
v-list-item(@click='logout')
|
|
|
|
v-list-item-icon
|
|
|
|
v-icon mdi-logout
|
|
|
|
v-list-item-content
|
|
|
|
v-list-item-title {{$t('common.logout')}}
|
|
|
|
|
2021-07-15 23:40:58 +02:00
|
|
|
v-btn(icon v-clipboard:copy='feedLink' v-clipboard:success='copyLink' aria-label='RSS')
|
2020-07-25 21:41:22 +02:00
|
|
|
v-icon(color='orange') mdi-rss
|
|
|
|
|
2019-04-03 00:25:12 +02:00
|
|
|
</template>
|
|
|
|
<script>
|
2019-06-25 01:05:38 +02:00
|
|
|
import { mapState } from 'vuex'
|
2019-05-30 12:04:14 +02:00
|
|
|
|
2019-04-03 00:25:12 +02:00
|
|
|
export default {
|
|
|
|
name: 'Nav',
|
2019-06-25 01:05:38 +02:00
|
|
|
computed: {
|
2020-06-05 23:04:12 +02:00
|
|
|
...mapState(['filters', 'settings']),
|
|
|
|
feedLink () {
|
2020-10-17 00:41:21 +02:00
|
|
|
const tags = this.filters.tags && this.filters.tags.join(',')
|
|
|
|
const places = this.filters.places && this.filters.places.join(',')
|
2020-06-05 23:04:12 +02:00
|
|
|
let query = ''
|
|
|
|
if (tags || places) {
|
|
|
|
query = '?'
|
|
|
|
if (tags) {
|
|
|
|
query += 'tags=' + tags
|
|
|
|
if (places) { query += '&places=' + places }
|
|
|
|
} else {
|
|
|
|
query += 'places=' + places
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return `${this.settings.baseurl}/feed/rss${query}`
|
|
|
|
},
|
2019-06-25 01:05:38 +02:00
|
|
|
could_add () {
|
|
|
|
return (this.$auth.loggedIn || this.settings.allow_anon_event)
|
2020-07-25 21:41:22 +02:00
|
|
|
}
|
2019-06-25 01:05:38 +02:00
|
|
|
},
|
2019-05-30 12:04:14 +02:00
|
|
|
methods: {
|
2019-11-06 11:21:44 +01:00
|
|
|
copyLink () {
|
2020-10-07 11:12:13 +02:00
|
|
|
this.$root.$message('common.feed_url_copied')
|
2019-11-06 11:21:44 +01:00
|
|
|
},
|
2019-05-30 12:04:14 +02:00
|
|
|
logout () {
|
2020-10-07 11:12:13 +02:00
|
|
|
this.$root.$message('common.logout_ok')
|
2019-05-30 12:04:14 +02:00
|
|
|
this.$auth.logout()
|
2020-03-14 18:45:20 +01:00
|
|
|
},
|
|
|
|
async createTrustedInstance () {
|
|
|
|
let url = this.instance_url
|
|
|
|
if (!url.match(/^https?:\/\//)) {
|
|
|
|
url = `https://${url}`
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
const instance = await this.$axios.$get(`${url}/.well-known/nodeinfo/2.0`)
|
|
|
|
const trusted_instance = {
|
|
|
|
url,
|
|
|
|
name: instance.metadata.nodeName,
|
|
|
|
description: instance.metadata.nodeDescription,
|
|
|
|
place: instance.metadata.placeDescription
|
|
|
|
}
|
|
|
|
this.setSetting({ key: 'trusted_instances', value: this.settings.trusted_instances.concat(trusted_instance) })
|
|
|
|
} catch (e) {
|
2020-10-07 11:12:13 +02:00
|
|
|
this.$root.$message(e, { color: 'error' })
|
2020-03-14 18:45:20 +01:00
|
|
|
}
|
2020-06-04 23:33:45 +02:00
|
|
|
}
|
2019-05-30 12:04:14 +02:00
|
|
|
}
|
2019-04-03 00:25:12 +02:00
|
|
|
}
|
|
|
|
</script>
|