discourse/app/assets/javascripts/admin/templates/components/simple-list.hbs

41 lines
908 B
Handlebars

{{#if collection}}
<div class="values">
{{#each collection as |value index|}}
<div data-index={{index}} class="value">
{{d-button
action=(action "removeValue")
actionParam=value
icon="times"
class="remove-value-btn btn-small"
}}
{{input
title=value
value=value
class="value-input"
focus-out=(action "changeValue" index)
}}
</div>
{{/each}}
</div>
{{/if}}
<div class="simple-list-input">
{{input
type="text"
value=newValue
placeholderKey="admin.site_settings.simple_list.add_item"
class="add-value-input"
autocomplete="discourse"
autocorrect="off"
autocapitalize="off"}}
{{d-button
action=(action "addValue")
actionParam=newValue
disabled=inputEmpty
icon="plus"
class="add-value-btn btn-small"
}}
</div>