mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 11:52:01 +00:00
bots: Improve bots permission banner.
Added a separate template file for banner messages in bots panel under personal and organisation settings. Banners for bots panel under personal settings are shown only when user cannot add bots. Banners for bots panel under organisation settings are shown only when user cannot add bots or user is administrator. Fixes #24155
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<div id="admin-bot-list" class="settings-section" data-name="bot-list-admin">
|
||||
<div class="tip bot-settings-tip"></div>
|
||||
<div class="bot-settings-tip" id="admin-bot-settings-tip">
|
||||
</div>
|
||||
<div class="clear-float"></div>
|
||||
<div>
|
||||
<button class="button rounded sea-green add-a-new-bot {{#unless can_create_new_bots}}hide{{/unless}}">{{t "Add a new bot" }}</button>
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
{{#*inline "z-api"}}<a href="/api" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}
|
||||
{{/tr}}
|
||||
</div>
|
||||
<div class="tip bot-settings-tip"></div>
|
||||
<div class="bot-settings-tip" id="personal-bot-settings-tip">
|
||||
</div>
|
||||
<div>
|
||||
<button class="button rounded sea-green add-a-new-bot {{#unless can_create_new_bots}}hide{{/unless}}">{{t "Add a new bot" }}</button>
|
||||
</div>
|
||||
|
||||
7
web/templates/settings/bot_settings_tip.hbs
Normal file
7
web/templates/settings/bot_settings_tip.hbs
Normal file
@@ -0,0 +1,7 @@
|
||||
{{#if (eq realm_bot_creation_policy permission_type.admins_only.code)}}
|
||||
<div class='tip'>{{t "Only organization administrators can add bots to this organization." }}</div>
|
||||
{{else if (eq realm_bot_creation_policy permission_type.restricted.code) }}
|
||||
<div class='tip'>{{t "Only organization administrators can add generic bots." }}</div>
|
||||
{{else}}
|
||||
<div class='tip'>{{t "Anyone in this organization can add bots." }}</div>
|
||||
{{/if}}
|
||||
Reference in New Issue
Block a user