datacite/bracco

View on GitHub
app/templates/repositories/show/dois/upload.hbs

Summary

Maintainability
Test Coverage
<div class="panel panel-transparent" id="doi-create-form-file-upload">
  <div class="panel-body">
    <div class="col-md-9 col-md-offset-3 form-help-header">
      <h3 class="help-header">
        Create DOI (File Upload)
      </h3>
      <div class="label-vertical">
        More information about DOI registration via file upload can be found on our
        <a
          target="_blank" rel="noopener noreferrer" href="https://support.datacite.org/docs/fabrica-create-doi-file-upload"
        >
          Support Website
        </a>
        .
      </div>
    </div>
    <BsForm
      @formLayout="horizontal"
      class="form-horizontal"
      @horizontalLabelGridClass="col-md-3"
      @model={{this.model.doi}}
      @onSubmit={{action 'submit' this.model.doi}} as |form|
    >
      <DoiDoi
        @model={{this.model.doi}}
        @repository={{this.model.repository}}
        @form={{form}}
      />
      <div
        class="form-group required-nested-label
          {{if (v-get this.model.doi '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"
            @controlType="text"
            @property="url"
            @helpText="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" as |el|
          >
            <el.control id="url-field" placeholder="URL" />
          </form.element>
        </div>
      </div>
      <DoiUpload @model={{this.model.doi}} @form={{form}} />
      <div class="col-md-9 col-md-offset-3">
        {{#each this.flashMessages.queue as |flash|}}
          <FlashMessage @flash={{flash}} />
        {{/each}}
      </div>
      <div class="col-md-9 col-md-offset-3">
        {{#if (is-empty (doi-form-errors this.model.doi))}}
          <button
            type="submit"
            id="doi-create"
            class="btn btn-sm btn-fill"
            disabled={{false}}
          >
            Create DOI
          </button>
        {{else}}
          <BsAlert @dismissible={{false}} @type="danger">
            To save this DOI, first resolve the errors with these properties:
            {{doi-form-errors this.model.doi}}
            .
          </BsAlert>
          <button
            type="submit"
            id="doi-create"
            class="btn btn-sm btn-fill"
            disabled={{true}}
          >
            Create DOI
          </button>
        {{/if}}
        <button class="btn btn-sm" type="button" {{action 'cancel'}}>
          Cancel
        </button>
      </div>
    </BsForm>
  </div>
</div>