Fill user page with avatar, display name and matrix id

This commit is contained in:
Emmanuel ROHEE 2014-08-19 09:37:10 +02:00
parent 38f5c1c378
commit d7a4f2ed7f
3 changed files with 44 additions and 5 deletions

View File

@ -259,6 +259,14 @@ h1 {
max-height: 100%; max-height: 100%;
} }
/*** User profile page ***/
#user-ids {
padding-left: 1em;
}
#user-displayname {
font-size: 16pt;
}
/******************************/ /******************************/
#header { #header {

View File

@ -17,9 +17,22 @@ limitations under the License.
'use strict'; 'use strict';
angular.module('UserController', ['matrixService']) angular.module('UserController', ['matrixService'])
.controller('UserController', ['$scope', '$routeParams', .controller('UserController', ['$scope', '$routeParams', 'matrixService',
function($scope, $routeParams) { function($scope, $routeParams, matrixService) {
$scope.user = { $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;
}
);
}]); }]);

View File

@ -3,8 +3,26 @@
<div id="page"> <div id="page">
<div id="wrapper"> <div id="wrapper">
<div> {{ user.id }}</div> <div>
<form>
<table>
<tr>
<td>
<div class="profile-avatar">
<img ng-src="{{ user.avatar_url || 'img/default-profile.jpg' }}"/>
</div>
</td>
<td>
<div id="user-ids">
<div id="user-displayname">{{ user.displayname }}</div>
<div>{{ user.id }}</div>
</div>
</td>
</tr>
</table>
</form>
</div>
{{ feedback }} {{ feedback }}
</div> </div>