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 {
outline:none;
}
.chat-app .close-chat-popup-window {
width: 50px;
height: 50px;
......@@ -2735,7 +2736,7 @@ table.dataTable thead .sorting:after {
.chat-app .add-user-unit input {
width: 400px;
margin-top: 40px;
margin-top: 10px;
height: 50px;
padding-left: 15px;
border: 1px solid #ccc;
......@@ -2743,6 +2744,23 @@ table.dataTable thead .sorting:after {
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 {
display: block;
position: absolute;
......
......@@ -210,8 +210,10 @@ angular.module("ulakbus.messaging")
};
scope.onChange("");
}
}).then(function(userKey){
return MessagingService.add_members(getKey(channel), [userKey]);
}).then(function(user){
var userKey = user.key;
var channelKey = getKey(channel);
return MessagingService.add_members(channelKey, [userKey], user.readonly);
});
break;
......@@ -229,9 +231,10 @@ angular.module("ulakbus.messaging")
};
scope.onChange("");
}
}).then(function(unitKey){
var channelKey = getKey(iScope.selectedChannel);
return MessagingService.add_members(channelKey, unitKey);
}).then(function(unit){
var unitKey = unit.key;
var channelKey = getKey(channel);
return MessagingService.add_members(channelKey, unitKey, unit.readonly);
});
break;
}
......
<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>
<h3>{{title}}</h3>
<label class="checkbox-inline" >
<input type="checkbox" ng-model="readonly"/>
Read only
</label>
<div class="text-center">
<input type="text" ng-model="query" ng-change="onChange(query)" placeholder="{{placeholder}}">
</div>
<div class="search-results">
<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]">
<div class="user-name">{{item[0]}}</div>
</div>
......
......@@ -11,7 +11,7 @@
<ul class="channels">
<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 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