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

View File

@@ -57,7 +57,8 @@
<form ng-upload class="form-horizontal" action="rest/subscriptions/import">
<div class="modal-body">
<div class="control-group">
<span>Select the subscriptions.xml file you got from the zip file on google.com/takeout</span>
<div>Download subscriptions.xml from <a target="_blank" href="https://www.google.com/reader/subscriptions/export">here</a>.</div>
<div>Alternatively, let me import your feeds from your <a href="google/import/redirect">Google Reader account</a>.</div>
</div>
<div class="control-group">
<label class="control-label">XML File</label>

View File

@@ -0,0 +1,47 @@
<div class="row">
<div class="page-header">
<h1>Application settings</h1>
</div>
<div>
<form name="settingsForm" class="form-horizontal" ng-submit="save()">
<div class="control-group">
<label class="control-label" for="publicUrl">Public URL</label>
<div class="controls">
<input type="text" id="publicUrl" name="publicUrl"
ng-model="settings.publicUrl" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="allowRegistrations">Allow
registrations</label>
<div class="controls">
<input type="checkbox" id="allowRegistrations"
name="allowRegistrations" ng-model="settings.allowRegistrations" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="googleClientId">Google
client ID</label>
<div class="controls">
<input type="text" name="googleClientId"
ng-model="settings.googleClientId" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="googleClientSecret">Google
client secret</label>
<div class="controls">
<input type="text" name="googleClientSecret"
ng-model="settings.googleClientSecret" />
</div>
</div>
<div class="control-group">
<div class="controls">
<button type="button" class="btn" ng-click="cancel()">Cancel</button>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</div>
</form>
</div>
</div>