mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
* Fix missing text in party / guild invite modal * add tests and abstract logic * use translation lib for test
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user