app/templates/components/doi-contributor.hbs
<label for="contributorType" class="subtitle">Contributor Type</label>
<div class="power-select-fragment" doi-contributor-type>
<@form.element @controlType="power-select" @value={{this.humanContributorType}} @helpText="The type of contributor of the resource." @options={{this.humanContributorTypes}} @formLayout="vertical" @selected={{this.humanContributorType}} @destination={{this.humanContributorType}} as |el|>
<el.control @onChange={{action "selectContributorType"}} @placeholder="Select Contributor Type" @disabled={{this.disabled}} @searchEnabled={{true}} />
</@form.element>
</div>
{{#if (gt this.fragment.nameIdentifiers.length 0)}}
<label for="nameIdentifiers" class="subtitle">Name Identifier</label>
{{#each this.fragment.nameIdentifiers as |nameIdentifier index|}}
<DoiNameIdentifier @model={{this.model}} @creator={{this.fragment}} @fragment={{nameIdentifier}} @form={{this.form}} @index={{index}} @joinNameParts={{action "joinNameParts"}} @setNameType={{action "selectNameType"}} @setReadOnly={{action "setReadOnly"}} />
{{/each}}
{{/if}}
{{#if (lte this.fragment.nameIdentifiers.length 2)}}
<BsButton class="btn-sm add-name-identifier" @outline={{true}} @onClick={{action "addNameIdentifier"}}><i class="fas fa-plus-circle"></i> Add another name identifier</BsButton>
{{/if}}
<div class="radio-fragment">
<RadioButton @value="Personal" @groupValue={{this.nameType}} @radioClass="radio select-person" @changed={{action "selectNameType"}} @disabled={{this.isReadonlyNameType}}/><span class="subtitle">Person</span>
<RadioButton @value="Organizational" @groupValue={{this.nameType}} @radioClass="radio select-organisation" @changed={{action "selectNameType"}} @disabled={{this.isReadonlyNameType}} /><span class="subtitle">Organization</span>
<RadioButton @value={{null}} @groupValue={{this.nameType}} @radioClass="radio select-unknown" @changed={{action "selectNameType"}} @disabled={{this.isReadonlyNameType}} /><span class="subtitle">Unknown</span>
</div>
{{#if this.showPersonal}}
<div>
<label for="givenName" class="subtitle">Given Name</label>
<input type="text" class="form-control given-name-field" value={{this.fragment.givenName}} placeholder="Given Name" oninput={{action "updateGivenName" value="target.value"}} readonly={{this.isReadonlyNameParts}} data-test-given-name/>
</div>
<div>
<label for="familyName" class="subtitle">Family Name</label>
<input type="text" class="form-control family-name-field" value={{this.fragment.familyName}} placeholder="Family Name" oninput={{action "updateFamilyName" value="target.value"}} readonly={{this.isReadonlyNameParts}} data-test-family-name/>
</div>
{{/if}}
<div>
<label for="name" class="subtitle required-label">Name{{if this.isReadonly ' (from Given Name and Family Name)'}}</label>
<div class="input-group">
<input type="text" class="form-control name-field" value={{this.fragment.name}} placeholder="Name" oninput={{action "updateName" value="target.value"}} readonly={{this.isReadonly}} data-test-name/>
<span class="input-group-btn">
<BsButton @outline={{true}} @onClick={{action "deleteContributor" this.index}}><i class="fas fa-trash"></i></BsButton>
</span>
</div>
</div>
{{#if (gt this.fragment.affiliation.length 0)}}
<label for="affiliation" class="subtitle">Affiliation</label>
{{#each this.fragment.affiliation as |affiliation index|}}
<DoiAffiliation @model={{this.model}} @creator={{this.fragment}} @fragment={{affiliation}} @form={{this.form}} @index={{index}} />
{{/each}}
{{#unless this.hasErrors}}
<div class="help-block help-block-fragment affiliation-field">
Affiliation names and identifiers are provided by the Research Organization Registry (ROR).
</div>
{{/unless}}
{{#if (lte this.fragment.affiliation.length 2)}}
<BsButton class="btn-sm add-affiliation" @outline={{true}} @onClick={{action "addAffiliation"}}><i class="fas fa-plus-circle"></i> Add another affiliation</BsButton>
{{/if}}
{{/if}}
<hr />