Add buttons to challenge participant modal

This commit is contained in:
Blade Barringer
2015-08-03 08:32:35 -05:00
parent c9e7b4d73d
commit 01237df213
3 changed files with 59 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User', 'Challenges', 'Notification', '$compile', 'Groups', '$state', '$stateParams', 'Tasks',
function($rootScope, $scope, Shared, User, Challenges, Notification, $compile, Groups, $state, $stateParams, Tasks) {
habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User', 'Challenges', 'Notification', '$compile', 'Groups', '$state', '$stateParams', 'Members', 'Tasks',
function($rootScope, $scope, Shared, User, Challenges, Notification, $compile, Groups, $state, $stateParams, Members, Tasks) {
// Use presence of cid to determine whether to show a list or a single
// challenge
@@ -313,6 +313,18 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
}
}
$scope.sendMessageToChallengeParticipant = function(uid) {
Members.selectMember(uid, function(){
$rootScope.openModal('private-message',{controller:'MemberModalCtrl'});
});
};
$scope.sendGiftToChallengeParticipant = function(uid) {
Members.selectMember(uid, function(){
$rootScope.openModal('send-gift',{controller:'MemberModalCtrl'})
});
};
function _calculateMaxPrize(gid) {
var userBalance = User.getBalanceInGems() || 0;