forked from Archives/Athou_commafeed
import from google reader
This commit is contained in:
@@ -492,4 +492,18 @@ module.controller('SettingsCtrl', function($scope, $location, SettingsService) {
|
||||
window.location.href.lastIndexOf('#'));
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
module.controller('ManageSettingsCtrl', function($scope, $location, AdminSettingsService) {
|
||||
|
||||
$scope.settings = AdminSettingsService.get();
|
||||
|
||||
$scope.cancel = function() {
|
||||
$location.path('/');
|
||||
};
|
||||
$scope.save = function() {
|
||||
AdminSettingsService.save({}, $scope.settings, function() {
|
||||
$location.path('/');
|
||||
});
|
||||
};
|
||||
});
|
||||
@@ -39,6 +39,11 @@ app.config(function($routeProvider, $stateProvider, $urlRouterProvider) {
|
||||
templateUrl : 'templates/admin.useredit.html',
|
||||
controller : 'ManageUserCtrl'
|
||||
});
|
||||
$stateProvider.state('admin.settings', {
|
||||
url : '/settings',
|
||||
templateUrl : 'templates/admin.settings.html',
|
||||
controller : 'ManageSettingsCtrl'
|
||||
});
|
||||
|
||||
$stateProvider.state('settings', {
|
||||
url : '/settings',
|
||||
|
||||
@@ -211,4 +211,23 @@ module.factory('AdminUsersService', function($resource) {
|
||||
};
|
||||
var res = $resource('rest/admin/users/:_method', {}, actions);
|
||||
return res;
|
||||
});
|
||||
|
||||
module.factory('AdminSettingsService', function($resource) {
|
||||
var actions = {
|
||||
get : {
|
||||
method : 'GET',
|
||||
params : {
|
||||
_method : 'get'
|
||||
}
|
||||
},
|
||||
save : {
|
||||
method : 'POST',
|
||||
params : {
|
||||
_method : 'save'
|
||||
}
|
||||
}
|
||||
};
|
||||
var res = $resource('rest/admin/settings/:_method', {}, actions);
|
||||
return res;
|
||||
});
|
||||
Reference in New Issue
Block a user