profile page

This commit is contained in:
Athou
2013-04-13 12:19:59 +02:00
parent b3465f33c1
commit 6739166b04
8 changed files with 136 additions and 2 deletions

View File

@@ -261,6 +261,9 @@ module.controller('ToolbarCtrl',
$scope.toSettings = function() {
$location.path('settings');
};
$scope.toProfile = function() {
$location.path('profile');
};
});
module.controller('FeedListCtrl', function($scope, $stateParams, $http, $route,
@@ -556,6 +559,27 @@ module.controller('SettingsCtrl', function($scope, $location, SettingsService) {
};
});
module.controller('ProfileCtrl', function($scope, $location, SessionService) {
$scope.user = SessionService.get();
$scope.cancel = function() {
$location.path('/');
};
$scope.save = function() {
if (!$scope.profileForm.$valid) {
return;
}
var o = {
email : $scope.user.email
};
if ($scope.user.password == $scope.password_c) {
o.password = $scope.user.password;
}
SessionService.save(o);
$location.path('/');
};
});
module.controller('ManageSettingsCtrl', function($scope, $location, $state,
AdminSettingsService) {