From d5aa9655223d5a57b76194b155a6366791dd084c Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 30 Oct 2014 11:14:29 +0000 Subject: [PATCH] SYWEB-12: Add a 'Room Info' button which displays all state content. Content displayed in a modal dialog. Currently only read-only. --- webclient/app-filter.js | 11 +++++++++++ webclient/room/room-controller.js | 19 +++++++++++++++++++ webclient/room/room.html | 31 +++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) diff --git a/webclient/app-filter.js b/webclient/app-filter.js index 39ea1d637d..f19db4141d 100644 --- a/webclient/app-filter.js +++ b/webclient/app-filter.js @@ -76,6 +76,17 @@ angular.module('matrixWebClient') return filtered; }; }) +.filter('stateEventsFilter', function($sce) { + return function(events) { + var filtered = {}; + angular.forEach(events, function(value, key) { + if (value && typeof(value.state_key) === "string") { + filtered[key] = value; + } + }); + return filtered; + }; +}) .filter('unsafe', ['$sce', function($sce) { return function(text) { return $sce.trustAsHtml(text); diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 841b5cccdd..37f51c4e91 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -1017,6 +1017,15 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) }); }; + $scope.openRoomInfo = function() { + var modalInstance = $modal.open({ + templateUrl: 'roomInfoTemplate.html', + controller: 'RoomInfoController', + size: 'lg', + scope: $scope + }); + }; + }]) .controller('EventInfoController', function($scope, $modalInstance) { console.log("Displaying modal dialog for >>>> " + JSON.stringify($scope.event_selected)); @@ -1026,4 +1035,14 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) console.log("Redact event >> " + JSON.stringify($scope.event_selected)); $modalInstance.close("redact"); }; +}) +.controller('RoomInfoController', function($scope, $modalInstance, $filter) { + console.log("Displaying room info."); + + $scope.submitState = function(eventType, content) { + console.log("Submitting " + eventType + " with " + content); + } + + $scope.dismiss = $modalInstance.dismiss; + }); diff --git a/webclient/room/room.html b/webclient/room/room.html index 38b6d591ea..3458e97039 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -13,6 +13,34 @@ + +
[matrix]
@@ -216,6 +244,9 @@ > Video Call +
{{ feedback }}