Revert "Added hide and error message when a user tries to create a challenge for..."

This commit is contained in:
Alys
2015-03-27 20:11:12 +10:00
parent f16ef869a3
commit 1202c624f1
3 changed files with 4 additions and 12 deletions

View File

@@ -45,7 +45,6 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
*/
$scope.save = function(challenge) {
if (!challenge.group) return alert(window.env.t('selectGroup'));
if (!$scope.enoughGems) return alert(window.env.t('challengeNotEnoughGems'));
var isNew = !challenge._id;
challenge.$save(function(_challenge){
if (isNew) {
@@ -219,11 +218,7 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
if (!gid) return;
var group = _.find($scope.groups, {_id:gid});
$scope.maxPrize = User.user.balance*4 + ((group && group.balance && group.leader==User.user._id) ? group.balance*4 : 0);
$scope.enoughGems = true;
if (gid == 'habitrpg') {
$scope.newChallenge.prize = 1;
if ( $scope.maxPrize <= 0 ) $scope.enoughGems = false;
}
if (gid == 'habitrpg') $scope.newChallenge.prize = 1;
})
$scope.selectAll = function(){