From 5b2715515fb791c92827cb4fa8d75767e130f412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 23 Feb 2015 16:39:52 +0100 Subject: [PATCH] Began work on Account -> Organization rethink, #1506 --- pkg/api/dtos/models.go | 2 +- src/app/controllers/sidemenuCtrl.js | 54 ++----------------- .../features/account/partials/account.html | 4 +- .../account/partials/datasourceEdit.html | 2 +- .../account/partials/datasources.html | 2 +- src/app/features/account/partials/users.html | 2 +- .../features/admin/partials/edit_user.html | 2 +- src/app/features/admin/partials/new_user.html | 2 +- src/app/features/admin/partials/settings.html | 2 +- src/app/features/admin/partials/users.html | 2 +- src/app/partials/sidemenu.html | 28 ++++++---- src/css/less/sidemenu.less | 35 +++++++++--- 12 files changed, 61 insertions(+), 76 deletions(-) diff --git a/pkg/api/dtos/models.go b/pkg/api/dtos/models.go index 12d72314f8d..1a05da32004 100644 --- a/pkg/api/dtos/models.go +++ b/pkg/api/dtos/models.go @@ -20,7 +20,7 @@ type CurrentUser struct { Email string `json:"email"` Name string `json:"name"` AccountRole m.RoleType `json:"accountRole"` - AccountName string `json:"acountName"` + AccountName string `json:"accountName"` IsGrafanaAdmin bool `json:"isGrafanaAdmin"` GravatarUrl string `json:"gravatarUrl"` } diff --git a/src/app/controllers/sidemenuCtrl.js b/src/app/controllers/sidemenuCtrl.js index 184e2cab2fb..df41138a0ae 100644 --- a/src/app/controllers/sidemenuCtrl.js +++ b/src/app/controllers/sidemenuCtrl.js @@ -18,69 +18,23 @@ function (angular, _, $, config) { $scope.menu = []; $scope.menu.push({ text: "Dashboards", - icon: "fa fa-th-large", + icon: "fa fa-fw fa-th-large", href: $scope.getUrl("/"), }); if (contextSrv.hasRole('Admin')) { $scope.menu.push({ text: "Data Sources", - icon: "fa fa-database", + icon: "fa fa-fw fa-database", href: $scope.getUrl("/account/datasources"), }); $scope.menu.push({ - text: "Account", href: $scope.getUrl("/account"), - requireRole: "Admin", - icon: "fa fa-shield", - }); - } - - if (contextSrv.user.isGrafanaAdmin) { - $scope.menu.push({ - text: "Admin", href: $scope.getUrl("/admin/settings"), - icon: "fa fa-cube", - requireSignedIn: true, + text: "Organization", href: $scope.getUrl("/account"), + icon: "fa fa-fw fa-users", }); } $scope.updateState = function() { - var currentPath = config.appSubUrl + $location.path(); - var search = $location.search(); - - _.each($scope.menu, function(item) { - item.active = false; - - if (item.href === currentPath) { - item.active = true; - } - - if (item.startsWith) { - if (currentPath.indexOf(item.startsWith) === 0) { - item.active = true; - item.href = currentPath; - } - } - - _.each(item.links, function(link) { - link.active = false; - - if (link.editview) { - var params = {}; - _.each(search, function(value, key) { - if (value !== null) { params[key] = value; } - }); - - params.editview = link.editview; - link.href = currentPath + '?' + $.param(params); - } - - if (link.href === currentPath) { - item.active = true; - link.active = true; - } - }); - }); - }; $scope.init = function() { diff --git a/src/app/features/account/partials/account.html b/src/app/features/account/partials/account.html index 012ef18d6f2..a8f01edaf6a 100644 --- a/src/app/features/account/partials/account.html +++ b/src/app/features/account/partials/account.html @@ -1,4 +1,4 @@ - +