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> <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-btn icon @click="reload()">
<v-img src="@/assets/logo-64.png" contain height="40"></v-img> <v-img src="@/assets/logo-64.png" contain height="40"></v-img>
</v-btn> </v-btn>
<v-toolbar-title>Flaschengeist</v-toolbar-title> <v-toolbar-title>Flaschengeist</v-toolbar-title>
<v-spacer /> <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-icon>{{ attach_money }}</v-icon>
</v-btn> </v-btn>
<v-btn icon v-if="isGastro" disabled> <v-btn icon v-if="isGastro" :disabled="locked">
<v-icon>{{ gastro }}</v-icon> <v-icon>{{ gastro }}</v-icon>
</v-btn> </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-icon>{{ local_bar }}</v-icon>
</v-btn> </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-icon>{{ person }}</v-icon>
</v-btn> </v-btn>
<v-btn icon :to="{name: 'priceListNoLogin'}"> <v-btn icon @click="goTo('priceListNoLogin')">
<v-icon>{{ list }}</v-icon> <v-icon>{{ list }}</v-icon>
</v-btn> </v-btn>
</v-app-bar> </v-app-bar>
@ -25,7 +38,14 @@
<script> <script>
import { mapActions, mapGetters } from 'vuex' 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 { export default {
name: 'TitleBar', name: 'TitleBar',
@ -35,21 +55,30 @@ export default {
local_bar: mdiGlassCocktail, local_bar: mdiGlassCocktail,
person: mdiAccount, person: mdiAccount,
list: mdiFileMultiple, list: mdiFileMultiple,
gastro: mdiFoodForkDrink gastro: mdiFoodForkDrink,
back: mdiArrowLeftBoldCircle
} }
}, },
computed: { computed: {
...mapGetters(['isBar', 'isFinanzer', 'isUser', 'isLoggedIn', 'isGastro']) ...mapGetters(['isBar', 'isFinanzer', 'isUser', 'isLoggedIn', 'isGastro']),
...mapGetters({locked: 'barUsers/locked'}),
getRouteName() {
return this.$route.name
}
}, },
methods: { methods: {
...mapActions(['logout']), ...mapActions(['logout']),
reload() { reload() {
location.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> </script>
<style scoped> <style scoped></style>
</style>

View File

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

View File

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