app/templates/components/doi-formats.hbs
<div class="form-group">
<label class="control-label col-md-3" data-test-formats>Formats</label>
<div class="col-md-9">
<div class="label-vertical">Technical format of the resource.</div>
{{#if this.showFormats}}
{{#each this.model.formats as |format index|}}
<DoiFormat @model={{this.model}} @fragment={{format}} @form={{this.form}} @index={{index}} />
{{/each}}
{{#if (lte this.model.formats.length 5)}}
<BsButton class="btn-sm" id="add-format" @outline={{true}} @onClick={{action "addFormat"}}><i class="fas fa-plus"></i> Add {{if (gt this.model.formats.length 0) "another "}}format</BsButton>
{{/if}}
{{#if (gt this.model.formats.length 0)}}
<BsButton id="toggle-formats" class="btn-sm" @outline={{true}} @onClick={{action "toggleFormats"}}><i class="fas fa-eye-slash"></i> Hide {{pluralize this.model.formats.length 'format'}}</BsButton>
{{/if}}
{{else}}
{{#if (gt this.model.formats.length 0)}}
<BsButton id="toggle-formats" class="btn-sm" @outline={{true}} @onClick={{action "toggleFormats"}}><i class="fas fa-eye"></i> Show {{pluralize this.model.formats.length 'format'}}</BsButton>
{{else}}
<BsButton class="btn-sm btn-warning" id="add-format" @outline={{true}} @onClick={{action "addFormat"}}><i class="fas fa-plus"></i> Add format</BsButton>
{{/if}}
{{/if}}
</div>
</div>