datacite/bracco

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

Summary

Maintainability
Test Coverage
<div class="form-group {{if (v-get this.model 'types.resourceTypeGeneral' 'isInvalid') 'has-error' 'has-feedback'}}">
  <label class="control-label col-md-3">Resource Type General</label>
  <div class="col-md-9 input-fragment">
    <div class="label-vertical">The general type of the resource.</div>
    <@form.element @controlType="power-select" id="resource-type-general" class="form-group {{if (and (not-eq this.model.state 'draft') (v-get this.model 'types.resourceTypeGeneral' 'isValid')) 'is-valid'}}" @property="types.resourceTypeGeneral" @options={{this.resourceTypesGeneral}} @helpText="If none of the provided values matches, use Other and specify the resource type in the field below." @destination={{this.resourceTypeGeneral}} as |el|>
      <el.control
        @onChange={{action "selectResourceTypeGeneral"}}
        @placeholder="Select Resource Type General"
        @disabled={{this.disabled}} 
        @searchEnabled={{true}} as |item|>
          {{humanize (underscore item)}}
      </el.control>
    </@form.element>
  </div>
</div>

<div class="form-group">
  <div class="col-md-9 col-md-offset-3">
    <div class="power-select-label">
      <label for="subject" class="subtitle">Resource Type</label>
    </div>
    <div class="power-select-fragment" doi-resource-type>
      <@form.element @controlType="text" id="resource-type" class="form-group" @property="types.resourceType" @helpText="A description of the resource, the preferred format is a single term of some detail." as |el| >
        <el.control placeholder="Resource Type" disabled={{this.disabled}} />
      </@form.element>
    </div>
  </div>
</div>