diff options
Diffstat (limited to 'webclient')
-rw-r--r-- | webclient/app.css | 9 | ||||
-rw-r--r-- | webclient/app.js | 5 | ||||
-rw-r--r-- | webclient/index.html | 1 | ||||
-rw-r--r-- | webclient/room/room-controller.js | 5 | ||||
-rw-r--r-- | webclient/room/room.html | 2 | ||||
-rw-r--r-- | webclient/user/user-controller.js | 38 | ||||
-rw-r--r-- | webclient/user/user.html | 30 |
7 files changed, 89 insertions, 1 deletions
diff --git a/webclient/app.css b/webclient/app.css index b9e7771ca8..e2b6538aa0 100644 --- a/webclient/app.css +++ b/webclient/app.css @@ -251,6 +251,7 @@ h1 { height: 160px; display:table-cell; vertical-align: middle; + text-align: center; } .profile-avatar img { @@ -258,6 +259,14 @@ h1 { max-height: 100%; } +/*** User profile page ***/ +#user-ids { + padding-left: 1em; +} + +#user-displayname { + font-size: 16pt; +} /******************************/ #header { diff --git a/webclient/app.js b/webclient/app.js index a3d1505f81..576912be46 100644 --- a/webclient/app.js +++ b/webclient/app.js @@ -20,6 +20,7 @@ var matrixWebClient = angular.module('matrixWebClient', [ 'LoginController', 'RoomController', 'RoomsController', + 'UserController', 'matrixService', 'eventStreamService', 'eventHandlerService', @@ -47,6 +48,10 @@ matrixWebClient.config(['$routeProvider', '$provide', '$httpProvider', templateUrl: 'rooms/rooms.html', controller: 'RoomsController' }). + when('/user/:user_matrix_id', { + templateUrl: 'user/user.html', + controller: 'UserController' + }). otherwise({ redirectTo: '/rooms' }); diff --git a/webclient/index.html b/webclient/index.html index 455eff4a13..51f6ff1f4d 100644 --- a/webclient/index.html +++ b/webclient/index.html @@ -16,6 +16,7 @@ <script src="login/login-controller.js"></script> <script src="room/room-controller.js"></script> <script src="rooms/rooms-controller.js"></script> + <script src="user/user-controller.js"></script> <script src="components/matrix/matrix-service.js"></script> <script src="components/matrix/event-stream-service.js"></script> <script src="components/matrix/event-handler-service.js"></script> diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 1414fbbe6a..b585e338ed 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -433,6 +433,11 @@ angular.module('RoomController', ['ngSanitize']) }); }; + // Open the user profile page + $scope.goToUserPage = function(user_id) { + $location.url("/user/" + user_id); + }; + $scope.leaveRoom = function() { matrixService.leave($scope.room_id).then( diff --git a/webclient/room/room.html b/webclient/room/room.html index 1c6a44f6fc..36bd95c1bb 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -10,7 +10,7 @@ <div id="usersTableWrapper"> <table id="usersTable"> <tr ng-repeat="member in members | orderMembersList"> - <td class="userAvatar"> + <td class="userAvatar" ng-click="goToUserPage(member.id)"> <img class="userAvatarImage" ng-src="{{member.avatar_url || 'img/default-profile.jpg'}}" alt="{{ member.displayname || member.id.substr(0, member.id.indexOf(':')) }}" diff --git a/webclient/user/user-controller.js b/webclient/user/user-controller.js new file mode 100644 index 0000000000..620230561c --- /dev/null +++ b/webclient/user/user-controller.js @@ -0,0 +1,38 @@ +/* +Copyright 2014 matrix.org + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +'use strict'; + +angular.module('UserController', ['matrixService']) +.controller('UserController', ['$scope', '$routeParams', 'matrixService', + function($scope, $routeParams, matrixService) { + $scope.user = { + 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 new file mode 100644 index 0000000000..47db09d1ee --- /dev/null +++ b/webclient/user/user.html @@ -0,0 +1,30 @@ +<div ng-controller="UserController" class="user"> + + <div id="page"> + <div id="wrapper"> + + <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> + </div> +</div> |