Files
zulip/static/templates/admin_emoji_list.handlebars
Rohitt Vashishtha c41c82aae0 settings_emoji: Use display_name in handlebars.
This commit fixes two issues with the previous implementation:

1. JavaScript's replace replaces only the first instance,
   thus we need to use a regex.
2. Handlebars was setting the id of the HTML elements with
   spaces in between which broke the delete button; now a
   new variable display_name is passed to the template.

This also makes changes to the casper tests to have an emoji
name with multiple spaces in it to ensure this bug doesn't
appear again.
2018-08-07 10:22:08 -07:00

27 lines
802 B
Handlebars

{{#with emoji}}
<tr class="emoji_row" id="emoji_{{name}}">
<td>
<span class="emoji_name">{{display_name}}</span>
</td>
<td>
<span class="emoji_image">
<a href="{{source_url}}" target="_blank">
<img src="{{source_url}}" alt="{{display_name}}" />
</a>
</span>
</td>
<td>
{{#if author}}
<span class="emoji_author">{{author.full_name}}</span>
{{else}}
<span class="emoji_author">Unknown Author</span>
{{/if}}
</td>
<td>
<button class="button rounded small delete btn-danger" {{#unless can_admin_emoji}}disabled="disabled"{{/unless}} data-emoji-name="{{name}}">
<i class="fa fa-trash-o" aria-hidden="true"></i>
</button>
</td>
</tr>
{{/with}}