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

37 lines
1.3 KiB
Handlebars

<label class="acc-label block">{{t valueLabel}}</label>
{{#if ary.length}}
<table class="table fixed no-lines mb-10">
{{#each ary as |row|}}
<tr>
<td class="pb-10" 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}}
</td>
{{#if editing}}
<td width="30" class="pb-10 text-right">
<button class="btn bg-primary btn-sm" {{action "remove" row}}><i class="icon icon-minus"/><span class="sr-only">{{t 'generic.remove'}}</span></button>
</td>
{{/if}}
</tr>
{{/each}}
</table>
{{else if (not editing)}}
<tr><td class="text-center text-muted lacsso pt-20 pb-20">{{t 'formValueArray.noData'}}</td></tr>
{{/if}}
{{#if editing}}
<button class="btn bg-link icon-btn" {{action "add"}}><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}}