ui/lib/shared/addon/components/form-value-array/template.hbs

40 lines
1.2 KiB
Handlebars

<label class="acc-label block">{{t valueLabel}}</label>
{{#if ary.length}}
{{#each ary as |row|}}
<div class="input-group mb-10">
<span data-title="{{t valueLabel}}">
{{#if hasBlock}}
{{yield this row}}
{{else if editing}}
{{input-paste pasted="pastedValues" class="form-control input-sm value" type="text" value=row.value placeholder=valuePlaceholder}}
{{else}}
{{row.value}}
{{/if}}
</span>
{{#if editing}}
<span class="input-group-btn">
<button class="btn bg-primary btn-sm" {{action "remove" row}}><i class="icon icon-minus"/><span class="sr-only">{{t 'generic.remove'}}</span></button>
</span>
{{/if}}
</div>
{{/each}}
{{else if (not editing)}}
<p class="text-center text-muted">{{t noDataLabel}}</p>
{{/if}}
{{#if editing}}
<button class="btn bg-link icon-btn mt-10" {{action "add"}} disabled={{cannotAdd}}><span class="darken"><i class="icon icon-plus text-small"/></span> <span>{{t addActionLabel}}</span></button>
{{#if ary.length}}
{{#if showProTip}}
<div class="protip pt-10">
{{t 'formValueArray.protip'}}
</div>
{{/if}}
{{/if}}
{{/if}}