From ae42170090e4215b03a099105bae9e02e543c05d Mon Sep 17 00:00:00 2001 From: Athou Date: Wed, 10 Apr 2013 16:55:51 +0200 Subject: [PATCH] link to admin user list --- src/main/webapp/js/controllers.js | 130 +++++++++--------- src/main/webapp/templates/admin.settings.html | 7 +- 2 files changed, 74 insertions(+), 63 deletions(-) diff --git a/src/main/webapp/js/controllers.js b/src/main/webapp/js/controllers.js index 9464cfbb..5a76b68e 100644 --- a/src/main/webapp/js/controllers.js +++ b/src/main/webapp/js/controllers.js @@ -192,71 +192,73 @@ module.controller('CategoryTreeCtrl', function($scope, $timeout, $stateParams, }); }); -module.controller('ToolbarCtrl', function($scope, $http, $state, $stateParams, - $route, $location, SettingsService, EntryService, SubscriptionService, - SessionService) { +module.controller('ToolbarCtrl', + function($scope, $http, $state, $stateParams, $route, $location, + SettingsService, EntryService, SubscriptionService, + SessionService) { - function totalActiveAjaxRequests() { - return ($http.pendingRequests.length + $.active); - } + function totalActiveAjaxRequests() { + return ($http.pendingRequests.length + $.active); + } - $scope.session = SessionService.get(); + $scope.session = SessionService.get(); - $scope.loading = true; - $scope.$watch(totalActiveAjaxRequests, function() { - $scope.loading = (totalActiveAjaxRequests() !== 0); - }); - - $scope.settingsService = SettingsService; - $scope.$watch('settingsService.settings.readingMode', function(newValue, - oldValue) { - if (newValue && oldValue && newValue != oldValue) { - SettingsService.save(); - } - }); - $scope.$watch('settingsService.settings.readingOrder', function(newValue, - oldValue) { - if (newValue && oldValue && newValue != oldValue) { - SettingsService.save(); - } - }); - $scope.refresh = function() { - $scope.$emit('emitReload'); - }; - $scope.markAllAsRead = function() { - $scope.$emit('emitMarkAll', { - type : $stateParams._type, - id : $stateParams._id, - read : true - }); - }; - - $scope.keywords = $stateParams._keywords; - $scope.search = function() { - if ($scope.keywords == $stateParams._keywords) { - $scope.refresh(); - } else { - $state.transitionTo('feeds.search', { - _keywords : $scope.keywords + $scope.loading = true; + $scope.$watch(totalActiveAjaxRequests, function() { + $scope.loading = (totalActiveAjaxRequests() !== 0); }); - } - }; - $scope.showButtons = function() { - return !$stateParams._keywords; - }; - - $scope.toggleOrder = function() { - var settings = $scope.settingsService.settings; - settings.readingOrder = settings.readingOrder == 'asc' ? 'desc' : 'asc'; - }; - $scope.toAdmin = function() { - $location.path('admin'); - }; - $scope.toSettings = function() { - $location.path('settings'); - }; -}); + $scope.settingsService = SettingsService; + $scope.$watch('settingsService.settings.readingMode', function( + newValue, oldValue) { + if (newValue && oldValue && newValue != oldValue) { + SettingsService.save(); + } + }); + $scope.$watch('settingsService.settings.readingOrder', function( + newValue, oldValue) { + if (newValue && oldValue && newValue != oldValue) { + SettingsService.save(); + } + }); + $scope.refresh = function() { + $scope.$emit('emitReload'); + }; + $scope.markAllAsRead = function() { + $scope.$emit('emitMarkAll', { + type : $stateParams._type, + id : $stateParams._id, + read : true + }); + }; + + $scope.keywords = $stateParams._keywords; + $scope.search = function() { + if ($scope.keywords == $stateParams._keywords) { + $scope.refresh(); + } else { + $state.transitionTo('feeds.search', { + _keywords : $scope.keywords + }); + } + }; + $scope.showButtons = function() { + return !$stateParams._keywords; + }; + + $scope.toggleOrder = function() { + var settings = $scope.settingsService.settings; + settings.readingOrder = settings.readingOrder == 'asc' ? 'desc' + : 'asc'; + }; + + $scope.toAdmin = function() { + $location.path('admin'); + }; + $scope.toSettings = function() { + $location.path('settings'); + }; + }); module.controller('FeedListCtrl', function($scope, $stateParams, $http, $route, $window, EntryService, SettingsService, SubscriptionService) { @@ -473,7 +475,7 @@ module.controller('ManageUsersCtrl', function($scope, $state, $location, $state.transitionTo('admin.useradd'); }; $scope.back = function() { - $location.path('/'); + $location.path('/admin'); }; }); @@ -551,7 +553,7 @@ module.controller('SettingsCtrl', function($scope, $location, SettingsService) { }; }); -module.controller('ManageSettingsCtrl', function($scope, $location, +module.controller('ManageSettingsCtrl', function($scope, $location, $state, AdminSettingsService) { $scope.settings = AdminSettingsService.get(); @@ -564,4 +566,8 @@ module.controller('ManageSettingsCtrl', function($scope, $location, $location.path('/'); }); }; + + $scope.toUsers = function() { + $state.transitionTo('admin.userlist'); + }; }); \ No newline at end of file diff --git a/src/main/webapp/templates/admin.settings.html b/src/main/webapp/templates/admin.settings.html index 7c8145af..35c0e85b 100644 --- a/src/main/webapp/templates/admin.settings.html +++ b/src/main/webapp/templates/admin.settings.html @@ -1,6 +1,11 @@