diff --git a/app/assets/javascripts/discourse/controllers/user-invited.js.es6 b/app/assets/javascripts/discourse/controllers/user-invited.js.es6 index 6e63475a3..ea1a43da7 100644 --- a/app/assets/javascripts/discourse/controllers/user-invited.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-invited.js.es6 @@ -14,6 +14,8 @@ export default Ember.ObjectController.extend({ this.set('searchTerm', ''); }, + uploadText: function() { return I18n.t("user.invited.bulk_invite.text"); }.property(), + /** Observe the search term box with a debouncer and change the results. @@ -42,6 +44,15 @@ export default Ember.ObjectController.extend({ return Discourse.User.currentProp('can_invite_to_forum'); }.property(), + /** + Can the currently logged in user bulk invite users to the site (only Admin is allowed to perform this operation) + + @property canBulkInvite + **/ + canBulkInvite: function() { + return Discourse.User.currentProp('admin'); + }.property(), + /** Should the search filter input box be displayed? @@ -75,5 +86,3 @@ export default Ember.ObjectController.extend({ } }); - - diff --git a/app/assets/javascripts/discourse/routes/user_invited_route.js b/app/assets/javascripts/discourse/routes/user_invited_route.js index 3856e383a..797f4e5a0 100644 --- a/app/assets/javascripts/discourse/routes/user_invited_route.js +++ b/app/assets/javascripts/discourse/routes/user_invited_route.js @@ -34,6 +34,14 @@ Discourse.UserInvitedRoute = Discourse.Route.extend({ showInvite: function() { Discourse.Route.showModal(this, 'invite', Discourse.User.current()); this.controllerFor('invite').reset(); + }, + + uploadSuccess: function(filename) { + bootbox.alert(I18n.t("user.invited.bulk_invite.success", { filename: filename })); + }, + + uploadError: function(filename, message) { + bootbox.alert(I18n.t("user.invited.bulk_invite.error", { filename: filename, message: message })); } } diff --git a/app/assets/javascripts/discourse/templates/user/invited.js.handlebars b/app/assets/javascripts/discourse/templates/user/invited.js.handlebars index 9d93cc5c4..ce811108e 100644 --- a/app/assets/javascripts/discourse/templates/user/invited.js.handlebars +++ b/app/assets/javascripts/discourse/templates/user/invited.js.handlebars @@ -2,9 +2,14 @@