datacite/bracco

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

Summary

Maintainability
Test Coverage
<div class="panel panel-transparent" id="doi-modify-form-file-upload">
  <div class="panel-body">
    <div class="col-md-9 col-md-offset-3 form-help-header">
      <h3 class="help-header">Update 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-form">Support Website</a>.
      </div>
    </div>

    <BsForm @formLayout="horizontal" class="form-horizontal" @horizontalLabelGridClass="col-md-3" @model={{this.model}} @onSubmit={{action "submit" this.model}} as |form|>
      <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" @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}} @form={{form}} />

      <div class="col-md-9 col-md-offset-3">
        {{#if (is-empty (doi-form-errors this.model))}}
          <button type="submit" id="doi-modify" 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-modify" 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>