Vulcan/packages/example-forum/lib/modules/notifications/custom_fields.js

67 lines
1.5 KiB
JavaScript
Raw Normal View History

2017-09-04 21:05:13 +09:00
import Users from 'meteor/vulcan:users';
const notificationsGroup = {
name: "notifications",
order: 2
};
// Add notifications options to user profile settings
Users.addField([
{
fieldName: 'notifications_users',
fieldSchema: {
label: 'New users',
type: Boolean,
optional: true,
defaultValue: false,
control: "checkbox",
viewableBy: ['guests'],
insertableBy: ['admins'],
editableBy: ['admins'],
group: notificationsGroup,
}
},
{
fieldName: 'notifications_posts',
fieldSchema: {
label: 'New posts',
type: Boolean,
optional: true,
defaultValue: false,
control: "checkbox",
viewableBy: ['guests'],
insertableBy: ['members'],
editableBy: ['members'],
group: notificationsGroup,
}
},
{
fieldName: 'notifications_comments',
fieldSchema: {
label: 'Comments on my posts',
type: Boolean,
optional: true,
defaultValue: false,
control: "checkbox",
viewableBy: ['guests'],
insertableBy: ['members'],
editableBy: ['members'],
group: notificationsGroup,
}
},
{
fieldName: 'notifications_replies',
fieldSchema: {
label: 'Replies to my comments',
type: Boolean,
optional: true,
defaultValue: false,
control: "checkbox",
viewableBy: ['guests'],
insertableBy: ['members'],
editableBy: ['members'],
group: notificationsGroup,
}
}
]);