Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

stream_settings: Show disabled create stream button and text.

sujalaafcd4303877
diff --git a/web/styles/app_components.css b/web/styles/app_components.css
index 0b6815f99ad..56f52189370 100644
--- a/web/styles/app_components.css
+++ b/web/styles/app_components.css
@@ -697,6 +697,11 @@ div.overlay {
box-shadow: 0 1px 4px 0 hsl(235deg 18% 7%);
outline: none;
}
+
+ &:disabled {
+ cursor: not-allowed;
+ opacity: 0.5;
+ }
}
.color_animated_button {
diff --git a/web/templates/stream_settings/stream_settings_overlay.hbs b/web/templates/stream_settings/stream_settings_overlay.hbs
index 63358dc8bfb..955eb2d9d08 100644
--- a/web/templates/stream_settings/stream_settings_overlay.hbs
+++ b/web/templates/stream_settings/stream_settings_overlay.hbs
@@ -58,14 +58,18 @@
<div id="stream_settings_title" class="stream-info-title">{{t 'Channel settings' }}</div>
</div>
<div class="nothing-selected">
+ <button type="button" class="create_stream_button animated-purple-button" {{#unless can_create_streams}}disabled{{/unless}}>{{t 'Create channel' }}</button>
{{#if can_create_streams}}
- <button type="button" class="create_stream_button animated-purple-button">{{t 'Create channel' }}</button>
<span class="settings-empty-option-text">
{{#tr}}
First time? Read our <z-link>guidelines</z-link> for creating and naming channels.
{{#*inline "z-link"}}<a href="/help/getting-your-organization-started-with-zulip#create-channels" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}
{{/tr}}
</span>
+ {{else}}
+ <span class="settings-empty-option-text">
+ {{t 'You do not have permission to create channels in this organization.' }}
+ </span>
{{/if}}
</div>
<div id="stream_settings" class="settings" data-simplebar data-simplebar-tab-index="-1" data-simplebar-auto-hide="false">