feat(forums): new feature for oper & admin can set topic to show as home help item or home notice item

#20
This commit is contained in:
OldHawk
2018-01-23 11:37:01 +08:00
parent dbea9d8bb1
commit 428f70417a
10 changed files with 182 additions and 18 deletions

View File

@@ -453,6 +453,42 @@
});
};
/**
* beginHomeHelpTopic
* @param t
*/
vm.beginHomeHelpTopic = function (t) {
var topic = new TopicsService({
forum: vm.forum._id,
_id: t._id
});
topic.$toggleTopicHomeHelpStatus(function (res) {
vm.topic = res;
NotifycationService.showSuccessNotify('FORUMS.TOPIC_TOGGLE_HOME_HELP_SUCCESSFULLY');
}, function (res) {
NotifycationService.showErrorNotify(res.data.message, 'FORUMS.TOPIC_TOGGLE_HOME_HELP_FAILED');
});
};
/**
* beginHomeNoticeTopic
* @param t
*/
vm.beginHomeNoticeTopic = function (t) {
var topic = new TopicsService({
forum: vm.forum._id,
_id: t._id
});
topic.$toggleTopicHomeNoticeStatus(function (res) {
vm.topic = res;
NotifycationService.showSuccessNotify('FORUMS.TOPIC_TOGGLE_HOME_NOTICE_SUCCESSFULLY');
}, function (res) {
NotifycationService.showErrorNotify(res.data.message, 'FORUMS.TOPIC_TOGGLE_HOME_NOTICE_FAILED');
});
};
/**
* beginDeleteReply
* @param reply