summary refs log tree commit diff
path: root/webclient/user
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-08-19 09:37:10 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-08-19 09:37:10 +0200
commitd7a4f2ed7fec3640aea68c5280548470d6c53108 (patch)
tree55ca9bf19d9ca20f4d17821659947b4b38c3f2cc /webclient/user
parentMade small avatar image center (diff)
downloadsynapse-d7a4f2ed7fec3640aea68c5280548470d6c53108.tar.xz
Fill user page with avatar, display name and matrix id
Diffstat (limited to 'webclient/user')
-rw-r--r--webclient/user/user-controller.js19
-rw-r--r--webclient/user/user.html22
2 files changed, 36 insertions, 5 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
diff --git a/webclient/user/user.html b/webclient/user/user.html
index f548e05a71..47db09d1ee 100644
--- a/webclient/user/user.html
+++ b/webclient/user/user.html
@@ -3,8 +3,26 @@
     <div id="page">
     <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 }}
 
     </div>