UX: Allow topic to be published to the same category when unlisted.

This commit is contained in:
Guo Xiang Tan 2017-04-07 15:09:12 +08:00
parent 690d2f4bd3
commit cd59db5aa3
2 changed files with 6 additions and 1 deletions

View File

@ -59,6 +59,11 @@ export default Ember.Controller.extend(ModalFunctionality, {
return Ember.isEmpty(updateTime) || updateTimeInvalid || loading; return Ember.isEmpty(updateTime) || updateTimeInvalid || loading;
}, },
@computed("model.visible")
excludeCategoryId(visible) {
if (visible) return this.get('model.category_id');
},
@observes("topicStatusUpdate.execute_at", "topicStatusUpdate.duration") @observes("topicStatusUpdate.execute_at", "topicStatusUpdate.duration")
_setUpdateTime() { _setUpdateTime() {
let time = null; let time = null;

View File

@ -58,7 +58,7 @@
{{else if publishToCategory}} {{else if publishToCategory}}
<div class="control-group"> <div class="control-group">
<label>{{i18n 'topic.topic_status_update.publish_to'}}</label> <label>{{i18n 'topic.topic_status_update.publish_to'}}</label>
{{category-chooser valueAttribute="id" value=categoryId excludeCategoryId=model.category_id}} {{category-chooser valueAttribute="id" value=categoryId excludeCategoryId=excludeCategoryId}}
</div> </div>
{{auto-update-input {{auto-update-input