Commit 4198fb54 authored by Vladimir Baranov's avatar Vladimir Baranov

rref #5392. Add read_only users and units to channel

parent 1d5f8f37
...@@ -2611,6 +2611,7 @@ table.dataTable thead .sorting:after { ...@@ -2611,6 +2611,7 @@ table.dataTable thead .sorting:after {
outline:none; outline:none;
} }
.chat-app .close-chat-popup-window { .chat-app .close-chat-popup-window {
width: 50px; width: 50px;
height: 50px; height: 50px;
...@@ -2735,7 +2736,7 @@ table.dataTable thead .sorting:after { ...@@ -2735,7 +2736,7 @@ table.dataTable thead .sorting:after {
.chat-app .add-user-unit input { .chat-app .add-user-unit input {
width: 400px; width: 400px;
margin-top: 40px; margin-top: 10px;
height: 50px; height: 50px;
padding-left: 15px; padding-left: 15px;
border: 1px solid #ccc; border: 1px solid #ccc;
...@@ -2743,6 +2744,23 @@ table.dataTable thead .sorting:after { ...@@ -2743,6 +2744,23 @@ table.dataTable thead .sorting:after {
outline: none; outline: none;
} }
.chat-app .add-user-unit .checkbox-inline {
width: 50%;
margin-left: 25%;
margin-top: 20px;
padding-left: 25px;
border: none;
}
.chat-app .add-user-unit .checkbox-inline input {
width: 20px;
margin-top: 0;
margin-left: -25px;
border: none;
height: 20px;
}
.chat-app-close-btn { .chat-app-close-btn {
display: block; display: block;
position: absolute; position: absolute;
......
...@@ -210,8 +210,10 @@ angular.module("ulakbus.messaging") ...@@ -210,8 +210,10 @@ angular.module("ulakbus.messaging")
}; };
scope.onChange(""); scope.onChange("");
} }
}).then(function(userKey){ }).then(function(user){
return MessagingService.add_members(getKey(channel), [userKey]); var userKey = user.key;
var channelKey = getKey(channel);
return MessagingService.add_members(channelKey, [userKey], user.readonly);
}); });
break; break;
...@@ -229,9 +231,10 @@ angular.module("ulakbus.messaging") ...@@ -229,9 +231,10 @@ angular.module("ulakbus.messaging")
}; };
scope.onChange(""); scope.onChange("");
} }
}).then(function(unitKey){ }).then(function(unit){
var channelKey = getKey(iScope.selectedChannel); var unitKey = unit.key;
return MessagingService.add_members(channelKey, unitKey); var channelKey = getKey(channel);
return MessagingService.add_members(channelKey, unitKey, unit.readonly);
}); });
break; break;
} }
......
<div class="chat-popup-window add-user-unit" style="display:block;"> <div class="chat-popup-window add-user-unit" style="display:block;">
<div class="close-chat-popup-window" ng-click="cancel()"><span class="glyphicon glyphicon-remove"></span></div> <div class="close-chat-popup-window" ng-click="cancel()"><span class="glyphicon glyphicon-remove"></span></div>
<h3>{{title}}</h3> <h3>{{title}}</h3>
<label class="checkbox-inline" >
<input type="checkbox" ng-model="readonly"/>
Read only
</label>
<div class="text-center"> <div class="text-center">
<input type="text" ng-model="query" ng-change="onChange(query)" placeholder="{{placeholder}}"> <input type="text" ng-model="query" ng-change="onChange(query)" placeholder="{{placeholder}}">
</div> </div>
<div class="search-results"> <div class="search-results">
<span class="loader" ng-show="loading"></span> <span class="loader" ng-show="loading"></span>
<div class="user" ng-repeat="item in searchResult" ng-click="done(item[1])"> <div class="user" ng-repeat="item in searchResult" ng-click="done({key: item[1], readonly: readonly})">
<img ng-src="{{item[2]}}" ng-show="item[2]"> <img ng-src="{{item[2]}}" ng-show="item[2]">
<div class="user-name">{{item[0]}}</div> <div class="user-name">{{item[0]}}</div>
</div> </div>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<ul class="channels"> <ul class="channels">
<li class="title">KANALLAR <span class="add-action glyphicon glyphicon-plus-sign" ng-click="createChannel()"></span></li> <li class="title">KANALLAR <span class="add-action glyphicon glyphicon-plus-sign" ng-click="createChannel()"></span></li>
<li ng-class="{'unread': ch.unread, 'active': isChannelSelected(ch)}" title="{{ch.description}}" ng-repeat="ch in publicChannels" ng-click="selectChannel(ch)">{{ch.name}}</li> <li ng-class="{'unread': ch.unread, 'public-ro-channel': ch.read_only, 'active': isChannelSelected(ch)}" title="{{ch.description}}" ng-repeat="ch in publicChannels" ng-click="selectChannel(ch)">{{ch.name}}</li>
</ul> </ul>
<ul class="direct-messages"> <ul class="direct-messages">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment