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.

user-pill: Correctly render bot icons on display pills.

Karl Stolley679f1a5df48d
diff --git a/web/src/user_group_create_members.ts b/web/src/user_group_create_members.ts
index eda8e3efb87..a3296809490 100644
--- a/web/src/user_group_create_members.ts
+++ b/web/src/user_group_create_members.ts
@@ -157,6 +157,7 @@ export function build_widgets(): void {
user_id: member.user_id,
full_name: member.full_name,
is_current_user: member.user_id === current_user_id,
+ is_bot: member.is_bot,
img_src: people.small_avatar_url_for_person(member),
soft_removed: user_group_create_members_data.user_id_in_soft_remove_list(
member.user_id,
diff --git a/web/styles/input_pill.css b/web/styles/input_pill.css
index babea305581..68f2292fb03 100644
--- a/web/styles/input_pill.css
+++ b/web/styles/input_pill.css
@@ -309,6 +309,14 @@
.my_user_status {
padding-right: 5px;
}
+
+ /* Zero out the margin placed to the left of the bot icon,
+ and add in the 5px of padding to the right. Specificity
+ necessitates duplicating the .pill-label class here. */
+ .pill-label .zulip-icon-bot {
+ margin-left: 0;
+ padding-right: 5px;
+ }
}
.pill:focus {
diff --git a/web/templates/settings/settings_user_list_row.hbs b/web/templates/settings/settings_user_list_row.hbs
index 65bb5628779..9bb9a4e5abf 100644
--- a/web/templates/settings/settings_user_list_row.hbs
+++ b/web/templates/settings/settings_user_list_row.hbs
@@ -1,6 +1,6 @@
<tr class="user_row{{#if is_active}} active-user{{else}} deactivated_user{{/if}}" data-user-id="{{user_id}}">
<td class="user_name panel_user_list">
- {{> ../user_display_only_pill display_value=full_name user_id=user_id img_src=img_src is_active=is_active is_current_user=is_current_user}}
+ {{> ../user_display_only_pill display_value=full_name user_id=user_id is_bot=is_bot img_src=img_src is_active=is_active is_current_user=is_current_user}}
</td>
{{#if display_email}}
<td class="email settings-email-column">
diff --git a/web/templates/stream_settings/new_stream_user.hbs b/web/templates/stream_settings/new_stream_user.hbs
index 551942c71f0..331ff9110c5 100644
--- a/web/templates/stream_settings/new_stream_user.hbs
+++ b/web/templates/stream_settings/new_stream_user.hbs
@@ -1,6 +1,6 @@
<tr class="settings-subscriber-row" data-user-id="{{user_id}}" >
<td class="panel_user_list">
- {{> ../user_display_only_pill . display_value=full_name strikethrough=soft_removed is_active=true}}
+ {{> ../user_display_only_pill . display_value=full_name strikethrough=soft_removed is_active=true is_bot=is_bot}}
</td>
{{#if email}}
<td class="subscriber-email settings-email-column {{#if soft_removed}} strikethrough {{/if}}">{{email}}</td>
diff --git a/web/templates/user_display_only_pill.hbs b/web/templates/user_display_only_pill.hbs
index 0ad3d997cc8..6693678d828 100644
--- a/web/templates/user_display_only_pill.hbs
+++ b/web/templates/user_display_only_pill.hbs
@@ -12,12 +12,12 @@
{{~#if has_status~}}
{{~> status_emoji status_emoji_info~}}
{{~/if~}}
+ {{#if is_bot}}
+ <i class="zulip-icon zulip-icon-bot" aria-label="{{t 'Bot' }}"></i>
+ {{/if}}
</span>
</a>
{{#unless is_active}}
<i class="fa fa-ban pill-deactivated deactivated-user-icon tippy-zulip-delayed-tooltip" data-tippy-content="{{#if is_bot}}{{t 'Bot is deactivated' }}{{else}}{{t 'User is deactivated' }}{{/if}}"></i>
{{/unless}}
- {{#if is_bot}}
- <i class="zulip-icon zulip-icon-bot" aria-label="{{t 'Bot' }}"></i>
- {{/if}}
</span>