mirror of
https://github.com/zulip/zulip.git
synced 2026-07-18 21:04:19 +08:00
settings: Fix live-update of text on the bots admin page.
We did not live-update the text on the top of admin bots page correctly when changing the bot creation policy. This commit fixes it.
This commit is contained in:
parent
4b23ac2743
commit
1080da08f0
@ -176,10 +176,15 @@ export function update_bot_settings_tip($tip_container, for_org_settings) {
|
||||
function update_add_bot_button() {
|
||||
if (can_create_new_bots()) {
|
||||
$("#bot-settings .add-a-new-bot").show();
|
||||
$("#admin-bot-list .add-a-new-bot").show();
|
||||
$("#admin-bot-list .add-new-bots").show();
|
||||
$("#admin-bot-list .manage-your-bots").hide();
|
||||
} else {
|
||||
$("#bot-settings .add-a-new-bot").hide();
|
||||
$("#admin-bot-list .add-a-new-bot").hide();
|
||||
$("#admin-bot-list .add-new-bots").hide();
|
||||
|
||||
if (bot_data.get_all_bots_for_current_user().length > 0) {
|
||||
$("#admin-bot-list .manage-your-bots").show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4,18 +4,19 @@
|
||||
<div class="clear-float"></div>
|
||||
<div>
|
||||
{{t "You are viewing all the bots in this organization." }}
|
||||
{{#if can_create_new_bots}}
|
||||
<span class="add-new-bots" {{#unless can_create_new_bots}}style="display: none;"{{/unless}}>
|
||||
{{#tr}}
|
||||
You can <z-link-new-bot>add a new bot</z-link-new-bot> or <z-link-manage-bot>manage</z-link-manage-bot> your own bots.
|
||||
{{#*inline "z-link-new-bot"}}<a class="add-a-new-bot">{{> @partial-block}}</a>{{/inline}}
|
||||
{{#*inline "z-link-manage-bot"}}<a href="/#settings/your-bots">{{> @partial-block}}</a>{{/inline}}
|
||||
{{/tr}}
|
||||
{{else if has_bots}}
|
||||
</span>
|
||||
<span class="manage-your-bots" {{#unless (and (not can_create_new_bots) has_bots)}}style="display: none;"{{/unless}}>
|
||||
{{#tr}}
|
||||
You can <z-link>manage</z-link> your own bots.
|
||||
{{#*inline "z-link"}}<a href="/#settings/your-bots">{{> @partial-block}}</a>{{/inline}}
|
||||
{{/tr}}
|
||||
{{/if}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="settings_panel_list_header">
|
||||
<h3>{{t "Bots"}}</h3>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user