import from google reader

This commit is contained in:
Athou
2013-04-05 16:31:42 +02:00
parent ad1e64b101
commit a1ab76d176
16 changed files with 388 additions and 1 deletions

View File

@@ -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('/');
});
};
});

View File

@@ -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',

View File

@@ -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;
});