discourse/app/assets/javascripts/admin/addon/components/emoji-value-list.hbs

59 lines
1.6 KiB
Handlebars

{{#if this.collection}}
<ul class="values emoji-value-list">
{{#each this.collection as |data index|}}
<li class="value" data-index={{index}}>
<DButton
@action={{fn this.removeValue data}}
@icon="xmark"
@disabled={{not data.isEditable}}
class="remove-value-btn btn-small"
/>
<div
class="value-input emoji-details
{{if data.isEditable 'can-edit'}}
{{if data.isEditing 'd-editor-textarea-wrapper'}}"
{{on "click" (fn this.editValue index)}}
role="button"
>
<img
height="15px"
width="15px"
src={{data.emojiUrl}}
class="emoji-list-emoji"
/>
<span class="emoji-name">{{data.value}}</span>
</div>
{{#if this.showUpDownButtons}}
<DButton
@action={{fn this.shift -1 index}}
@icon="arrow-up"
class="shift-up-value-btn btn-small"
/>
<DButton
@action={{fn this.shift 1 index}}
@icon="arrow-down"
class="shift-down-value-btn btn-small"
/>
{{/if}}
</li>
{{/each}}
</ul>
{{/if}}
<div class="value">
<DButton
@action={{fn this.editValue this.data}}
@icon="discourse-emojis"
@label="admin.site_settings.emoji_list.add_emoji_button.label"
class="add-emoji-button d-editor-textarea-wrapper"
/>
</div>
<EmojiPicker
@isActive={{this.emojiPickerIsActive}}
@isEditorFocused={{this.isEditorFocused}}
@emojiSelected={{this.emojiSelected}}
@onEmojiPickerClose={{this.closeEmojiPicker}}
/>