diff --git a/common/locales/en/groups.json b/common/locales/en/groups.json index 5deb87aa92..2762732bdf 100644 --- a/common/locales/en/groups.json +++ b/common/locales/en/groups.json @@ -138,6 +138,7 @@ "inviteNewUsers": "Invite New Users", "sendInvitations": "Send Invitations", "invitationsSent": "Invitations sent!", + "invitationSent": "Invitation sent!", "inviteAlertInfo2": "Or share this link (copy/paste):", "sendGiftHeading": "Send Gift to <%= name %>", "sendGiftGemsBalance": "From <%= number %> Gems", diff --git a/website/client/js/controllers/inviteToGroupCtrl.js b/website/client/js/controllers/inviteToGroupCtrl.js index e5df814512..258b0296ef 100644 --- a/website/client/js/controllers/inviteToGroupCtrl.js +++ b/website/client/js/controllers/inviteToGroupCtrl.js @@ -43,9 +43,13 @@ habitrpg.controller('InviteToGroupCtrl', ['$scope', '$rootScope', 'User', 'Group } Groups.Group.invite($scope.group._id, invitationDetails) - .then(function() { - Notification.text(window.env.t('invitationsSent')); - _resetInvitees(); + .then(function () { + var invitesSent = invitationDetails.emails || invitationDetails.uuids; + var invitationString = invitesSent.length > 1 ? 'invitationsSent' : 'invitationSent'; + + Notification.text(window.env.t(invitationString)); + + _resetInvitees(); if ($scope.group.type === 'party') { $rootScope.hardRedirect('/#/options/groups/party'); diff --git a/website/views/shared/modals/invite-friends.jade b/website/views/shared/modals/invite-friends.jade index ae4a2c4c7a..45490a3f9e 100644 --- a/website/views/shared/modals/invite-friends.jade +++ b/website/views/shared/modals/invite-friends.jade @@ -12,11 +12,10 @@ script(type='text/ng-template', id='modals/invite-guild.html') tr(ng-repeat='user in invitees track by $index') td input.form-control(type='text', ng-model='user.uuid') - //- @TODO: Refactor src/controllers/groups api.invite to use promises before implimenting this - //- tr - //- td - //- a.btn.btn-xs.pull-right(ng-click='addUuid()') - //- i.glyphicon.glyphicon-plus + tr + td + a.btn.btn-xs.pull-right(ng-click='addUuid()') + i.glyphicon.glyphicon-plus tr td .col-sm-4.col-sm-offset-8 @@ -91,11 +90,10 @@ script(type='text/ng-template', id='modals/invite-party.html') tr(ng-repeat='user in invitees track by $index') td input.form-control(type='text', ng-model='user.uuid') - //- @TODO: Refactor src/controllers/groups api.invite to use promises before implimenting this - //- tr - //- td - //- a.btn.btn-xs.pull-right(ng-click='addUuid()') - //- i.glyphicon.glyphicon-plus + tr + td + a.btn.btn-xs.pull-right(ng-click='addUuid()') + i.glyphicon.glyphicon-plus tr td .col-sm-4.col-sm-offset-8