2016-06-23 15:00:58 +09:00
|
|
|
import Users from 'meteor/nova:users';
|
|
|
|
|
2016-06-03 11:03:36 +09:00
|
|
|
const notificationsGroup = {
|
|
|
|
name: "notifications",
|
|
|
|
order: 2
|
|
|
|
};
|
2016-04-01 12:38:50 +09:00
|
|
|
|
|
|
|
// Add notifications options to user profile settings
|
2016-11-22 18:39:50 -05:00
|
|
|
Users.addField([
|
|
|
|
{
|
|
|
|
fieldName: '__notifications_users',
|
|
|
|
fieldSchema: {
|
|
|
|
label: 'New users',
|
|
|
|
type: Boolean,
|
|
|
|
optional: true,
|
|
|
|
defaultValue: false,
|
|
|
|
control: "checkbox",
|
2016-12-06 10:55:47 +01:00
|
|
|
viewableBy: ['guests'],
|
|
|
|
insertableBy: ['admins'],
|
|
|
|
editableBy: ['admins'],
|
2016-11-22 18:39:50 -05:00
|
|
|
group: notificationsGroup
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldName: '__notifications_posts',
|
|
|
|
fieldSchema: {
|
|
|
|
label: 'New posts',
|
|
|
|
type: Boolean,
|
|
|
|
optional: true,
|
|
|
|
defaultValue: false,
|
|
|
|
control: "checkbox",
|
2016-12-06 10:55:47 +01:00
|
|
|
viewableBy: ['guests'],
|
|
|
|
insertableBy: ['members'],
|
|
|
|
editableBy: ['members'],
|
2016-11-22 18:39:50 -05:00
|
|
|
group: notificationsGroup
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]);
|
2016-05-09 13:32:34 +09:00
|
|
|
|
2016-11-22 18:39:50 -05:00
|
|
|
if (typeof Comments !== "undefined") {
|
|
|
|
Users.addField([
|
|
|
|
{
|
|
|
|
fieldName: '__notifications_comments',
|
|
|
|
fieldSchema: {
|
|
|
|
label: 'Comments on my posts',
|
|
|
|
type: Boolean,
|
|
|
|
optional: true,
|
|
|
|
defaultValue: true,
|
|
|
|
control: "checkbox",
|
2016-12-06 10:55:47 +01:00
|
|
|
viewableBy: ['guests'],
|
|
|
|
insertableBy: ['members'],
|
|
|
|
editableBy: ['members']
|
2016-11-22 18:39:50 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldName: '__notifications_replies',
|
|
|
|
fieldSchema: {
|
|
|
|
label: 'Replies to my comments',
|
|
|
|
type: Boolean,
|
|
|
|
optional: true,
|
|
|
|
defaultValue: true,
|
|
|
|
control: "checkbox",
|
2016-12-06 10:55:47 +01:00
|
|
|
viewableBy: ['guests'],
|
|
|
|
insertableBy: ['members'],
|
|
|
|
editableBy: ['members']
|
2016-11-22 18:39:50 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
}
|