From 32036d017e560edd43e6c5cb870390cf27539052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sat, 20 Sep 2014 12:14:03 +0200 Subject: [PATCH] Account stuff --- src/app/controllers/pro/accountCtrl.js | 39 ++++++++++++++ src/app/partials/pro/account.html | 73 +++++++++++++++++--------- src/app/partials/pro/sidemenu.html | 2 +- src/app/routes/p_admin.js | 35 +----------- src/css/less/p_pro.less | 1 + 5 files changed, 90 insertions(+), 60 deletions(-) create mode 100644 src/app/controllers/pro/accountCtrl.js diff --git a/src/app/controllers/pro/accountCtrl.js b/src/app/controllers/pro/accountCtrl.js new file mode 100644 index 00000000000..c77f9aeba92 --- /dev/null +++ b/src/app/controllers/pro/accountCtrl.js @@ -0,0 +1,39 @@ +define([ + 'angular', +], +function (angular) { + 'use strict'; + + var module = angular.module('grafana.controllers'); + + module.controller('AccountCtrl', function($scope, $http, alertSrv) { + + $scope.collaborator = {}; + + $scope.init = function() { + $scope.getAccountInfo(); + }; + + $scope.getAccountInfo = function() { + + }; + + $scope.addCollaborator = function() { + if (!$scope.addCollaboratorForm.$valid) { + return; + } + + $http.post('/api/account/collaborators/add', $scope.collaborator).then(function() { + alertSrv.set('Collaborator added', '', 'success', 3000); + }, function(err) { + if (err.data && err.data.status) { + alertSrv.set('Could not add collaborator', err.data.status, 'warning', 10000); + } + else if (err.statusText) { + alertSrv.set('Could not add collaborator', err.data.status, 'warning', 10000); + } + }); + }; + + }); +}); diff --git a/src/app/partials/pro/account.html b/src/app/partials/pro/account.html index 177fd611136..32372a62fcc 100644 --- a/src/app/partials/pro/account.html +++ b/src/app/partials/pro/account.html @@ -3,7 +3,7 @@
- + Account Settings @@ -12,40 +12,61 @@
+
+
-
-
- - Personal information -
-
- -
-
-
- - +
+
+ + Personal information +
-
-
-
- - +
+
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+
-
-
-
- - + +
+
-
+
+
+ + Active account +
+
-
diff --git a/src/app/partials/pro/sidemenu.html b/src/app/partials/pro/sidemenu.html index 182ee652b84..c118b1c186a 100644 --- a/src/app/partials/pro/sidemenu.html +++ b/src/app/partials/pro/sidemenu.html @@ -30,7 +30,7 @@ - User accounts + Account settings diff --git a/src/app/routes/p_admin.js b/src/app/routes/p_admin.js index be55872a437..cc3c4ef47a9 100644 --- a/src/app/routes/p_admin.js +++ b/src/app/routes/p_admin.js @@ -1,5 +1,6 @@ define([ 'angular', + 'controllers/pro/accountCtrl', ], function (angular) { "use strict"; @@ -11,43 +12,11 @@ function (angular) { .when('/admin/datasources', { templateUrl: 'app/partials/pro/admin_datasources.html', controller : 'AdminCtrl', - }); - }); - - module.config(function($routeProvider) { - $routeProvider + }) .when('/account', { templateUrl: 'app/partials/pro/account.html', controller : 'AccountCtrl', }); }); - module.controller('AdminCtrl', function() { - - }); - - module.controller('AccountCtrl', function($scope, $http, alertSrv) { - - $scope.collaborator = {}; - - $scope.addCollaborator = function() { - if (!$scope.addCollaboratorForm.$valid) { - return; - } - - $http.post('/api/account/collaborators/add', $scope.collaborator).then(function() { - alertSrv.set('Collaborator added', '', 'success', 3000); - }, function(err) { - if (err.data && err.data.status) { - alertSrv.set('Could not add collaborator', err.data.status, 'warning', 10000); - } - else if (err.statusText) { - alertSrv.set('Could not add collaborator', err.data.status, 'warning', 10000); - } - console.log("value", err); - }); - }; - - }); - }); diff --git a/src/css/less/p_pro.less b/src/css/less/p_pro.less index 029d312d473..9d1970f3289 100644 --- a/src/css/less/p_pro.less +++ b/src/css/less/p_pro.less @@ -65,6 +65,7 @@ padding: 12px 30px; } } + .login-box-logo { text-align: center; padding-bottom: 50px;