zurück button für priceliste, außerdem wurden alle links korrigiert. Links rechts oben wurden erweitert und können nun auch verwendet werden.

This commit is contained in:
Tim Gröger 2020-06-08 16:43:01 +02:00
parent b97acbef14
commit 5615fea376
3 changed files with 65 additions and 34 deletions

View File

@ -1,23 +1,36 @@
<template>
<v-app-bar app clipped-left clipped-right color="blue accent-4" class="elevation-4" dark dense>
<v-app-bar
app
clipped-left
clipped-right
color="blue accent-4"
class="elevation-4"
dark
dense
>
<v-btn icon @click="reload()">
<v-img src="@/assets/logo-64.png" contain height="40"></v-img>
</v-btn>
<v-toolbar-title>Flaschengeist</v-toolbar-title>
<v-spacer />
<v-btn icon v-if="isFinanzer" disabled>
<v-btn icon v-if="getRouteName == 'priceListNoLogin'" @click="goHome()">
<v-icon>
{{ back }}
</v-icon>
</v-btn>
<v-btn icon v-if="isFinanzer" :disabled="locked" @click="goTo('overview')">
<v-icon>{{ attach_money }}</v-icon>
</v-btn>
<v-btn icon v-if="isGastro" disabled>
<v-btn icon v-if="isGastro" :disabled="locked">
<v-icon>{{ gastro }}</v-icon>
</v-btn>
<v-btn icon v-if="isBar" :to="{name: 'geruecht'}">
<v-btn icon v-if="isBar" @click="goTo('geruecht')">
<v-icon>{{ local_bar }}</v-icon>
</v-btn>
<v-btn icon v-if="isUser" disabled>
<v-btn icon v-if="isUser" :disabled="locked" @click="goTo('add')">
<v-icon>{{ person }}</v-icon>
</v-btn>
<v-btn icon :to="{name: 'priceListNoLogin'}">
<v-btn icon @click="goTo('priceListNoLogin')">
<v-icon>{{ list }}</v-icon>
</v-btn>
</v-app-bar>
@ -25,7 +38,14 @@
<script>
import { mapActions, mapGetters } from 'vuex'
import { mdiCurrencyEur, mdiGlassCocktail, mdiAccount, mdiFileMultiple, mdiFoodForkDrink } from '@mdi/js'
import {
mdiCurrencyEur,
mdiGlassCocktail,
mdiAccount,
mdiFileMultiple,
mdiFoodForkDrink,
mdiArrowLeftBoldCircle
} from '@mdi/js'
export default {
name: 'TitleBar',
@ -35,21 +55,30 @@ export default {
local_bar: mdiGlassCocktail,
person: mdiAccount,
list: mdiFileMultiple,
gastro: mdiFoodForkDrink
gastro: mdiFoodForkDrink,
back: mdiArrowLeftBoldCircle
}
},
computed: {
...mapGetters(['isBar', 'isFinanzer', 'isUser', 'isLoggedIn', 'isGastro'])
...mapGetters(['isBar', 'isFinanzer', 'isUser', 'isLoggedIn', 'isGastro']),
...mapGetters({locked: 'barUsers/locked'}),
getRouteName() {
return this.$route.name
}
},
methods: {
...mapActions(['logout']),
reload() {
location.reload()
}
},
goTo(name) {
this.$router.push({name: name})
},
goHome() {
window.history.length > 1 ? this.$router.go(-1) : this.$router.push({name: 'main'})
}
}
}
</script>
<style scoped>
</style>
<style scoped></style>

View File

@ -71,6 +71,7 @@
:items="users"
:search="search"
:loading="usersLoading || statusLoading"
:items-per-page="100"
>
<template v-slot:top>
<v-toolbar flat color="white">
@ -286,9 +287,10 @@ export default {
}),
computeStatus() {
return id => {
return this.status.find(a => {
let status = this.status.find(a => {
return a.id === id
}).name
})
return status ? status.name : null
}
},
allVotings() {

View File

@ -169,36 +169,36 @@ const router = new VueRouter({
router.beforeEach((to, from, next) => {
store.dispatch('fetchAccessToken')
if (to.fullPath.includes('/main')) {
if (to.fullPath.includes('/main/finanzer')) {
if (to.name === 'main') {
if (to.name ==='finanzer' || to.name === 'overview' || to.name === 'activeUser') {
if (!store.state.login.user.group.includes('moneymaster')) {
next('/login')
next({name: 'login'})
}
}
if (to.fullPath.includes('/main/bar')) {
if (to.name === 'bar' || to.name === 'geruecht') {
if (!store.state.login.user.group.includes('bar')) {
next('/login')
next({name: 'login'})
}
}
if (to.fullPath.includes('/main/user')) {
if (to.name === 'user' || to.name === 'userOverview' || to.name === 'userConfig' || to.name === 'userJobs' || to.name === 'jobRequests') {
if (!store.state.login.user.group.includes('user')) {
next('/login')
next({name: 'login'})
}
}
if (!store.state.login.user.accessToken) {
next('/login')
next({name: 'login'})
}
}
if (to.fullPath === '/login') {
if (to.name === 'login') {
if (store.state.login.user.accessToken) {
if (store.state.login.user.group.includes('moneymaster')) {
next('/main/finanzer/overview')
next({name: 'overview'})
} else if (store.state.login.user.group.includes('bar')) {
next('/main/bar/geruecht')
next({name: 'geruecht'})
} else if (store.state.login.user.group.includes('user')) {
next('/main/user/add')
next({name: 'add'})
} else if (store.state.login.user.group.includes('extern')) {
next('/main')
next({name: 'main'})
}
}
}