mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-03 12:40:00 +00:00
rewrite: fix up some settings page stuff
This commit is contained in:
parent
de7b46b14d
commit
fce194275e
4 changed files with 24 additions and 30 deletions
|
|
@ -4,17 +4,23 @@
|
|||
habitrpg.controller('SettingsCtrl',
|
||||
['$scope', 'User', '$location',
|
||||
function($scope, User, $location) {
|
||||
$scope.resetApp = function () {
|
||||
localStorage.clear();
|
||||
location.reload();
|
||||
};
|
||||
$scope.auth = function (id, token) {
|
||||
User.authenticate(id, token, function (err) {
|
||||
if (!err) {
|
||||
alert('Login successful!');
|
||||
$location.path("/habit");
|
||||
}
|
||||
});
|
||||
|
||||
// FIXME we have this re-declared everywhere, figure which is the canonical version and delete the rest
|
||||
// $scope.auth = function (id, token) {
|
||||
// User.authenticate(id, token, function (err) {
|
||||
// if (!err) {
|
||||
// alert('Login successful!');
|
||||
// $location.path("/habit");
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
$scope.saveDayStart = function(){
|
||||
var dayStart = +User.user.preferences.dayStart;
|
||||
if (dayStart < 0 || dayStart > 24) {
|
||||
dayStart = 0;
|
||||
}
|
||||
User.log({'op':'set', data:{'preferences.dayStart': dayStart}});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,17 +28,6 @@ habitrpg.directive('habitrpgAdsense', function() {
|
|||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* Directive that executes an expression when the element it is applied to loses focus.
|
||||
*/
|
||||
habitrpg.directive('taskBlur', function() {
|
||||
return function(scope, elem, attrs) {
|
||||
elem.bind('blur', function() {
|
||||
scope.$apply(attrs.taskBlur);
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
habitrpg.directive('whenScrolled', function() {
|
||||
return function(scope, elm, attr) {
|
||||
var raw = elm[0];
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
| Profile
|
||||
include ./profile
|
||||
|
||||
tab
|
||||
//-tab
|
||||
tab-heading
|
||||
i.icon-heart
|
||||
| Groups
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
| Stable
|
||||
app:pets:stable
|
||||
|
||||
tab
|
||||
//-tab
|
||||
tab-heading
|
||||
i.icon-eye-close
|
||||
| Tavern
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
.row-fluid
|
||||
.row-fluid(ng-controller='SettingsCtrl')
|
||||
.personal-options.span6.border-right
|
||||
h2 Settings
|
||||
h4 Custom Day Start
|
||||
.option-group.option-short
|
||||
input.option-content.option-time(type='number', min='0', max='24', value='{{user.preferences.dayStart}}')
|
||||
input.option-content.option-time(type='number', min='0', max='24', ng-model='user.preferences.dayStart', ng-change='saveDayStart()')
|
||||
span.input-suffix :00 (24h clock)
|
||||
span(class='alert alert-warning') Doesn't save yet
|
||||
div
|
||||
small
|
||||
| Habit defaults to check and reset your dailies at midnight in your time zone each day. You can customize the hour here (enter a number between 0 and 24).
|
||||
|
|
@ -19,9 +18,9 @@
|
|||
derby-auth:changepassword
|
||||
hr
|
||||
h4 Danger Zone
|
||||
a.btn.btn-danger(data-target='#reset-modal', data-toggle='modal', rel='tooltip', title='Resets your entire account (dangerous).') Reset
|
||||
a.btn.btn-danger(data-target='#restore-modal', data-toggle='modal', rel='tooltip', title='Restores attributes to your character.') Restore
|
||||
a.btn.btn-danger(data-target='#delete-modal', data-toggle='modal', rel='tooltip', title='Delete your account.') Delete
|
||||
a.btn.btn-danger(ng-click='notPorted()', data-target='#reset-modal', data-toggle='modal', tooltip='Resets your entire account (dangerous).') Reset
|
||||
a.btn.btn-danger(ng-click='notPorted()', data-target='#restore-modal', data-toggle='modal', tooltip='Restores attributes to your character.') Restore
|
||||
a.btn.btn-danger(ng-click='notPorted()', data-target='#delete-modal', data-toggle='modal', tooltip='Delete your account.') Delete
|
||||
.span6
|
||||
h2 API
|
||||
small Copy these for use in third party applications.
|
||||
|
|
|
|||
Loading…
Reference in a new issue