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

@@ -46,6 +46,5 @@
"removeTasks": "Remove Tasks",
"keepTasks": "Keep Tasks",
"closeCha": "Close challenge and...",
"leaveCha": "Leave challenge and...",
"challengeNotEnoughGems": "You do not have enough gems to post this challenge."
"leaveCha": "Leave challenge and..."
}

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(){

View File

@@ -116,11 +116,9 @@ script(type='text/ng-template', id='partials/options.social.challenges.html')
//- what's going on here?
br
br
div.alert.alert-warning(ng-hide="enoughGems")
=env.t('challengeNotEnoughGems')
.form-group
input.form-control(type='number', min="{{newChallenge.group=='habitrpg' ? 1 : 0}}", max="{{enoughGems ? maxPrize : null}}", ng-model='newChallenge.prize', placeholder=env.t('prize'), ng-show="enoughGems")
.form-group
input.form-control(type='number', min="{{newChallenge.group=='habitrpg' ? 1 : 0}}", max="{{maxPrize}}", ng-model='newChallenge.prize', placeholder=env.t('prize'))
span.input-suffix.Pet_Currency_Gem1x.inline-gems
|&nbsp;
span.hint.vertical-20(popover=env.t('prizePop'), popover-trigger='mouseenter', popover-placement='right')