datacite/bracco

View on GitHub
app/templates/dois/show/edit.hbs

Summary

Maintainability
Test Coverage
<div class="panel panel-transparent" id="doi-edit-form">
  <div class="panel-body">
    <div class="col-md-9 col-md-offset-3 form-help-header">
      {{#each this.flashMessages.queue as |flash|}}
        <FlashMessage @flash={{flash}} />
      {{/each}}

      <h3 class="help-header">Update DOI (Form)</h3>
      <div class="label-vertical">
        More information about DOI registration via form can be found on our <a target="_blank" rel="noopener noreferrer" href="https://support.datacite.org/docs/fabrica-create-doi-form">Support
          Website</a>. Required properties are marked with a red asterisk.
      </div>
    </div>
    <BsForm @formLayout="horizontal" class="form-horizontal" @horizontalLabelGridClass="col-md-3" @model={{this.model}} @onSubmit={{action "submit" this.model}} as |form|>
      <h3 class="member-results">Required Properties</h3>

      <div class="form-group required-nested-label">
        <label class="control-label col-md-3">DOI</label>
        <div class="col-md-9 input-fragment">
          <div class="label-vertical">The globally unique string that identifies the resource and can't be changed.</div>
          <form.element @controlType="text" id="doi" @property="doi" as |el|>
            <el.control disabled={{true}} />
          </form.element>
        </div>
      </div>

      <DoiState @class="required-nested-label" @model={{this.model}} @form={{form}} />

      <div class="form-group required-nested-label {{if (v-get this.model 'url' 'isInvalid') 'has-error' 'has-feedback'}}">
        <label class="control-label col-md-3">URL</label>
        <div class="col-md-9 input-fragment">
          <div class="label-vertical">The location of the landing page with more information about the resource.</div>
          <form.element id="url" class="form-group" @controlType="text" @property="url" as |el| >
            <el.control placeholder="URL" />
            <div class="{{el.validation}} help-block">Should be a https URL — within the allowed domain(s) of your repository if domain restrictions are enabled in the repository settings. Http and ftp are also supported. For example http://example.org</div>
          </form.element>
        </div>
      </div>

      <DoiCreators @model={{this.model}} @form={{form}} />
      <DoiTitles @model={{this.model}} @form={{form}} />
      <DoiPublisher @model={{this.model}} @form={{form}} @fragment={{this.model.publisher}} />

      <div class="form-group required-nested-label {{if (v-get this.model 'publicationYear' 'isInvalid') 'has-error' 'has-feedback'}}">
        <label class="control-label col-md-3">Publication Year</label>
        <div class="col-md-9 input-fragment">
          <div class="label-vertical">The year when the resource was or will be made publicly available.</div>
          <form.element id="publication-year" class="form-group" @controlType="text" @property="publicationYear" as |el| >
            <el.control />
            <div class="{{el.validation}} help-block">Must be a year between 1000 and {{current-year this.model.maxMintFutureOffset}}.</div>
          </form.element>
        </div>
      </div>

      <DoiTypes @class="required-nested-label" @model={{this.model}} @form={{form}} />

      <h3 class="member-results">Recommended Properties</h3>

      <DoiSubjects @model={{this.model}} @form={{form}} />
      <DoiContributors @model={{this.model}} @form={{form}} />
      <DoiDates @model={{this.model}} @form={{form}} />
      <DoiRelatedIdentifiers @model={{this.model}} @form={{form}} />

      <DoiDescriptions @model={{this.model}} @form={{form}} />

      <DoiGeoLocations @model={{this.model}} @form={{form}} />

      <h3 class="member-results">Optional Properties</h3>

      <DoiLanguage @model={{this.model}} @form={{form}} />
      <DoiAlternateIdentifiers @model={{this.model}} @form={{form}} />
      <DoiRightsList @model={{this.model}} @form={{form}} @spdx={{this.spdx}} />
      <DoiSizes @model={{this.model}} @form={{form}} />
      <DoiFormats @model={{this.model}} @form={{form}} />

      <div class="form-group">
        <label class="control-label col-md-3">Version</label>
        <div class="col-md-9 input-fragment">
          <div class="label-vertical">The version number of the resource.</div>
          <form.element id="version" @controlType="text" @property="version" data-test-version as |el| >
            <el.control placeholder="Version" id="version-field" />
          </form.element>
        </div>
      </div>

      <DoiFundingReferences @model={{this.model}} @form={{form}} />

      <DoiRelatedItems @model={{this.model}} @form={{form}} />

      <div class="col-md-9 col-md-offset-3">
        {{#if (is-empty (doi-form-errors this.model))}}
          <button type="submit" id="doi-update" class="btn btn-sm btn-fill" disabled={{false}}>Update DOI</button>
        {{else}}
          <BsAlert @dismissible={{false}} @type="danger">
            To save this DOI, first resolve the errors with these properties: {{doi-form-errors this.model}}.
          </BsAlert>

          <button type="submit" id="doi-update" class="btn btn-sm btn-fill" disabled={{true}}>Update DOI</button>
        {{/if}}

        <button class="btn btn-sm" type="button" {{action "cancel"}}>Cancel</button>
      </div>
    </BsForm>

  </div>
</div>