diff options
author | Emmanuel ROHEE <erohee@amdocs.com> | 2014-08-19 09:37:10 +0200 |
---|---|---|
committer | Emmanuel ROHEE <erohee@amdocs.com> | 2014-08-19 09:37:10 +0200 |
commit | d7a4f2ed7fec3640aea68c5280548470d6c53108 (patch) | |
tree | 55ca9bf19d9ca20f4d17821659947b4b38c3f2cc /webclient/user/user-controller.js | |
parent | Made small avatar image center (diff) | |
download | synapse-d7a4f2ed7fec3640aea68c5280548470d6c53108.tar.xz |
Fill user page with avatar, display name and matrix id
Diffstat (limited to 'webclient/user/user-controller.js')
-rw-r--r-- | webclient/user/user-controller.js | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/webclient/user/user-controller.js b/webclient/user/user-controller.js index 4b7aa62d42..620230561c 100644 --- a/webclient/user/user-controller.js +++ b/webclient/user/user-controller.js @@ -17,9 +17,22 @@ limitations under the License. 'use strict'; angular.module('UserController', ['matrixService']) -.controller('UserController', ['$scope', '$routeParams', - function($scope, $routeParams) { +.controller('UserController', ['$scope', '$routeParams', 'matrixService', + function($scope, $routeParams, matrixService) { $scope.user = { - id: $routeParams.user_matrix_id + id: $routeParams.user_matrix_id, + displayname: "", + avatar_url: undefined }; + + matrixService.getDisplayName($scope.user.id).then( + function(response) { + $scope.user.displayname = response.data.displayname; + } + ); + matrixService.getProfilePictureUrl($scope.user.id).then( + function(response) { + $scope.user.avatar_url = response.data.avatar_url; + } + ); }]); \ No newline at end of file |