v1.18.x
barisusakli 9 years ago
parent b8687b53bd
commit bb05e6e393

@ -2,6 +2,7 @@
{ {
"name": "Announcements", "name": "Announcements",
"description": "Announcements regarding our community", "description": "Announcements regarding our community",
"descriptionParsed": "<p>Announcements regarding our community</p>\n",
"bgColor": "#fda34b", "bgColor": "#fda34b",
"color": "#fff", "color": "#fff",
"icon" : "fa-bullhorn", "icon" : "fa-bullhorn",
@ -10,6 +11,7 @@
{ {
"name": "General Discussion", "name": "General Discussion",
"description": "A place to talk about whatever you want", "description": "A place to talk about whatever you want",
"descriptionParsed": "<p>A place to talk about whatever you want</p>\n",
"bgColor": "#59b3d0", "bgColor": "#59b3d0",
"color": "#fff", "color": "#fff",
"icon" : "fa-comments-o", "icon" : "fa-comments-o",
@ -18,6 +20,7 @@
{ {
"name": "Blogs", "name": "Blogs",
"description": "Blog posts from individual members", "description": "Blog posts from individual members",
"descriptionParsed": "<p>Blog posts from individual members</p>\n",
"bgColor": "#86ba4b", "bgColor": "#86ba4b",
"color": "#fff", "color": "#fff",
"icon" : "fa-newspaper-o", "icon" : "fa-newspaper-o",
@ -26,6 +29,7 @@
{ {
"name": "Comments & Feedback", "name": "Comments & Feedback",
"description": "Got a question? Ask away!", "description": "Got a question? Ask away!",
"descriptionParsed": "<p>Got a question? Ask away!</p>\n",
"bgColor": "#e95c5a", "bgColor": "#e95c5a",
"color": "#fff", "color": "#fff",
"icon" : "fa-question", "icon" : "fa-question",

@ -28,6 +28,7 @@ module.exports = function(Categories) {
cid: cid, cid: cid,
name: data.name, name: data.name,
description: data.description ? data.description : '', description: data.description ? data.description : '',
descriptionParsed: data.descriptionParsed ? data.descriptionParsed : '',
icon: data.icon ? data.icon : '', icon: data.icon ? data.icon : '',
bgColor: data.bgColor || colours[0], bgColor: data.bgColor || colours[0],
color: data.color || colours[1], color: data.color || colours[1],
@ -52,7 +53,12 @@ module.exports = function(Categories) {
async.series([ async.series([
async.apply(db.setObject, 'category:' + category.cid, category), async.apply(db.setObject, 'category:' + category.cid, category),
async.apply(Categories.parseDescription, category.cid, category.description), function (next) {
if (category.descriptionParsed) {
return next();
}
Categories.parseDescription(category.cid, category.description, next);
},
async.apply(db.sortedSetAdd, 'categories:cid', category.order, category.cid), async.apply(db.sortedSetAdd, 'categories:cid', category.order, category.cid),
async.apply(db.sortedSetAdd, 'cid:' + parentCid + ':children', category.order, category.cid), async.apply(db.sortedSetAdd, 'cid:' + parentCid + ':children', category.order, category.cid),
async.apply(privileges.categories.give, defaultPrivileges, category.cid, 'administrators'), async.apply(privileges.categories.give, defaultPrivileges, category.cid, 'administrators'),

Loading…
Cancel
Save