diff --git a/app/assets/javascripts/discourse/controllers/flag-action-type.js.es6 b/app/assets/javascripts/discourse/controllers/flag-action-type.js.es6 index 25912e7a222..4e1ed438c6d 100644 --- a/app/assets/javascripts/discourse/controllers/flag-action-type.js.es6 +++ b/app/assets/javascripts/discourse/controllers/flag-action-type.js.es6 @@ -24,6 +24,7 @@ export default Ember.Controller.extend({ showMessageInput: Em.computed.and('model.is_custom_flag', 'selected'), showDescription: Em.computed.not('showMessageInput'), + isNotifyUser: Em.computed.equal('model.name_key', 'notify_user'), customMessageLengthClasses: function() { return (this.get('message.length') < Discourse.SiteSettings.min_private_message_post_length) ? "too-short" : "ok"; @@ -44,4 +45,3 @@ export default Ember.Controller.extend({ }.property('message.length') }); - diff --git a/app/assets/javascripts/discourse/controllers/flag.js.es6 b/app/assets/javascripts/discourse/controllers/flag.js.es6 index c387e53321b..5250059d9f6 100644 --- a/app/assets/javascripts/discourse/controllers/flag.js.es6 +++ b/app/assets/javascripts/discourse/controllers/flag.js.es6 @@ -14,8 +14,19 @@ export default Ember.Controller.extend(ModalFunctionality, { flagsAvailable: function() { if (!this.get('flagTopic')) { - return this.get('model.flagsAvailable'); + // flagging post + let flagsAvailable = this.get('model.flagsAvailable'); + + // "message user" option should be at the top + const notifyUserIndex = flagsAvailable.indexOf(flagsAvailable.filterProperty('name_key', 'notify_user')[0]); + if (notifyUserIndex !== -1) { + const notifyUser = flagsAvailable[notifyUserIndex]; + flagsAvailable.splice(notifyUserIndex, 1); + flagsAvailable.splice(0, 0, notifyUser); + } + return flagsAvailable; } else { + // flagging topic const self = this, lookup = Em.Object.create(); @@ -35,6 +46,10 @@ export default Ember.Controller.extend(ModalFunctionality, { } }.property('post', 'flagTopic', 'model.actions_summary.@each.can_act'), + staffFlagsAvailable: function() { + return (this.get('model.flagsAvailable').length > 1); + }.property('post', 'flagTopic', 'model.actions_summary.@each.can_act'), + submitEnabled: function() { const selected = this.get('selected'); if (!selected) return false; diff --git a/app/assets/javascripts/discourse/templates/modal/flag.hbs b/app/assets/javascripts/discourse/templates/modal/flag.hbs index d7a6cc872b7..7a29c44fc1d 100644 --- a/app/assets/javascripts/discourse/templates/modal/flag.hbs +++ b/app/assets/javascripts/discourse/templates/modal/flag.hbs @@ -2,18 +2,33 @@