diff --git a/common/locales/en/groups.json b/common/locales/en/groups.json index bf2a56ec12..44b2997c4c 100644 --- a/common/locales/en/groups.json +++ b/common/locales/en/groups.json @@ -116,6 +116,7 @@ "byColon": "By:", "inviteNewUsers": "Invite New Users", "sendInvitations": "Send Invitations", + "invitationsSent": "Invitations sent!", "inviteAlertInfo2": "Or share this link (copy/paste):", "sendGiftHeading": "Send Gift to <%= name %>", "sendGiftGemsBalance": "From <%= number %> Gems", diff --git a/website/public/js/controllers/groupsCtrl.js b/website/public/js/controllers/groupsCtrl.js index 90bce84d12..0c8540ed1f 100644 --- a/website/public/js/controllers/groupsCtrl.js +++ b/website/public/js/controllers/groupsCtrl.js @@ -139,11 +139,11 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', ' $scope.inviter = User.user.profile.name; $scope.emails = [{name:"",email:""},{name:"",email:""}]; - $scope.invitees = [{invitee:""},{invitee:""}]; + $scope.invitees = [{uuid:""},{uuid:""}]; $scope.inviteEmails = function(){ Groups.Group.invite({gid: $scope.group._id}, {inviter: $scope.inviter, emails: $scope.emails}, function(){ - Notification.text("Invitation(s) sent!"); + Notification.text(window.env.t('invitationsSent')); $scope.emails = [{name:'',email:''},{name:'',email:''}]; }, function(){ $scope.emails = [{name:'',email:''},{name:'',email:''}]; @@ -151,11 +151,12 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', ' }; $scope.invite = function(){ - Groups.Group.invite({gid: $scope.group._id}, {uuids: [$scope.invitee]}, function(){ - Notification.text("Invitation(s) sent!"); - $scope.invitee = ''; + var uuidList = _.pluck($scope.invitees,'uuid'); + Groups.Group.invite({gid: $scope.group._id}, {uuids: uuidList}, function(){ + Notification.text(window.env.t('invitationsSent')); + $scope.invitees = [{uuid:""},{uuid:""}]; }, function(){ - $scope.invitee = ''; + $scope.invitees = [{uuid:""},{uuid:""}]; }); }; }]) diff --git a/website/views/shared/modals/invite-friends.jade b/website/views/shared/modals/invite-friends.jade index b05ae4c09f..c1eb2b3776 100644 --- a/website/views/shared/modals/invite-friends.jade +++ b/website/views/shared/modals/invite-friends.jade @@ -39,10 +39,10 @@ script(type='text/ng-template', id='modals/invite-friends.html') tbody tr(ng-repeat='invitee in invitees') td - input.form-control(type='text', ng-model='invitee.invitee') + input.form-control(type='text', ng-model='invitee.uuid') tr td(colspan=2) - a.btn.btn-xs.pull-right(ng-click='invitees = invitees.concat([{invitee:""}])') + a.btn.btn-xs.pull-right(ng-click='invitees = invitees.concat([{uuid:""}])') i.glyphicon.glyphicon-plus tr td