- Added ReadOnly to admin channel settings panel

pull/4034/head
Gary Chapman 10 years ago
parent f852091a80
commit 4975ed2fde
  1. 10
      packages/rocketchat-channel-settings/client/views/channelSettings.coffee
  2. 15
      packages/rocketchat-ui-admin/admin/rooms/adminRoomInfo.html

@ -36,6 +36,16 @@ Template.channelSettings.helpers
canDeleteRoom: ->
roomType = ChatRoom.findOne(@rid, { fields: { t: 1 }})?.t
return roomType? and RocketChat.authz.hasAtLeastOnePermission("delete-#{roomType}", @rid)
readOnly: ->
return ChatRoom.findOne(@rid, { fields: { ro: 1 }})?.ro
readOnlyDescription: ->
readOnly = ChatRoom.findOne(@rid, { fields: { ro: 1 }})?.ro
if readOnly is true
return t('True')
else
return t('False')
Template.channelSettings.events
'click .delete': ->

@ -59,6 +59,21 @@
</div>
</li>
{{/if}}
{{#if notDirect}}
<li>
<label>{{_ "Read_only_channel"}}</label>
<div>
{{#if editing 'readOnly'}}
<label><input type="radio" name="readOnly" class="editing" value="true" checked="{{$eq readOnly true}}" /> {{_ "True"}}</label>
<label><input type="radio" name="readOnly" value="false" checked="{{$neq readOnly true}}" /> {{_ "False"}}</label>
<button type="button" class="button secondary cancel">{{_ "Cancel"}}</button>
<button type="button" class="button primary save">{{_ "Save"}}</button>
{{else}}
<span>{{#if readOnlyDescription}}{{_ "True"}}{{else}}{{_ "False"}}{{/if}}{{#if canEdit}} <i class="icon-pencil" data-edit="readOnly"></i>{{/if}}</span>
{{/if}}
</div>
</li>
{{/if}}
{{#each channelSettings}}
{{> Template.dynamic template=template data=data}}
{{/each}}

Loading…
Cancel
Save