Skip to content

Commit cbb4c0c

Browse files
Merge pull request #49 from what-crud/issue/32_add_cms_example
Issue/32 add cms example
2 parents ae378c1 + 1bfdbff commit cbb4c0c

File tree

21 files changed

+150
-105
lines changed

21 files changed

+150
-105
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<h1 align="center">Vue CRUD</h1>
55
<div align="center">
66
<a><img alt="license" src="https://img.shields.io/badge/license-MIT-brightgreen.svg"></a>
7-
<a><img alt="version" src="https://img.shields.io/badge/version-v0.11.0-yellow.svg"></a>
7+
<a><img alt="version" src="https://img.shields.io/badge/version-v0.12.0-yellow.svg"></a>
88
<a><img alt="build" src="https://travis-ci.org/what-crud/vue-crud.svg?branch=master"></a>
99
<a><img alt="PRs" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg"></a>
1010
</div>
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// custom modules
22
import administration from '@/routes/app/routes/administration/store/'
3-
import crm from '@/routes/app/routes/crm/store/'
3+
import cms from '@/routes/app/routes/cms/store/'
4+
import blog from '@/routes/app/routes/blog/store/'
45

56
export default {
67
administration,
7-
crm
8+
cms,
9+
blog
810
}

examples/cms/locales/pl/profile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,3 @@ export default {
2929
change: 'Zmień hasło'
3030
}
3131
}
32-

examples/cms/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Vue from 'vue'
22
import i18n from './locales/index'
33
import router from './router'
44
import store from './store'
5-
import http from './plugins/http'
5+
import './plugins/http'
66
import './plugins/vuetify'
77
import './plugins/ie'
88
import './plugins/custom/'
@@ -21,7 +21,6 @@ Vue.http.interceptors.push((request, next) => {
2121
})
2222

2323
new Vue({
24-
http,
2524
i18n,
2625
router,
2726
store,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
let mutations = {
2-
2+
33
}
44
export default mutations
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
let state = {
2-
2+
33
}
44

55
export default state

examples/cms/routes/app/routes/cms/routes/settings/Index.vue

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<crud
33
:prefix="prefix"
44
:path="path"
5-
:paths="paths"
65
:page-title="pageTitle"
76
:fields-info="fieldsInfo"
87
:details-title="$t('detailsTitle')"
@@ -17,12 +16,9 @@ import Crud from '@/utils/crud/components/Crud.vue'
1716
export default {
1817
data () {
1918
return {
20-
prefix: 'crud/admin',
21-
path: 'user-permissions',
22-
paths: {
23-
i: 'admin/user-permissions'
24-
},
25-
pageTitle: 'admin.userPermissions'
19+
prefix: 'crud/cms',
20+
path: 'settings',
21+
pageTitle: 'cms.settings'
2622
}
2723
},
2824
computed: {
@@ -35,41 +31,41 @@ export default {
3531
},
3632
{
3733
type: 'select',
38-
url: 'crud/admin/users',
3934
list: {
40-
value: 'id',
41-
text: 'name',
42-
data: []
35+
value: 'name',
36+
text: 'label',
37+
data: [
38+
{
39+
name: 'input',
40+
label: this.$t('fieldTypes.input')
41+
},
42+
{
43+
name: 'textarea',
44+
label: this.$t('fieldTypes.textarea')
45+
},
46+
{
47+
name: 'file',
48+
label: this.$t('fieldTypes.file')
49+
}
50+
]
4351
},
44-
column: 'user_id',
45-
text: this.$t('fields.user'),
46-
name: 'user',
47-
apiObject: {
48-
name: 'user.name'
49-
}
52+
stringId: true,
53+
column: 'type',
54+
text: this.$t('fields.type'),
55+
name: 'type'
5056
},
5157
{
52-
text: this.$t('fields.userEmail'),
53-
name: 'userEmail',
54-
apiObject: {
55-
name: 'user.email'
56-
},
57-
details: false
58+
type: 'input',
59+
column: 'name',
60+
text: this.$t('fields.name'),
61+
name: 'name'
5862
},
5963
{
60-
type: 'select',
61-
url: 'crud/admin/permissions',
62-
list: {
63-
value: 'id',
64-
text: 'name',
65-
data: []
66-
},
67-
column: 'permission_id',
68-
text: this.$t('fields.permission'),
69-
name: 'permission',
70-
apiObject: {
71-
name: 'permission.name'
72-
}
64+
type: 'dynamic',
65+
typeField: 'type',
66+
column: 'value',
67+
text: this.$t('fields.value'),
68+
name: 'value'
7369
}
7470
]
7571
}
@@ -80,23 +76,31 @@ export default {
8076
i18n: {
8177
messages: {
8278
pl: {
83-
detailsTitle: 'Użytkownik - uprawnienie',
79+
detailsTitle: 'Parametr',
8480
fields: {
8581
id: 'Id',
86-
user: 'Użytkownik',
87-
userEmail: 'E-mail użytkownika',
88-
permission: 'Uprawnienie',
89-
permissionCode: 'Kod uprawnienia'
82+
type: 'Typ pola',
83+
name: 'Nazwa parametru',
84+
value: 'Wartość'
85+
},
86+
fieldTypes: {
87+
input: 'Tekst',
88+
textarea: 'Długi tekst',
89+
file: 'Plik'
9090
}
9191
},
9292
en: {
93-
detailsTitle: 'User - permission',
93+
detailsTitle: 'Parameter',
9494
fields: {
9595
id: 'Id',
96-
user: 'User',
97-
userEmail: 'User\'s e-mail',
98-
permission: 'Permission',
99-
permissionCode: 'Permission code'
96+
type: 'Field type',
97+
name: 'Name',
98+
value: 'Value'
99+
},
100+
fieldTypes: {
101+
input: 'Input',
102+
textarea: 'Textarea',
103+
file: 'File'
100104
}
101105
}
102106
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
let mutations = {
2-
2+
33
}
44
export default mutations
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
let state = {
2-
2+
33
}
44

55
export default state
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
let mutations = {
2-
2+
33
}
44
export default mutations

0 commit comments

Comments
 (0)