Skip to content

Commit 97ee91c

Browse files
added default template
1 parent 30679d8 commit 97ee91c

3 files changed

Lines changed: 191 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<template>
2+
<div id="app">
3+
<v-app id="inspire" v-if="$store.getters['Authorization/isLoggedIn']">
4+
<v-navigation-drawer
5+
app
6+
fixed
7+
v-model="menu"
8+
>
9+
<img :src="require('../assets/logo.png')" @click="$router.push({name: 'home'})" class="logo">
10+
<v-divider class="mt-4"/>
11+
<main-menu/>
12+
</v-navigation-drawer>
13+
<v-toolbar app color="primary" dark mfixed>
14+
<v-toolbar-side-icon @click.stop="menu = !menu"></v-toolbar-side-icon>
15+
<v-toolbar-title>Beheer</v-toolbar-title>
16+
<v-spacer/>
17+
<profile-menu></profile-menu>
18+
</v-toolbar>
19+
<v-content>
20+
<router-view/>
21+
</v-content>
22+
<v-footer app color="primary" inset>
23+
<span class="white--text pl-3">Created by Kings Code</span>
24+
</v-footer>
25+
</v-app>
26+
</div>
27+
</template>
28+
29+
<script>
30+
import ProfileMenu from './components/ProfileMenu.vue';
31+
import MainMenu from './components/MainMenu.vue';
32+
33+
export default {
34+
name: 'template-default',
35+
components: {ProfileMenu, MainMenu},
36+
data() {
37+
return {
38+
menu: true,
39+
};
40+
},
41+
beforeCreate() {
42+
if (!this.$store.getters['Authorization/isLoggedIn']) {
43+
this.$router.push({name: 'login'});
44+
}
45+
},
46+
};
47+
</script>
48+
49+
<style scoped lang="scss">
50+
51+
.logo {
52+
display: block;
53+
margin: 30px auto;
54+
width: 50%;
55+
cursor: pointer;
56+
}
57+
</style>
58+
<style lang="scss">
59+
.v-dialog--fullscreen > .v-card.v-sheet.theme--light {
60+
background: rgb(248, 249, 250);
61+
}
62+
</style>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<template>
2+
<v-list>
3+
<div
4+
:key="item.title"
5+
v-for="item in items">
6+
<v-list-group
7+
:disabled="item.disabled"
8+
:prepend-icon="item.icon"
9+
@click="routeTo(item.route)"
10+
no-icon
11+
v-if="typeof item.items !== 'undefined'"
12+
v-model="item.active"
13+
>
14+
<v-list-tile @click="routeTo('merchant')" slot="activator">
15+
<v-list-tile-content>
16+
<v-list-tile-title>{{ item.title }}</v-list-tile-title>
17+
</v-list-tile-content>
18+
</v-list-tile>
19+
20+
<v-list-tile
21+
:key="subItem.title"
22+
@click="routeTo(subItem.route)"
23+
24+
v-for="subItem in item.items"
25+
v-model="$route.name === subItem.route"
26+
>
27+
<v-list-tile-action>
28+
<v-icon>{{ subItem.icon }}</v-icon>
29+
</v-list-tile-action>
30+
<v-list-tile-content>
31+
<v-list-tile-title>{{ subItem.title }}</v-list-tile-title>
32+
</v-list-tile-content>
33+
34+
</v-list-tile>
35+
</v-list-group>
36+
<v-list-tile
37+
@click="routeTo(item.route)"
38+
v-else
39+
v-model="$route.name === item.route"
40+
>
41+
<v-list-tile-action>
42+
<v-icon>{{ item.icon }}</v-icon>
43+
</v-list-tile-action>
44+
<v-list-tile-content>
45+
<v-list-tile-title>{{ item.title }}</v-list-tile-title>
46+
</v-list-tile-content>
47+
48+
</v-list-tile>
49+
</div>
50+
51+
</v-list>
52+
</template>
53+
54+
<script>
55+
export default {
56+
name: 'MainMenu',
57+
computed: {
58+
data() {
59+
return {
60+
items: [
61+
{
62+
icon: 'fa-users',
63+
title: 'Gebruikers',
64+
route: 'users',
65+
}
66+
67+
]
68+
};
69+
},
70+
methods: {
71+
routeTo(name) {
72+
this.$router.push({name: name});
73+
}
74+
}
75+
};
76+
</script>
77+
78+
<style scoped>
79+
</style>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<template>
2+
<v-menu
3+
bottom
4+
left
5+
offset-y
6+
transition="slide-y-transition"
7+
>
8+
<v-btn class="mr-3" fab icon slot="activator">
9+
<v-avatar class="accent" size="48" title>
10+
<span class="white--text headline"></span>
11+
</v-avatar>
12+
</v-btn>
13+
<v-list>
14+
<v-list-tile @click="routeTo('profile')">
15+
<v-list-tile-title>Profiel</v-list-tile-title>
16+
</v-list-tile>
17+
<v-list-tile @click="logout">
18+
<v-list-tile-title>Uitloggen</v-list-tile-title>
19+
</v-list-tile>
20+
</v-list>
21+
</v-menu>
22+
</template>
23+
24+
<script>
25+
26+
export default {
27+
components: {},
28+
watch: {},
29+
props: [],
30+
name: 'profile-menu',
31+
data() {
32+
return {};
33+
},
34+
created() {
35+
36+
},
37+
methods: {
38+
routeTo(name) {
39+
this.$router.push({name: name});
40+
},
41+
logout() {
42+
this.$store.dispatch('Authorization/unauthorized');
43+
}
44+
},
45+
};
46+
</script>
47+
48+
<style scoped lang="scss">
49+
50+
</style>

0 commit comments

Comments
 (0)