Vulcan/packages/nova-cloudinary/lib/custom_fields.js

62 lines
1.2 KiB
JavaScript
Raw Normal View History

import Posts from "meteor/nova:posts";
2016-07-11 11:47:00 +09:00
import PublicationUtils from 'meteor/utilities:smart-publications';
2016-05-31 10:53:23 +09:00
Posts.addField([
{
2016-07-11 11:47:00 +09:00
fieldName: 'cloudinaryId',
2016-05-31 10:53:23 +09:00
fieldSchema: {
type: String,
optional: true
}
2016-07-11 11:47:00 +09:00
},
{
fieldName: 'cloudinaryUrls',
fieldSchema: {
type: [Object],
optional: true,
blackbox: true
}
2016-05-31 10:53:23 +09:00
}
]);
if (typeof Settings !== "undefined") {
Settings.addField([
{
fieldName: 'cloudinaryCloudName',
fieldSchema: {
type: String,
optional: true,
autoform: {
group: 'cloudinary'
}
}
},
{
fieldName: 'cloudinaryAPIKey',
fieldSchema: {
type: String,
optional: true,
private: true,
autoform: {
group: 'cloudinary',
class: 'private-field'
}
}
},
{
fieldName: 'cloudinaryAPISecret',
fieldSchema: {
type: String,
optional: true,
private: true,
autoform: {
group: 'cloudinary',
class: 'private-field'
}
}
}
]);
2016-07-11 11:47:00 +09:00
}
PublicationUtils.addToFields(Posts.publishedFields.list, ["cloudinaryId", "cloudinaryUrls"]);