-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
74 lines (74 loc) · 1.65 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
module.exports = {
name: 'pk-people',
label: 'Person',
pluralLabel: 'People',
extend: 'apostrophe-pieces',
moogBundle: {
modules: ['pk-people-pages', 'pk-people-widgets'],
directory: 'lib/modules'
},
beforeConstruct: (self, options) => {
options.contextual = true;
options.addFields = [
{
name: 'firstName',
label: 'First Name',
type: 'string'
},
{
name: 'lastName',
label: 'Last Name',
type: 'string'
},
{
name: 'title',
label: 'Full Name',
type: 'string',
required: true,
help: 'Automatically generated from first and last name, but feel free to edit.'
},
{
name: 'image',
label: 'Image',
type: 'singleton',
widgetType: 'apostrophe-images',
options: {
limit: 1
}
},
{
name: 'position',
label: 'Position/Job Title',
type: 'string'
},
{
name: 'email',
label: 'Email',
type: 'string'
},
{
name: 'tel',
label: 'Telephone Number',
type: 'string'
},
{
name: 'summary',
label: 'Summary/Bio',
type: 'string',
textarea: true
}
].concat(options.addFields || []);
options.arrangeFields = [
{
name: 'basics',
label: 'Basics',
fields: [ 'firstName', 'lastName', 'title', 'image', 'position', 'email', 'tel', 'summary' ]
},
{
name: 'admin',
label: 'Admin',
fields: [ 'slug', 'tags', 'published' ]
}
].concat(options.arrangeFields || []);
}
};