Provide better invitation messaging

closes #7794
fixes #7789
This commit is contained in:
Oziris 2016-07-15 20:57:26 -03:00 committed by Blade Barringer
parent 7d7bb3ecb8
commit 0dfb1f150f
3 changed files with 16 additions and 13 deletions

View file

@ -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",

View file

@ -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');

View file

@ -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