Commit 011c582e by Torkel Ödegaard

minor user avatar stuff

parent d452d3ce
......@@ -235,13 +235,20 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
},
},
{
Text: "Users",
Text: "Members",
Id: "users",
Description: "Manage users & user groups",
Icon: "fa fa-fw fa-users",
Description: "Manage org members",
Icon: "icon-gf icon-gf-users",
Url: setting.AppSubUrl + "/org/users",
},
{
Text: "Groups",
Id: "users",
Description: "Manage org groups",
Icon: "fa fa-fw fa-users",
Url: setting.AppSubUrl + "/org/user-groups",
},
{
Text: "API Keys",
Id: "apikeys",
Description: "Create & manage API keys",
......
package api
import (
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/middleware"
m "github.com/grafana/grafana/pkg/models"
......@@ -247,6 +248,10 @@ func searchUser(c *middleware.Context) (*m.SearchUsersQuery, error) {
return nil, err
}
for _, user := range query.Result.Users {
user.AvatarUrl = dtos.GetGravatarUrl(user.Email)
}
query.Result.Page = page
query.Result.PerPage = perPage
......
......@@ -197,6 +197,7 @@ type UserSearchHitDTO struct {
Name string `json:"name"`
Login string `json:"login"`
Email string `json:"email"`
AvatarUrl string `json:"avatarUrl"`
IsAdmin bool `json:"isAdmin"`
LastSeenAt time.Time `json:"lastSeenAt"`
LastSeenAtAge string `json:"lastSeenAtAge"`
......
......@@ -21,8 +21,7 @@
<table class="filter-table form-inline">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th></th>
<th>Login</th>
<th>Email</th>
<th>
......@@ -35,8 +34,9 @@
</thead>
<tbody>
<tr ng-repeat="user in ctrl.users">
<td>{{user.id}}</td>
<td>{{user.name}}</td>
<td class="width-4 text-center">
<img class="filter-table__avatar" ng-src="{{user.avatarUrl}}"></img>
</td>
<td>{{user.login}}</td>
<td>{{user.email}}</td>
<td>
......
......@@ -2,20 +2,18 @@
<div class="page-container">
<div class="page-header">
<h1>
<i class="{{ctrl.navModel.node.icon}}"></i>
{{ctrl.navModel.node.text}}
</h1>
<page-h1 model="ctrl.navModel"></page-h1>
<button class="btn btn-success" ng-click="ctrl.openAddUsersView()" ng-hide="ctrl.externalUserMngLinkUrl">
<i class="fa fa-plus"></i>
<span>{{ctrl.addUsersBtnName}}</span>
</button>
<div class="page-header-tabs">
<button class="btn btn-success" ng-click="ctrl.openAddUsersView()" ng-hide="ctrl.externalUserMngLinkUrl">
<i class="fa fa-plus"></i>
<span>{{ctrl.addUsersBtnName}}</span>
</button>
<a class="btn btn-inverse" ng-href="{{ctrl.externalUserMngLinkUrl}}" target="_blank" ng-if="ctrl.externalUserMngLinkUrl">
<a class="btn btn-inverse" ng-href="{{ctrl.externalUserMngLinkUrl}}" target="_blank" ng-if="ctrl.externalUserMngLinkUrl">
<i class="fa fa-external-link-square"></i>
{{ctrl.addUsersBtnName}}
{{ctrl.addUsersBtnName}}
</a>
<ul class="gf-tabs">
......@@ -24,13 +22,8 @@
Users ({{ctrl.users.length}})
</a>
</li>
<li class="gf-tabs-item">
<a class="gf-tabs-link" ng-click="ctrl.editor.index = 1" ng-class="{active: ctrl.editor.index === 1}">
Groups (0)
</a>
</li>
<li class="gf-tabs-item" ng-show="ctrl.pendingInvites.length">
<a class="gf-tabs-link" ng-click="ctrl.editor.index = 2" ng-class="{active: ctrl.editor.index === 2}">
<a class="gf-tabs-link" ng-click="ctrl.editor.index = 1" ng-class="{active: ctrl.editor.index === 1}">
Pending Invitations ({{ctrl.pendingInvites.length}})
</a>
</li>
......@@ -79,7 +72,7 @@
</table>
</div>
<div ng-if="ctrl.editor.index === 2">
<div ng-if="ctrl.editor.index === 1">
<table class="filter-table form-inline">
<thead>
<tr>
......
$gf-form-margin: 0.1rem;
$gf-form-margin: 1px;
.gf-form {
margin-bottom: $gf-form-margin;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment