diff --git a/assets/js/controllers/groupsCtrl.js b/assets/js/controllers/groupsCtrl.js index 2cffce7029..8683ab998f 100644 --- a/assets/js/controllers/groupsCtrl.js +++ b/assets/js/controllers/groupsCtrl.js @@ -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}}); + } } ]) \ No newline at end of file diff --git a/views/options/groups/tavern.jade b/views/options/groups/tavern.jade index fe274d1be8..122fddbf5c 100644 --- a/views/options/groups/tavern.jade +++ b/views/options/groups/tavern.jade @@ -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