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_popover: Use {{#list_each}} for move topic popover.

Anders Kaseorg692b14f737bc
diff --git a/web/src/stream_popover.ts b/web/src/stream_popover.ts
index 62155463791..1747873a0d3 100644
--- a/web/src/stream_popover.ts
+++ b/web/src/stream_popover.ts
@@ -628,15 +628,9 @@ export async function build_move_topic_to_stream_popover(
return;
}
- const participant_names = unsubscribed_participant_ids.map(
+ const unsubscribed_participant_names = unsubscribed_participant_ids.map(
(user_id) => people.get_user_by_id_assert_valid(user_id).full_name,
);
- const unsubscribed_participant_formatted_names_list_html =
- util.format_array_as_list_with_highlighted_elements(
- participant_names,
- "long",
- "conjunction",
- );
const destination_stream = stream_data.get_sub_by_id(destination_stream_id)!;
const can_subscribe_other_users = stream_data.can_subscribe_others(destination_stream);
@@ -653,7 +647,7 @@ export async function build_move_topic_to_stream_popover(
hide_close_button: true,
stream: destination_stream,
selected_propagate_mode,
- unsubscribed_participant_formatted_names_list_html,
+ unsubscribed_participant_names,
unsubscribed_participants_count,
few_unsubscribed_participants,
};
diff --git a/web/templates/modal_banner/unsubscribed_participants_warning_banner.hbs b/web/templates/modal_banner/unsubscribed_participants_warning_banner.hbs
index cc4274c673c..8df107d58d6 100644
--- a/web/templates/modal_banner/unsubscribed_participants_warning_banner.hbs
+++ b/web/templates/modal_banner/unsubscribed_participants_warning_banner.hbs
@@ -3,14 +3,26 @@
{{#if (eq selected_propagate_mode "change_one")}}
{{#tr}}
Message sender <z-user-names></z-user-names> is not subscribed to <z-stream></z-stream>.
- {{#*inline "z-user-names"}}({{{unsubscribed_participant_formatted_names_list_html}}}){{/inline}}
+ {{#*inline "z-user-names" ~}}
+ (
+ {{~#list_each unsubscribed_participant_names as |name| ~}}
+ <b class="highlighted-element">{{name}}</b>
+ {{~/list_each ~}}
+ )
+ {{~/inline}}
{{#*inline "z-stream"}}<strong class="highlighted-element">{{> ../inline_decorated_channel_name stream=stream show_colored_icon=true}}</strong>{{/inline}}
{{/tr}}
{{else if few_unsubscribed_participants}}
{{#tr}}
Some topic participants <z-user-names></z-user-names> are not subscribed to <z-stream></z-stream>.
- {{#*inline "z-user-names"}}({{{unsubscribed_participant_formatted_names_list_html}}}){{/inline}}
+ {{#*inline "z-user-names" ~}}
+ (
+ {{~#list_each unsubscribed_participant_names as |name| ~}}
+ <b class="highlighted-element">{{name}}</b>
+ {{~/list_each ~}}
+ )
+ {{~/inline}}
{{#*inline "z-stream"}}<strong class="highlighted-element">{{> ../inline_decorated_channel_name stream=stream show_colored_icon=true}}</strong>{{/inline}}
{{/tr}}