Merge pull request #1385 from paglias/enable-rest-rewrite

Enable resting on rewrite
This commit is contained in:
Tyler Renelle 2013-09-02 09:05:20 -07:00
commit 67975aa581
2 changed files with 9 additions and 4 deletions

View file

@ -105,8 +105,13 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Groups', '$http', 'A
}
])
.controller("TavernCtrl", ['$scope', 'Groups',
function($scope, Groups) {
.controller("TavernCtrl", ['$scope', 'Groups', 'User',
function($scope, Groups, User) {
$scope.group = Groups.groups.tavern;
$scope.rest = function(){
User.user.flags.rest = !User.user.flags.rest;
User.log({op:'set',data:{'flags.rest':User.user.flags.rest}});
}
}
])

View file

@ -14,10 +14,10 @@
a(target='_blank', href='http://www.kickstarter.com/profile/2014640723') Daniel
| , the bar keep. If you want to rest a while (going on vacation? sudden illness?), I'll set you up at the inn - dailies won't hurt you while you're resting. Stay a while & meet the locals.
div
button.btn.btn-large.btn-success(ng-class='{active: user.flags.rest}',x-bind='click:toggleResting')
button.btn.btn-large.btn-success(ng-class='{active: user.flags.rest}', ng-click='rest()')
span(ng-show='user.flags.rest') Check Out of Inn
span(ng-hide='user.flags.rest') Rest In The Inn
.alert.alert-info(ng-hide='user.flags.rest')
.alert.alert-info(ng-show='user.flags.rest')
| Whilst resting, your dailies are saved and aren't affected by day turn-over. Whether you check out tomorrow or in a week's time, you'll continue in the same state as when you checked in.
.well
h3 Resources