Add missing text to buttons on the party / guild invite modal - Fixes #8391 (#8402)

* Fix missing text in party / guild invite modal

* add tests and abstract logic

* use translation lib for test
This commit is contained in:
ean
2017-01-19 13:17:38 -06:00
committed by Keith Holliday
parent ffa561473c
commit 74c9a1b02d
5 changed files with 55 additions and 38 deletions

View File

@@ -2,6 +2,7 @@
habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '$http', '$q', 'User', 'Members', '$state', 'Notification',
function($scope, $rootScope, Shared, Groups, $http, $q, User, Members, $state, Notification) {
$scope.inviteOrStartParty = Groups.inviteOrStartParty;
$scope.isMemberOfPendingQuest = function (userid, group) {
if (!group.quest || !group.quest.members) return false;
if (group.quest.active) return false; // quest is started, not pending
@@ -120,25 +121,6 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
}
};
$scope.openInviteModal = function (group) {
if (group.type !== 'party' && group.type !== 'guild') {
return console.log('Invalid group type.')
}
var sendInviteText = window.env.t('sendInvitations');
if(group.purchased && group.purchased.plan && group.purchased.plan.customerId) sendInviteText += window.env.t('groupAdditionalUserCost');
group.sendInviteText = sendInviteText;
$rootScope.openModal('invite-' + group.type, {
controller:'InviteToGroupCtrl',
resolve: {
injectedGroup: function(){
return group;
},
}
});
};
$scope.quickReply = function (uid) {
Members.selectMember(uid)
.then(function (response) {