From af190f286c533203e8f1264b5545cb7eff5f37b9 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 21 Jul 2015 10:33:41 +0100 Subject: [PATCH] Add event power levels to room settings --- skins/base/css/molecules/RoomSettings.css | 22 +++------------------- skins/base/views/molecules/RoomSettings.js | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/skins/base/css/molecules/RoomSettings.css b/skins/base/css/molecules/RoomSettings.css index 5e325294..4100b9e3 100644 --- a/skins/base/css/molecules/RoomSettings.css +++ b/skins/base/css/molecules/RoomSettings.css @@ -14,32 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_RoomSettings_power_levels { +.mx_RoomSettings_settings { display: table; margin: 5px 0; } -.mx_RoomSettings_power_levels > div { +.mx_RoomSettings_settings > div { display: table-row; } -.mx_RoomSettings_power_levels > div > * { - display: table-cell; - - margin: 0 10px; -} - - -.mx_RoomSettings_user_levels { - display: table; - margin: 5px 0; -} - -.mx_RoomSettings_user_levels > div { - display: table-row; -} - -.mx_RoomSettings_user_levels > div > * { +.mx_RoomSettings_settings > div > * { display: table-cell; margin: 0 10px; diff --git a/skins/base/views/molecules/RoomSettings.js b/skins/base/views/molecules/RoomSettings.js index 14197154..4f562da0 100644 --- a/skins/base/views/molecules/RoomSettings.js +++ b/skins/base/views/molecules/RoomSettings.js @@ -86,6 +86,7 @@ module.exports = React.createClass({ var default_user_level = parseInt(power_levels.users_default); var user_levels = power_levels.users; + var events_levels = power_levels.events; var user_id = MatrixClientPeg.get().credentials.userId; @@ -107,7 +108,7 @@ module.exports = React.createClass({
Power levels: -
+
User levels: -
+
{Object.keys(user_levels).map(function(user, i) { return (
@@ -157,6 +158,18 @@ module.exports = React.createClass({ ); })}
+ + Event levels: +
+ {Object.keys(events_levels).map(function(event_type, i) { + return ( +
+ + +
+ ); + })} +
); }