2015-05-17 15:38:02 +09:00
|
|
|
Posts.addField(
|
2015-04-22 07:50:11 +09:00
|
|
|
{
|
2015-05-10 14:36:47 +09:00
|
|
|
fieldName: 'categories',
|
|
|
|
fieldSchema: {
|
2015-04-22 07:50:11 +09:00
|
|
|
type: [String],
|
|
|
|
optional: true,
|
2015-04-28 17:15:53 +09:00
|
|
|
editableBy: ["member", "admin"],
|
2015-04-22 07:50:11 +09:00
|
|
|
autoform: {
|
|
|
|
noselect: true,
|
2015-08-07 11:17:03 +09:00
|
|
|
type: "bootstrap-category",
|
2015-10-20 14:34:24 +09:00
|
|
|
order: 50,
|
2015-04-22 07:50:11 +09:00
|
|
|
options: function () {
|
|
|
|
var categories = Categories.find().map(function (category) {
|
|
|
|
return {
|
|
|
|
value: category._id,
|
|
|
|
label: category.name
|
2015-05-01 18:22:00 +02:00
|
|
|
};
|
2015-04-22 07:50:11 +09:00
|
|
|
});
|
|
|
|
return categories;
|
|
|
|
}
|
2016-02-17 19:39:43 +09:00
|
|
|
},
|
|
|
|
join: {
|
|
|
|
joinAs: "categoriesArray",
|
|
|
|
collection: "Categories"
|
2015-04-22 07:50:11 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
2016-02-17 11:28:00 +09:00
|
|
|
|
2016-02-17 12:54:18 +09:00
|
|
|
Telescope.utils.addToFields(Posts.publishedFields.list, ["categories"]);
|
|
|
|
Telescope.utils.addToFields(Posts.publishedFields.single, ["categories"]);
|