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: Improve message for no description streams.

m-e-l-u-h-a-n889229ba1687
diff --git a/static/js/stream_edit.js b/static/js/stream_edit.js
index 76534f87c59..8c297f17827 100644
--- a/static/js/stream_edit.js
+++ b/static/js/stream_edit.js
@@ -3,6 +3,7 @@ import $ from "jquery";
import render_change_stream_info_modal from "../templates/change_stream_info_modal.hbs";
import render_settings_deactivation_stream_modal from "../templates/confirm_dialog/confirm_deactivate_stream.hbs";
import render_unsubscribe_private_stream_modal from "../templates/confirm_dialog/confirm_unsubscribe_private_stream.hbs";
+import render_stream_description from "../templates/stream_description.hbs";
import render_stream_member_list_entry from "../templates/stream_member_list_entry.hbs";
import render_stream_subscription_request_result from "../templates/stream_subscription_request_result.hbs";
import render_subscription_settings from "../templates/subscription_settings.hbs";
@@ -221,9 +222,10 @@ export function update_stream_name(sub, new_name) {
export function update_stream_description(sub) {
const stream_settings = settings_for_sub(sub);
stream_settings.find("input.description").val(sub.description);
- stream_settings
- .find(".sub-stream-description")
- .html(util.clean_user_content_links(sub.rendered_description));
+ const html = render_stream_description({
+ rendered_description: util.clean_user_content_links(sub.rendered_description),
+ });
+ stream_settings.find(".stream-description").html(html);
}
export function invite_user_to_stream(user_ids, sub, success, failure) {
diff --git a/static/styles/subscriptions.css b/static/styles/subscriptions.css
index 1ed9da970ef..f9d4c0930ac 100644
--- a/static/styles/subscriptions.css
+++ b/static/styles/subscriptions.css
@@ -759,7 +759,6 @@
}
}
-#subscription_overlay .stream-description .sub-stream-description:empty::after,
.stream-row .sub-info-box .description:empty::after {
content: attr(data-no-description);
font-style: italic;
diff --git a/static/templates/stream_description.hbs b/static/templates/stream_description.hbs
new file mode 100644
index 00000000000..e3e636675a1
--- /dev/null
+++ b/static/templates/stream_description.hbs
@@ -0,0 +1,9 @@
+{{#if rendered_description}}
+<span class="sub-stream-description rendered_markdown">
+ {{rendered_markdown rendered_description}}
+</span>
+{{else}}
+<span class="sub-stream-description no-description">
+ {{t "This stream does not yet have a description." }}
+</span>
+{{/if}}
diff --git a/static/templates/subscription_settings.hbs b/static/templates/subscription_settings.hbs
index abd1adb5178..40efbc26bcb 100644
--- a/static/templates/subscription_settings.hbs
+++ b/static/templates/subscription_settings.hbs
@@ -33,9 +33,9 @@
</div>
</div>
<div class="stream-description">
- <span class="sub-stream-description rendered_markdown" data-no-description="{{t 'No description.' }}">
- {{rendered_markdown rendered_description}}
- </span>
+ {{> stream_description
+ rendered_description=rendered_description
+ }}
</div>
<div class="subscription-type">
<div class="subscription-type-text">