mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
profile page
This commit is contained in:
@@ -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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user