diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 517bf085..c13d6067 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -1137,6 +1137,10 @@ TOPIC_TOGGLE_TOP_FAILED: 'Toggle set topic top status failed', TOPIC_TOGGLE_GLOBAL_SUCCESSFULLY: 'Toggle set topic global status successfully', TOPIC_TOGGLE_GLOBAL_FAILED: 'Toggle set topic global status failed', + TOPIC_TOGGLE_HOME_HELP_SUCCESSFULLY: 'Toggle set topic home help status successfully', + TOPIC_TOGGLE_HOME_HELP_FAILED: 'Toggle set topic home help status failed', + TOPIC_TOGGLE_HOME_NOTICE_SUCCESSFULLY: 'Toggle set topic home notice status successfully', + TOPIC_TOGGLE_HOME_NOTICE_FAILED: 'Toggle set topic home notice status failed', REPLY_EDIT_SUCCESSFULLY: 'Reply content modify successfully', REPLY_EDIT_FAILED: 'Reply content modify failed', DELETE_TOPIC_SUCCESSFULLY: 'Topic deleted successfully', @@ -1208,6 +1212,8 @@ REPLY_QUOTE: 'quote and reply', REPLY_EDIT: 'edit reply', REPLY_DELETE: 'delete reply', + HOME_HELP: 'show as help at home, current status is: {{status}}', + HOME_NOTICE: 'show as notice at home, current status is: {{status}}', TOPIC_EDIT: 'edit topic', TOPIC_DELETE: 'delete topic', TOPIC_TOP_TOPIC: 'top status', diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 9453be3b..e470dd73 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -1137,6 +1137,10 @@ TOPIC_TOGGLE_TOP_FAILED: '置顶状态切换失败', TOPIC_TOGGLE_GLOBAL_SUCCESSFULLY: '全局状态切换成功', TOPIC_TOGGLE_GLOBAL_FAILED: '全局状态切换失败', + TOPIC_TOGGLE_HOME_HELP_SUCCESSFULLY: '首页帮助条目状态切换成功', + TOPIC_TOGGLE_HOME_HELP_FAILED: '首页帮助条目状态切换失败', + TOPIC_TOGGLE_HOME_NOTICE_SUCCESSFULLY: '首页公告条目状态切换成功', + TOPIC_TOGGLE_HOME_NOTICE_FAILED: '首页公告条目状态切换失败', REPLY_EDIT_SUCCESSFULLY: '回复内容修改成功', REPLY_EDIT_FAILED: '回复内容修改失败', DELETE_TOPIC_SUCCESSFULLY: '话题删除成功', @@ -1208,6 +1212,8 @@ REPLY_QUOTE: '引用并回复', REPLY_EDIT: '编辑回复', REPLY_DELETE: '删除回复', + HOME_HELP: '显示为首页帮助条目, 当前状态为: {{status}}', + HOME_NOTICE: '显示为首页公告条目, 当前状态为: {{status}}', TOPIC_EDIT: '编辑话题', TOPIC_DELETE: '删除话题', TOPIC_TOP_TOPIC: '置顶话题', diff --git a/modules/forums/client/controllers/forums-topic.client.controller.js b/modules/forums/client/controllers/forums-topic.client.controller.js index 9450bbe2..37371a11 100644 --- a/modules/forums/client/controllers/forums-topic.client.controller.js +++ b/modules/forums/client/controllers/forums-topic.client.controller.js @@ -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 diff --git a/modules/forums/client/less/forum.less b/modules/forums/client/less/forum.less index 0032d975..861fd0ec 100644 --- a/modules/forums/client/less/forum.less +++ b/modules/forums/client/less/forum.less @@ -429,6 +429,28 @@ color: darken(@mt-base-color, 10%); } } + .fa-list { + &:after { + content: ""; + display: block; + border-right: solid 1px #bbb; + width: 18px; + height: 16px; + margin-left: 10px; + margin-top: -14px; + } + } + .fa-upload, .fa-download { + &:after { + content: ""; + display: block; + border-right: solid 1px #bbb; + width: 18px; + height: 16px; + margin-left: 10px; + margin-top: -14px; + } + } } } .reply-comment-body { diff --git a/modules/forums/client/services/topics.client.service.js b/modules/forums/client/services/topics.client.service.js index c0b6ea68..26778c9c 100644 --- a/modules/forums/client/services/topics.client.service.js +++ b/modules/forums/client/services/topics.client.service.js @@ -44,6 +44,22 @@ topicId: '@_id' } }, + toggleTopicHomeHelpStatus: { + method: 'PUT', + url: '/api/topics/:forumId/:topicId/toggleTopicHomeHelpStatus', + params: { + forumId: '@forum', + topicId: '@_id' + } + }, + toggleTopicHomeNoticeStatus: { + method: 'PUT', + url: '/api/topics/:forumId/:topicId/toggleTopicHomeNoticeStatus', + params: { + forumId: '@forum', + topicId: '@_id' + } + }, thumbsUp: { method: 'PUT', url: '/api/topics/:forumId/:topicId/thumbsUp', diff --git a/modules/forums/client/views/topic.client.view.html b/modules/forums/client/views/topic.client.view.html index 654d40e6..59dd1b93 100644 --- a/modules/forums/client/views/topic.client.view.html +++ b/modules/forums/client/views/topic.client.view.html @@ -85,17 +85,14 @@ {{vm.topic.createdAt | date:'yyyy-MM-dd HH:mm:ss'}}
- - - + + + + +