datacite/bracco

View on GitHub
app/templates/providers/show/organizations/new.hbs

Summary

Maintainability
Test Coverage
<div class="panel panel-transparent" id="create-consortium-organization-form">
  <div class="panel-body">
    <div class="col-md-9 col-md-offset-3">
      <h3 class="edit">
        Create Consortium Organization
      </h3>
      {{#each this.flashMessages.queue as |flash|}}
        <FlashMessage @flash={{flash}} />
      {{/each}}
    </div>
    <BsForm
      @formLayout="horizontal"
      class="form-horizontal"
      @horizontalLabelGridClass="col-md-3"
      @model={{this.model.organization}}
      @onSubmit={{action 'submit'}}
      @submitOnEnter={{true}} as |form|
    >
      <h3 class="member-results">
        Organization Information 
      </h3>
      <form.element
        @controlType="hidden"
        @property="consortium"
      />
      <ProviderId @model={{this.model.organization}} @form={{form}} />
      <form.element
        @controlType="text"
        id="member-type"
        class="form-group"
        @label="Member Type"
        @value="Consortium Organization" as |el|
      >
        <el.control readonly={{true}} id="member-type-field" />
      </form.element>
      <form.element
        @controlType="text"
        id="name"
        class="form-group"
        @label="Organization Name"
        @property="name"
        @helpText="The official name of your organization." as |el|
      >
        <el.control id="name-field" />
      </form.element>
      <form.element
        @controlType="text"
        id="display-name"
        class="form-group"
        @label="Organization Display Name"
        @property="displayName"
        @helpText="Name of your organization as you would like it to appear in Fabrica and on DataCite’s website." as |el|
      >
        <el.control id="display-name-field" />
      </form.element>
      {{#if this.features.enableDoiEstimate}}
        <form.element
          @controlType="text"
          id="doi-estimate"
          class="form-group"
          @label="Estimated DOIs"
          @property="doiEstimate"
          required
          @helpText={{html-safe (concat "Enter the number of DOIs expected to be registered annually. This amount will be pro-rated for the remaining months of the year. If the consortium fee cap applies enter zero (0). See more details in our <a href='" (get (links) "FEE_MODEL_URL" ) "' target='_blank'>fee model</a>.")}} as |el|
        >
          <el.control id="doi-estimate-field" placeholder = "0" required={{true}} />
        </form.element>
      {{/if}}
      <form.element
        @controlType="power-select"
        id="ror-id"
        class="form-group"
        @label="Organization identifier (optional)"
        @property="rorId"
        @optionLabelPath="rorId"
        @options={{this.organizations}}
        @destination={{this.rorId}}
        @helpText="Organization identifiers are provided by the Research Organization Registry (ROR)." as |el|
      >
        <el.control
          @onChange={{action 'selectRor'}}
          @search={{action 'searchRor'}}
          @placeholder="Select Organization"
          @searchPlaceholder="Type to search..."
          @allowClear={{true}}
          @searchEnabled={{true}} as |item|
        >
          {{if item.name item.name this.model.organization.rorId}}
        </el.control>
      </form.element>
      {{#if (can 'create provider')}}
        <form.element
          @controlType="text"
          id="salesforce-id"
          class="form-group"
          @label="Salesforce ID"
          @property="salesforceId"
          @helpText="The 18 digit ID in Salesforce." as |el|
        >
          <el.control id="salesforce-id-field" />
        </form.element>
      {{/if}}
      {{#if (can 'token provider')}}
        <form.element
          @controlType="text"
          id="globus-uuid"
          class="form-group"
          @label="Globus UUID (optional)"
          @property="globusUuid"
          @helpText="The Globus UUID used for token authentication." as |el|
        >
          <el.control id="globus-uuid-field" />
        </form.element>
      {{/if}}
      {{#if (can 'create provider')}}
        <form.element
          @controlType="power-select"
          id="tax-status"
          class="form-group"
          @label="Tax Status"
          @property="nonProfitStatus"
          @options={{this.nonProfitStatuses}}
          @destination={{this.nonProfitStatus}} as |el|
        >
          <el.control
            @onChange={{action 'selectNonProfitStatus'}}
            @search={{action 'searchNonProfitStatus'}}
            @placeholder="Tax Status"
            @searchPlaceholder="Type to search..."
            @searchEnabled={{true}} as |item|
          >
            {{titleize item}}
          </el.control>
        </form.element>
      {{/if}}
      <form.element
        @controlType="text"
        id="system-email"
        class="form-group"
        @label="System Email"
        @property="systemEmail"
        @helpText="This is the email used for sending password reset requests and similar system notifications." as |el|
      >
        <el.control id="system-email-field" />
      </form.element>
      <form.element
        @controlType="text"
        id="group-email"
        class="form-group"
        @label="Group Email (optional)"
        @property="groupEmail"
        @helpText="A generic shared email address (such as info@datacite.org or similar) where you would like to receive communications from DataCite." as |el|
      >
        <el.control id="group-email-field" />
      </form.element>
      <form.element
        @controlType="text"
        id="website"
        class="form-group"
        @label="Website"
        @property="website (optional)"
        @helpText="Website of the organization." as |el|
      >
        <el.control id="website-field" />
      </form.element>
      <form.element
        @controlType="text"
        id="twitter-handle"
        class="form-group"
        @label="Twitter (optional)"
        @property="twitterHandle"
        @helpText="DataCite will follow you on twitter." as |el|
      >
        <el.control id="twitter-handle-field" placeholder="Add @twitter account" />
      </form.element>
      <form.element
        @controlType="power-select"
        id="country"
        class="form-group"
        @label="Country (optional)"
        @property="country"
        @optionLabelPath="name"
        @options={{this.countries}}
        @destination={{this.country}}
        @helpText="Country where the organization is located." as |el|
      >
        <el.control
          @onChange={{action 'selectCountry'}}
          @search={{action 'searchCountry'}}
          @searchField="name"
          @placeholder="Select Country"
          @searchPlaceholder="Type to search..."
          @allowClear={{true}}
          @searchEnabled={{true}} as |item|
        >
          {{item.name}}
        </el.control>
      </form.element>
      <form.element
        @controlType="power-select"
        id="organization-type"
        class="form-group"
        @label="Organization Type (optional)"
        @property="organizationType"
        @options={{this.organizationTypes}}
        @destination={{this.organizationType}} as |el|
      >
        <el.control
          @onChange={{action 'selectOrganizationType'}}
          @search={{action 'searchOrganizationType'}}
          @placeholder="Select Organization Type"
          @searchPlaceholder="Type to search..."
          @allowClear={{true}}
          @searchEnabled={{true}} as |item|
        >
          {{titleize (humanize (underscore item))}}
        </el.control>
      </form.element>
      <form.element
        @controlType="power-select"
        id="focus-area"
        class="form-group"
        @label="Focus Area (optional)"
        @property="focusArea"
        @options={{this.focusAreas}}
        @destination={{this.focusArea}}
        @helpText="Field of research covered by organization." as |el|
      >
        <el.control
          @onChange={{action 'selectFocusArea'}}
          @search={{action 'searchFocusArea'}}
          @placeholder="Select Focus Area"
          @searchPlaceholder="Type to search..."
          @allowClear={{true}}
          @searchEnabled={{true}} as |item|
        >
          {{titleize (humanize (underscore item))}}
        </el.control>
      </form.element>
      <form.element
        @controlType="textarea"
        id="description"
        class="form-group"
        @label="Description (optional)"
        @property="description"
        @helpText="Description of the organization. Please use markdown for formatting." as |el|
      >
        <el.control id="description-field" rows=10 />
      </form.element>
      <form.element
        @controlType="checkbox"
        id="is-active"
        class="form-group"
        @label="Account is active"
        @property="isActive"
        @helpText="This account can manage repositories and prefixes" as |el|
      >
        <el.control id="is-active-field" />
      </form.element>
      <h3 class="member-results">
        Contact Information
      </h3>
      <div class="col-md-9 col-md-offset-3">
        <BsAlert @dismissible={{false}} @type="danger">
          Please add at least one contact via the consortium organization contacts menu after creating
          this consortium organization.
        </BsAlert>
        <BsAlert @dismissible={{false}} @type="warning">
          The contacts entered may receive notifications about administration, webinars, product testing,
            or news that will impact the use of DataCite services and/or membership. Individuals may remove
            themselves from mailings by following the unsubscribe link provided in every DataCite email.
            For information about our privacy practices and commitment to protecting your privacy, please
            review our
          <a
            target="_blank" rel="noopener noreferrer" href={{get (links) "PRIVACY_POLICY_URL" }}
          >
            Privacy Policy
          </a>
        </BsAlert>
      </div>
      <div class="col-md-9 col-md-offset-3">
        {{#if (is-empty (provider-form-errors this.model.organization))}}
          <button
            type="submit"
            id="add-organization"
            class="btn btn-sm btn-fill"
            disabled={{false}}
          >
            Add Consortium Organization
          </button>
        {{else}}
          <BsAlert @dismissible={{false}} @type="danger">
            To save this consortium organization, first resolve the errors with these fields:
            {{provider-form-errors this.model.organization}}
            .
          </BsAlert>
          <button
            type="submit"
            id="add-organization"
            class="btn btn-sm btn-fill"
            disabled={{true}}
          >
            Add Consortium Organization
          </button>
        {{/if}}
        <button class="btn btn-sm" type="button" {{action 'cancel'}}>
          Cancel
        </button>
      </div>
    </BsForm>
  </div>
</div>