settings: Convert name to pills in custom emoji section.

previously, author names are displayed in plain text, now
they are converted to pills.

Fixes #30990.
This commit is contained in:
sujal shah 2024-07-22 19:04:36 +05:30 committed by Tim Abbott
parent 64a9f83473
commit 8cc4252062
2 changed files with 7 additions and 2 deletions

View File

@ -126,12 +126,15 @@ export function populate_emoji(): void {
name: "emoji_list",
get_item: ListWidget.default_get_item,
modifier_html(item) {
const author = item.author
? {...item.author, is_active: people.is_person_active(item.author_id)}
: "";
return render_admin_emoji_list({
emoji: {
name: item.name,
display_name: item.name.replaceAll("_", " "),
source_url: item.source_url,
author: item.author ?? "",
author,
can_delete_emoji: can_delete_emoji(item),
},
});

View File

@ -12,7 +12,9 @@
</td>
<td>
{{#if author}}
<span class="emoji_author">{{author.full_name}}</span>
{{#with author}}
<span class="emoji_author panel_user_list">{{> ../user_display_only_pill display_value=full_name img_src=avatar_url}}</span>
{{/with}}
{{else}}
<span class="emoji_author">{{t "Unknown author" }}</span>
{{/if}}