2016-06-28 17:33:30 +09:00
|
|
|
import Posts from "meteor/nova:posts";
|
2016-07-11 11:47:00 +09:00
|
|
|
import PublicationUtils from 'meteor/utilities:smart-publications';
|
2016-06-28 17:33:30 +09:00
|
|
|
|
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,
|
2016-10-05 08:43:13 +02:00
|
|
|
form: {
|
2016-05-31 10:53:23 +09:00
|
|
|
group: 'cloudinary'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldName: 'cloudinaryAPIKey',
|
|
|
|
fieldSchema: {
|
|
|
|
type: String,
|
|
|
|
optional: true,
|
|
|
|
private: true,
|
2016-10-05 08:43:13 +02:00
|
|
|
form: {
|
2016-05-31 10:53:23 +09:00
|
|
|
group: 'cloudinary',
|
|
|
|
class: 'private-field'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldName: 'cloudinaryAPISecret',
|
|
|
|
fieldSchema: {
|
|
|
|
type: String,
|
|
|
|
optional: true,
|
|
|
|
private: true,
|
2016-10-05 08:43:13 +02:00
|
|
|
form: {
|
2016-05-31 10:53:23 +09:00
|
|
|
group: 'cloudinary',
|
|
|
|
class: 'private-field'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]);
|
2016-07-11 11:47:00 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
PublicationUtils.addToFields(Posts.publishedFields.list, ["cloudinaryId", "cloudinaryUrls"]);
|