datacite/bracco

View on GitHub
app/templates/edit.hbs

Summary

Maintainability
Test Coverage
{{#if (can "write index")}}
  <ApplicationHeader @default={{true}} />

  <div class="container-fluid">
    <IndexHeader />

    <div class="content" id="update-account-form">
      <div class="panel panel-transparent">
        <div class="panel-body">
          <div class="col-md-offset-3 form-help-header"><h3 class="edit">Update Account</h3></div>

          <BsForm @formLayout="horizontal" class="form-horizontal" @horizontalLabelGridClass="col-md-3" @model={{this.model}} @onSubmit={{action "submit" this.model}} as |form|>
            <form.element @controlType="text" id="member-id" class="form-group" @label="Member ID" @property="symbol" @helpText="The Member ID is the unique identifier for each member and can't be changed." as |el|> <el.control disabled={{true}} required={{true}} id="member-id-field" /> </form.element>
            
            <form.element @controlType="power-select" id="ror-id" class="form-group" @label="Organization identifier (optional)" @property="rorId" @optionLabelPath="name" @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..." @searchEnabled={{true}} @allowClear={{true}} id="ror-id-field" as |item|>
                {{if item.name item.name this.model.rorId}}
              </el.control>
            </form.element>

            <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="website" class="form-group" @label="Website" @property="website" @helpText="Website of the member." 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 placeholder="Add @twitter account" id="twitter-handle-field" /> </form.element>
            <form.element @controlType="textarea" id="description" class="form-group" @label="Description (optional)" @property="description" rows="10" @helpText="Description of the provider. Please use markdown for formatting." as |el|>  <el.control id="description-field" /> </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 member is located." as |el|>
              <el.control @onChange={{action "selectCountry"}} @search={{action "searchCountry"}} @searchField="name" @placeholder="Select Country" @searchPlaceholder="Type to search..." @searchEnabled={{true}} @allowClear={{true}} id="country-field" as |item|>
                {{item.name}}
              </el.control>
            </form.element>

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

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

              <button class="btn btn-sm" id="cancel" type="button" {{action "cancel" this.model}}>Cancel</button> 
            </div>
          </BsForm>
        </div>
      </div>
    </div>
  </div>
{{else}}
  <ApplicationHeader />
  <LandingPage />
{{/if}}