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
@@ -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;
@@ -19,6 +19,13 @@ script(type='text/ng-template', id='partials/options.social.challenges.detail.me
.modal-body
habitrpg-tasks(main=false, modal='true')
.modal-footer
.btn-group.pull-left(role="group")
button.btn.btn-default(ng-click='clickMember(obj._id, true)')
.glyphicon.glyphicon-user
button.btn.btn-default(ng-click='sendMessageToChallengeParticipant(obj._id)')
.glyphicon.glyphicon-envelope
button.btn.btn-default(ng-click='sendGiftToChallengeParticipant(obj._id)')
.glyphicon.glyphicon-gift
a.btn.btn-default(ng-click='$state.go("^")')=env.t('close')
script(type='text/ng-template', id='partials/options.social.challenges.detail.html')