app/templates/components/doi-subjects.hbs
<div class="form-group" data-test-doi-subjects>
<label class="control-label col-md-3">Subjects</label>
<div class="col-md-9">
<div class="label-vertical">Subject, keyword, classification code, or key phrase describing the resource.</div>
{{#if this.showSubjects}}
{{#each this.model.subjects as |subject index|}}
<DoiSubject @model={{this.model}} @fragment={{subject}} @form={{this.form}} @index={{index}} />
{{/each}}
{{#if (lte this.model.subjects.length 6)}}
<BsButton class="btn-sm" id="add-subject" @outline={{true}} @onClick={{action "addSubject"}}><i class="fas fa-plus"></i> Add {{if (gt this.model.subjects.length 0) "another "}} subject</BsButton>
{{/if}}
{{#if (gt this.model.subjects.length 0)}}
<BsButton id="toggle-subjects" class="btn-sm" @outline={{true}} @onClick={{action "toggleSubjects"}}><i class="fas fa-eye-slash"></i> Hide {{pluralize this.model.subjects.length 'subject'}}</BsButton>
{{/if}}
{{else}}
{{#if (gt this.model.subjects.length 0)}}
<BsButton id="toggle-subjects" class="btn-sm" @outline={{true}} @onClick={{action "toggleSubjects"}}><i class="fas fa-eye"></i> Show {{pluralize this.model.subjects.length 'subject'}}</BsButton>
{{else}}
<BsButton class="btn-sm btn-warning" id="add-subject" @outline={{true}} @onClick={{action "addSubject"}}><i class="fas fa-plus"></i> Add subject</BsButton>
{{/if}}
{{/if}}
</div>
</div>