datacite/bracco

View on GitHub
app/templates/components/doi-publisher.hbs

Summary

Maintainability
Test Coverage
<div class="form-group {{if (v-get this.model 'publisher.name' 'isInvalid') 'has-error' 'has-feedback'}}">
  <label class="control-label col-md-3 required-label">Publisher</label>
  <div class="col-md-9 input-fragment">
    <div class="label-vertical">The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource.</div>
    <@form.element class="form-group {{if (and (not-eq this.model.state 'draft') (v-get this.model 'publisher.name' 'isValid')) 'is-valid'}}" @controlType="power-select" doi-publisher data-test-doi-publisher @value={{this.fragment.name}} @options={{this.organizations}} as |el| >
      <el.control
        @onChange={{action "selectRor"}}
        @search={{action "searchRor"}}
        @placeholder="Select publisher"
        @searchPlaceholder="Type to search..."
        @allowClear={{true}}
        @disabled={{this.disabled}}
        @searchEnabled={{true}}
        @onKeydown={{ action "createOnEnter" }}
        @noMatchesMessage="Press ENTER to use own publisher."
      as |item|>
          {{if item.name item.name this.fragment.name}}
        </el.control>
    </@form.element>
  </div>
</div>

{{#if this.fragment.publisherIdentifier}}
  <div class="form-group required-nested-label">
    <div class="col-md-9 col-md-offset-3 input-fragment">
      <input type="text" class="form-control affiliation-identifier-field no-error no-success" value={{this.fragment.publisherIdentifier}} readonly="true"/>
      <div class="help-block help-block-fragment affiliation-field">
        Publisher names and identifiers are provided by the Research Organization Registry (ROR).
      </div>
    </div>
  </div>
{{/if}}