Commit a7345e368a92396c04e9cd8d1a9c1ed2ed50d15e
1 parent
ae564c97
Exists in
spb-stable
and in
2 other branches
Fix gravatar size and update docs for new users API
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
2 changed files
with
54 additions
and
1 deletions
Show diff stats
app/models/user.rb
@@ -487,7 +487,7 @@ class User < ActiveRecord::Base | @@ -487,7 +487,7 @@ class User < ActiveRecord::Base | ||
487 | if avatar.present? | 487 | if avatar.present? |
488 | URI::join(Gitlab.config.gitlab.url, avatar.url).to_s | 488 | URI::join(Gitlab.config.gitlab.url, avatar.url).to_s |
489 | else | 489 | else |
490 | - GravatarService.new.execute(email) | 490 | + GravatarService.new.execute(email, size) |
491 | end | 491 | end |
492 | end | 492 | end |
493 | end | 493 | end |
doc/api/users.md
@@ -6,6 +6,34 @@ Get a list of users. | @@ -6,6 +6,34 @@ Get a list of users. | ||
6 | 6 | ||
7 | This function takes pagination parameters `page` and `per_page` to restrict the list of users. | 7 | This function takes pagination parameters `page` and `per_page` to restrict the list of users. |
8 | 8 | ||
9 | +### For normal users: | ||
10 | + | ||
11 | +``` | ||
12 | +GET /users | ||
13 | +``` | ||
14 | + | ||
15 | +```json | ||
16 | +[ | ||
17 | + { | ||
18 | + "id": 1, | ||
19 | + "username": "john_smith", | ||
20 | + "name": "John Smith", | ||
21 | + "state": "active", | ||
22 | + "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg", | ||
23 | + }, | ||
24 | + { | ||
25 | + "id": 2, | ||
26 | + "username": "jack_smith", | ||
27 | + "name": "Jack Smith", | ||
28 | + "state": "blocked", | ||
29 | + "avatar_url": "http://gravatar.com/../e32131cd8.jpeg", | ||
30 | + } | ||
31 | +] | ||
32 | +``` | ||
33 | + | ||
34 | + | ||
35 | +### For admins: | ||
36 | + | ||
9 | ``` | 37 | ``` |
10 | GET /users | 38 | GET /users |
11 | ``` | 39 | ``` |
@@ -29,6 +57,7 @@ GET /users | @@ -29,6 +57,7 @@ GET /users | ||
29 | "theme_id": 1, | 57 | "theme_id": 1, |
30 | "color_scheme_id": 2, | 58 | "color_scheme_id": 2, |
31 | "is_admin": false, | 59 | "is_admin": false, |
60 | + "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg", | ||
32 | "can_create_group": true | 61 | "can_create_group": true |
33 | }, | 62 | }, |
34 | { | 63 | { |
@@ -48,6 +77,7 @@ GET /users | @@ -48,6 +77,7 @@ GET /users | ||
48 | "theme_id": 1, | 77 | "theme_id": 1, |
49 | "color_scheme_id": 3, | 78 | "color_scheme_id": 3, |
50 | "is_admin": false, | 79 | "is_admin": false, |
80 | + "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg", | ||
51 | "can_create_group": true, | 81 | "can_create_group": true, |
52 | "can_create_project": true | 82 | "can_create_project": true |
53 | } | 83 | } |
@@ -62,6 +92,29 @@ Also see `def search query` in `app/models/user.rb`. | @@ -62,6 +92,29 @@ Also see `def search query` in `app/models/user.rb`. | ||
62 | 92 | ||
63 | Get a single user. | 93 | Get a single user. |
64 | 94 | ||
95 | +#### For user: | ||
96 | + | ||
97 | +``` | ||
98 | +GET /users/:id | ||
99 | +``` | ||
100 | + | ||
101 | +Parameters: | ||
102 | + | ||
103 | +- `id` (required) - The ID of a user | ||
104 | + | ||
105 | +```json | ||
106 | +{ | ||
107 | + "id": 1, | ||
108 | + "username": "john_smith", | ||
109 | + "name": "John Smith", | ||
110 | + "state": "active", | ||
111 | + "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg", | ||
112 | +} | ||
113 | +``` | ||
114 | + | ||
115 | + | ||
116 | +#### For admin: | ||
117 | + | ||
65 | ``` | 118 | ``` |
66 | GET /users/:id | 119 | GET /users/:id |
67 | ``` | 120 | ``` |