datacite/bracco

View on GitHub
app/templates/repositories/show/settings.hbs

Summary

Maintainability
Test Coverage
<div class="row">
  <div data-test-left-sidebar class="col-md-3">
    {{#if (not (can 'update repository' this.model))}}
      {{#if (and this.model.isActive (or (can 'create doi' this.model) (can 'upload doi' this.model)))}}
        {{#if (gt this.model.meta.prefixCount 0) }}
          <div class="panel facets">
            <div class="panel-body">
              <CreateDoiButton @model={{this.model}} class="create-doi-button" />
            </div>
          </div>
        {{else}}
          <div class="panel panel-transparent">
            <div class="panel-body">
              <BsAlert @dismissible={{false}} @type="warning">
                Can't create DOI without a prefix.
              </BsAlert>
            </div>
          </div>
        {{/if}}
      {{/if}}
    {{else}}
      {{#if (and this.model.isActive (or (can 'create doi' this.model) (can 'upload doi' this.model)) (not (gt this.model.meta.prefixCount 0)))}}
        <div class="panel panel-transparent">
          <div class="panel-body">
            <BsAlert @dismissible={{false}} @type="warning">
              Can't create DOI without a prefix.
            </BsAlert>
          </div>
        </div>
      {{/if}}

      {{#if (can 'update repository' this.model)}}
        <div class="panel facets">
          <div class="panel-body">
            <div class="btn-toolbar">
              <div class="shrink">
                {{#if (and this.model.isActive (or (can 'create doi' this.model) (can 'upload doi' this.model)) (gt this.model.meta.prefixCount 0))}}
                  <CreateDoiButton @model={{this.model}} class="create-doi-button" />
                {{/if}}
                <div class="btn-group-vertical btn-group-sm">
                  {{#if this.model.isActive}}
                    <LinkTo
                      @route="repositories.show.change"
                      @model={{this.model.id}}
                      class="btn btn-warning"
                      id="set-password-repository"
                    >
                      <i class="fas fa-key"></i>
                      Set Password
                    </LinkTo>
                  {{/if}}
                  {{#if (or (can 'delete repository' this.model) this.model.isActive)}}
                    <LinkTo
                      @route="repositories.show.edit"
                      @model={{this.model.id}}
                      class="btn btn-warning"
                      id="edit-repository"
                    >
                      <i class="fas fa-pencil-alt"></i>
                      Update
                      {{if (eq this.currentUser.uid this.model.id) 'Account' 'Repository'}}
                    </LinkTo>
                  {{/if}}
                  {{#if (can 'delete repository' this.model)}}
                    <LinkTo
                      @route="repositories.show.delete"
                      @model={{this.model.id}}
                      class="btn btn-warning"
                      id="delete-repository"
                    >
                      <i class="fas fa-trash"></i>
                      Delete Repository
                    </LinkTo>
                  {{/if}}
                  {{#if (and (can 'transfer repository' this.model) this.model.isActive)}}
                    <LinkTo
                      @route="repositories.show.transfer-repository"
                      @model={{this.model.id}}
                      class="btn btn-warning"
                      id="transfer-repository"
                    >
                      <i class="fas fa-arrow-circle-right"></i>
                      Transfer
                      {{if this.media.isXl ' Repository'}}
                    </LinkTo>
                  {{/if}}
                </div>
              </div>
            </div>
          </div>
        </div>
      {{/if}}
    {{/if}}
    <RepositorySidebar @model={{this.model}} />
  </div>
  <div class="col-md-9">
    <div class="panel panel-transparent">
      <div class="panel-body">
        {{#each this.flashMessages.queue as |flash|}}
          <FlashMessage @flash={{flash}} />
        {{/each}}
        {{#if (eq this.model.clientType 'periodical')}}
          <span class="label label-primary-inv label-sm">
            Periodical
          </span>
        {{/if}}
        <h5>
          Repository ID
          <span>
            <i class="fas fa-question-circle"></i>
            <BsTooltip @renderInPlace={{true}} @placement="top" @viewportPadding={{10}}>
              The Repository ID is a unique identifier for each repository in DataCite. It must contain only upper case letters and numbers, and must start with the Member ID.
            </BsTooltip>
          </span>
        </h5>
        {{this.model.symbol}}
        {{#if this.model.re3data}}
          <h5>
            re3data Record
            <span>
              <i class="fas fa-question-circle"></i>
              <BsTooltip @renderInPlace={{true}} @placement="top" @viewportPadding={{10}}>
                re3data is a registry of research data repositories.
              </BsTooltip>
            </span>
          </h5>
          <a href="{{this.model.re3data}}">
            {{this.model.re3data}}
          </a>
        {{/if}}
        {{#if (and (can 'create provider') this.model.salesforceId)}}
          <h5>
            Salesforce ID
          </h5>
          {{this.model.salesforceId}}
        {{/if}}
        {{#if (and (can 'token repository') this.model.globusUuid)}}
          <h5>
            Globus UUID
          </h5>
          {{this.model.globusUuid}}
        {{/if}}
        {{#if (or this.model.issn.issnl this.model.issn.electronic this.model.issn.print)}}
          <h5>
            ISSN
          </h5>
          {{#if this.model.issn.issnl}}
            {{this.model.issn.issnl}}(ISSN-L)<br />
          {{/if}}
          {{#if this.model.issn.electronic}}
            {{this.model.issn.electronic}}(electronic)<br />
          {{/if}}
          {{#if this.model.issn.print}}
            {{this.model.issn.print}}(print)<br />
          {{/if}}
        {{/if}}
        {{#if this.model.alternateName}}
          <h5>
            Alternate Name
          </h5>
          {{this.model.alternateName}}
        {{/if}}
        {{#if this.model.description}}
          <h5>
            Description
          </h5>
          <p id="description">
            {{markdown-to-html this.model.description}}
          </p>
        {{/if}}
        {{#if (or this.model.serviceContact.name this.model.serviceContact.email)}}
          <h5>
            Service Contact
          </h5>
          {{#if this.model.serviceContact.name}}
            {{this.model.serviceContact.name}}<br />
          {{/if}}
          {{#if this.model.serviceContact.email}}
            <a href="mailto:{{this.model.serviceContact.email}}">
              {{this.model.serviceContact.email}}
            </a>
          {{/if}}
        {{/if}}
        {{#if this.model.systemEmail}}
          <h5>
            System Email
          </h5>
          <a href="mailto:{{this.model.systemEmail}}">
            {{this.model.systemEmail}}
          </a>
        {{/if}}
        {{#if this.model.url}}
          <h5>
            URL
          </h5>
          <a href="{{this.model.url}}">
            {{this.model.url}}
          </a>
        {{/if}}
        {{#if this.model.domainList}}
          <h5>
            {{pluralize this.model.domainList.length 'Domain' without-count=true}}
            <span>
              <i class="fas fa-question-circle"></i>
              <BsTooltip @renderInPlace={{true}} @placement="top" @viewportPadding={{10}}>
                URLs for DOIs must use
                {{#if (gt this.model.domainList.length 1)}}
                  one of these (sub-)domains
                {{else}}
                  this (sub-)domain
                {{/if}}
                .
              </BsTooltip>
            </span>
          </h5>
          {{#each this.model.domainList as |domain|}}
            {{domain}}<br />
          {{/each}}
        {{/if}}
        {{#if this.model.language}}
          <h5>
            Language
          </h5>
          {{#each this.model.language as |lang|}}
            {{format-language lang}}
            {{#unless (eq lang this.model.language.lastObject)}}
              ,
            {{/unless}}
          {{/each}}
        {{/if}}
        {{#if this.model.repositoryType}}
          <h5>
            Repository Type
          </h5>
          {{#each this.model.repositoryType as |type|}}
            {{titleize type}}
            {{#unless (eq type this.model.repositoryType.lastObject)}}
              ,
            {{/unless}}
          {{/each}}
        {{/if}}
        {{#if this.model.certificate}}
          <h5>
            Certificate
            <div class="info-icon icons-certificate_active"></div>
          </h5>
          {{#each this.model.certificate as |cert|}}
            {{cert}}
            {{#unless (eq cert this.model.certificate.lastObject)}}
              ,
            {{/unless}}
          {{/each}}
        {{/if}}
        {{#if this.model.software}}
          <h5>
            Software
          </h5>
          {{this.model.software}}
        {{/if}}
        {{#unless this.model.hasPassword}}
          <h5>
            Password
          </h5>
          <span class="small icon-warning">
            has not been set
          </span>
        {{/unless}}
      </div>
    </div>
  </div>
</div>