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.

streams: Align stream type icons in "Archive stream" modal.

Sahil Batra8a0b99cb39bf
diff --git a/web/src/stream_edit.js b/web/src/stream_edit.js
index 3d30e9e41be..662f71859bf 100644
--- a/web/src/stream_edit.js
+++ b/web/src/stream_edit.js
@@ -2,7 +2,7 @@ import ClipboardJS from "clipboard";
import $ from "jquery";
import render_settings_deactivation_stream_modal from "../templates/confirm_dialog/confirm_deactivate_stream.hbs";
-import render_stream_privacy from "../templates/stream_privacy.hbs";
+import render_inline_decorated_stream_name from "../templates/inline_decorated_stream_name.hbs";
import render_change_stream_info_modal from "../templates/stream_settings/change_stream_info_modal.hbs";
import render_copy_email_address_modal from "../templates/stream_settings/copy_email_address_modal.hbs";
import render_stream_description from "../templates/stream_settings/stream_description.hbs";
@@ -595,20 +595,16 @@ export function initialize() {
}
const stream = sub_store.get(stream_id);
- const stream_privacy_symbol_html = render_stream_privacy({
- invite_only: stream.invite_only,
- is_web_public: stream.is_web_public,
- });
- const stream_name = stream_data.maybe_get_stream_name(stream_id);
+
+ const stream_name_with_privacy_symbol_html = render_inline_decorated_stream_name({stream});
const html_body = render_settings_deactivation_stream_modal({
- stream_name,
- stream_privacy_symbol_html,
+ stream_name_with_privacy_symbol_html,
});
confirm_dialog.launch({
html_heading: $t_html(
- {defaultMessage: "Archive <z-link></z-link>{stream}?"},
- {stream: stream_name, "z-link": () => stream_privacy_symbol_html},
+ {defaultMessage: "Archive <z-link></z-link>?"},
+ {"z-link": () => stream_name_with_privacy_symbol_html},
),
id: "archive-stream-modal",
help_link: "/help/archive-a-stream",
diff --git a/web/styles/app_components.css b/web/styles/app_components.css
index 903f23e9a79..917a8b41090 100644
--- a/web/styles/app_components.css
+++ b/web/styles/app_components.css
@@ -824,3 +824,21 @@ div.overlay {
}
}
}
+
+.stream-privacy-type-icon {
+ &.zulip-icon-globe {
+ position: relative;
+ top: 1px;
+ padding-right: 1px;
+ font-size: 0.75em;
+ }
+
+ &.fa-lock {
+ padding-right: 1px;
+ font-size: 0.865em;
+ }
+
+ &.hashtag:empty::after {
+ font-size: 1em;
+ }
+}
diff --git a/web/styles/subscriptions.css b/web/styles/subscriptions.css
index fcc082beaed..2fff7f3ce81 100644
--- a/web/styles/subscriptions.css
+++ b/web/styles/subscriptions.css
@@ -936,10 +936,6 @@ h4.user_group_setting_subsection_title {
}
}
-#archive-stream-modal i {
- vertical-align: middle;
-}
-
div.settings-radio-input-parent {
border-bottom: 1px solid hsl(0, 0%, 87%);
margin: 2px 0 2px 5px;
diff --git a/web/templates/confirm_dialog/confirm_deactivate_stream.hbs b/web/templates/confirm_dialog/confirm_deactivate_stream.hbs
index c65841f0b0c..64080c01944 100644
--- a/web/templates/confirm_dialog/confirm_deactivate_stream.hbs
+++ b/web/templates/confirm_dialog/confirm_deactivate_stream.hbs
@@ -1,4 +1,4 @@
{{#tr}}
Archiving stream <z-stream></z-stream> will immediately unsubscribe everyone. This action cannot be undone.
- {{#*inline "z-stream"}}<strong>{{{stream_privacy_symbol_html}}}{{stream_name}}</strong>{{/inline}}
+ {{#*inline "z-stream"}}<strong>{{{stream_name_with_privacy_symbol_html}}}</strong>{{/inline}}
{{/tr}}
diff --git a/web/templates/inline_decorated_stream_name.hbs b/web/templates/inline_decorated_stream_name.hbs
new file mode 100644
index 00000000000..3f6fc0909f4
--- /dev/null
+++ b/web/templates/inline_decorated_stream_name.hbs
@@ -0,0 +1,8 @@
+{{! This controls whether the swatch next to streams in the left sidebar has a lock icon. }}
+{{#if stream.invite_only }}
+<i class="fa fa-lock stream-privacy-type-icon" aria-hidden="true"></i>{{stream.name ~}}
+{{ else if stream.is_web_public }}
+<i class="zulip-icon zulip-icon-globe stream-privacy-type-icon" aria-hidden="true"></i>{{stream.name ~}}
+{{ else }}
+<span class="hashtag stream-privacy-type-icon"></span>{{stream.name ~}}
+{{/if}}