-
Notifications
You must be signed in to change notification settings - Fork 4
/
blog.js
49 lines (47 loc) · 922 Bytes
/
blog.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
Blog = new orion.collection('blog', {
singularName: 'blog',
pluralName: 'blogs',
link: {
title: 'Blog Posts'
},
tabular: {
columns: [
{
data: "title",
title: "Title"
},{
data: "author",
title: "Author"
},{
data: "date",
title: "Event Date"
},
orion.attributeColumn('createdAt', 'time', 'Submitted')
]
}
});
Blog.attachSchema(new SimpleSchema ({
title: {
type: String,
optional: false,
label: 'Post Title'
},
author: {
type: String,
optional: false,
label: 'Author'
},
date: {
type: String,
optional: false,
label: 'Date'
},
entry: orion.attribute('summernote', {
label: 'Entry'
}),
time: orion.attribute('createdAt')
}));
Blog.allow({
update: function(userId, post) { return ownsDocument(userId, post); },
remove: function(userId, post) { return ownsDocument(userId, post); },
});