Skip to content

Commit f57459d

Browse files
updated resource and added fontawesome to dependencies
1 parent fa7e5ff commit f57459d

4 files changed

Lines changed: 57 additions & 14 deletions

File tree

generator/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module.exports = (api, options) => {
66
'axios': '^0.18.0',
77
'vuex': '^3.1.0',
88
'vuex-persistedstate': '^2.5.4',
9+
'@fortawesome/fontawesome-pro': '^5.8.1',
910
},
1011
});
1112
if (options.useCrud) {
@@ -37,7 +38,7 @@ module.exports = (api, options) => {
3738

3839
if (options.useCrud) {
3940
helpers.updateFile(api, api.entryFile, lines => {
40-
const vueImportIndex = lines.findIndex(line => line.match(/^import Vue/));
41+
const vueImportIndex = lines.findIndex(line => line.match(/^plugins/));
4142
const newVueIndex = lines.findIndex(line => line.match(/^new Vue/));
4243

4344
lines.splice(vueImportIndex + 1, 0, 'import API from \'./API.js\';');

generator/templates/Crud/src/Components/forms/User.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
label="Naam"
1313
required
1414
v-model="values.name"></v-text-field>
15+
<v-text-field
16+
:counter="150"
17+
:rules="[(v) => !!v || 'E-mail is verplicht', v => serverError('name', v), (v) => !!v && v.length <= 100 || 'het e-mailadres mag maximaal 150 tekens bevatten']"
18+
label="E-mail"
19+
hint="Het e-mailadres waarmee de gebruiker gaat inloggen en waarnaar een mail verzonden wordt met instructies om een wachtwoord aan te maken"
20+
required
21+
v-model="values.email"></v-text-field>
1522
</v-card-text>
1623
</v-card>
1724
</v-form>

generator/templates/Crud/src/Views/UserResource.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
name: 'user-resource',
99
data() {
1010
return {
11+
meta: {name: 'gebruiker', namePlural: 'gebruikers'},
1112
selected: null,
1213
resourceUri: 'user',
1314
tableContent: [
@@ -17,6 +18,12 @@
1718
sortable: true,
1819
value: 'name',
1920
},
21+
{
22+
text: 'E-mail',
23+
align: 'left',
24+
sortable: true,
25+
value: 'email',
26+
},
2027
],
2128
createFormComponent: UserForm,
2229
updateFormComponent: UserForm
Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,62 @@
11
<template>
22
<div id="app">
3-
<v-app class="primary" id="inspire">
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>
419
<v-content>
5-
<v-container>
6-
<v-content>
7-
<router-view/>
8-
</v-content>
9-
</v-container>
20+
<router-view/>
1021
</v-content>
22+
<v-footer app color="primary" inset>
23+
<span class="white--text pl-3">Created by Kings Code</span>
24+
</v-footer>
1125
</v-app>
1226
</div>
1327
</template>
1428

1529
<script>
30+
import ProfileMenu from './../components/ProfileMenu.vue';
31+
import MainMenu from './../components/MainMenu.vue';
1632
1733
export default {
18-
components: {},
19-
watch: {},
20-
props: [],
2134
name: 'template-default',
35+
components: {ProfileMenu, MainMenu},
2236
data() {
23-
return {};
37+
return {
38+
menu: true,
39+
};
2440
},
25-
created() {
26-
41+
beforeCreate() {
42+
if (!this.$store.getters['Authorization/isLoggedIn']) {
43+
this.$router.push({name: 'login'});
44+
}
2745
},
28-
methods: {},
2946
};
3047
</script>
3148

3249
<style scoped lang="scss">
3350
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+
}
3462
</style>

0 commit comments

Comments
 (0)