|
|
@ -25,6 +25,8 @@ export default class AppEditChannelTab extends SliderSuperTab { |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
const section = new SettingSection({noDelimiter: true}); |
|
|
|
const section = new SettingSection({noDelimiter: true}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(appChatsManager.hasRights(-this.peerId, 'change_info')) { |
|
|
|
const inputFields: InputField[] = []; |
|
|
|
const inputFields: InputField[] = []; |
|
|
|
|
|
|
|
|
|
|
|
const inputWrapper = document.createElement('div'); |
|
|
|
const inputWrapper = document.createElement('div'); |
|
|
@ -56,28 +58,7 @@ export default class AppEditChannelTab extends SliderSuperTab { |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.content.append(this.editPeer.nextBtn); |
|
|
|
this.content.append(this.editPeer.nextBtn); |
|
|
|
|
|
|
|
|
|
|
|
const groupTypeRow = new Row({ |
|
|
|
section.content.append(this.editPeer.avatarEdit.container, inputWrapper); |
|
|
|
title: 'Channel Type', |
|
|
|
|
|
|
|
subtitle: 'Private', |
|
|
|
|
|
|
|
clickable: true, |
|
|
|
|
|
|
|
icon: 'lock' |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const administratorsRow = new Row({ |
|
|
|
|
|
|
|
title: 'Administrators', |
|
|
|
|
|
|
|
subtitle: '5', |
|
|
|
|
|
|
|
icon: 'admin', |
|
|
|
|
|
|
|
clickable: true |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const signMessagesCheckboxField = new CheckboxField({ |
|
|
|
|
|
|
|
text: 'Sign Messages', |
|
|
|
|
|
|
|
checked: false |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
section.content.append(this.editPeer.avatarEdit.container, inputWrapper, groupTypeRow.container, administratorsRow.container, signMessagesCheckboxField.label); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.scrollable.append(section.container); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
attachClickEvent(this.editPeer.nextBtn, () => { |
|
|
|
attachClickEvent(this.editPeer.nextBtn, () => { |
|
|
|
this.editPeer.nextBtn.disabled = true; |
|
|
|
this.editPeer.nextBtn.disabled = true; |
|
|
@ -106,6 +87,49 @@ export default class AppEditChannelTab extends SliderSuperTab { |
|
|
|
}, {listenerSetter: this.listenerSetter}); |
|
|
|
}, {listenerSetter: this.listenerSetter}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(appChatsManager.hasRights(-this.peerId, 'change_type')) { |
|
|
|
|
|
|
|
const channelTypeRow = new Row({ |
|
|
|
|
|
|
|
title: 'Channel Type', |
|
|
|
|
|
|
|
subtitle: 'Private', |
|
|
|
|
|
|
|
clickable: true, |
|
|
|
|
|
|
|
icon: 'lock' |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
section.content.append(channelTypeRow.container); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(appChatsManager.hasRights(-this.peerId, 'change_info')) { |
|
|
|
|
|
|
|
const discussionRow = new Row({ |
|
|
|
|
|
|
|
title: 'Discussion', |
|
|
|
|
|
|
|
subtitle: 'Add', |
|
|
|
|
|
|
|
clickable: true, |
|
|
|
|
|
|
|
icon: 'message' |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
section.content.append(discussionRow.container); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const administratorsRow = new Row({ |
|
|
|
|
|
|
|
title: 'Administrators', |
|
|
|
|
|
|
|
subtitle: '' + chatFull.admins_count, |
|
|
|
|
|
|
|
icon: 'admin', |
|
|
|
|
|
|
|
clickable: true |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
section.content.append(administratorsRow.container); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(appChatsManager.hasRights(-this.peerId, 'change_info')) { |
|
|
|
|
|
|
|
const signMessagesCheckboxField = new CheckboxField({ |
|
|
|
|
|
|
|
text: 'Sign Messages', |
|
|
|
|
|
|
|
checked: false |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
section.content.append(signMessagesCheckboxField.label); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.scrollable.append(section.container); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
const section = new SettingSection({ |
|
|
|
const section = new SettingSection({ |
|
|
|
|
|
|
|
|
|
|
@ -123,7 +147,7 @@ export default class AppEditChannelTab extends SliderSuperTab { |
|
|
|
this.scrollable.append(section.container); |
|
|
|
this.scrollable.append(section.container); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
if(appChatsManager.hasRights(-this.peerId, 'delete_chat')) { |
|
|
|
const section = new SettingSection({ |
|
|
|
const section = new SettingSection({ |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
@ -133,7 +157,7 @@ export default class AppEditChannelTab extends SliderSuperTab { |
|
|
|
attachClickEvent(btnDelete, () => { |
|
|
|
attachClickEvent(btnDelete, () => { |
|
|
|
new PopupPeer('popup-delete-channel', { |
|
|
|
new PopupPeer('popup-delete-channel', { |
|
|
|
peerId: this.peerId, |
|
|
|
peerId: this.peerId, |
|
|
|
title: 'Delete Group?', |
|
|
|
title: 'Delete Channel?', |
|
|
|
description: `Are you sure you want to delete this channel? All subscribers will be removed and all messages will be lost.`, |
|
|
|
description: `Are you sure you want to delete this channel? All subscribers will be removed and all messages will be lost.`, |
|
|
|
buttons: addCancelButton([{ |
|
|
|
buttons: addCancelButton([{ |
|
|
|
text: 'DELETE', |
|
|
|
text: 'DELETE', |
|
|
|