<section>
  <div class="well">
    <h2>Local Authentication is {{#if access.enabled}}<b>enabled</b>{{else}}<b class="text-warning">not configured</b>{{/if}}</h2>
    <div>
      {{#if access.enabled}}
        Rancher is configured to allow access to {{#link-to "admin-tab.accounts"}}accounts{{/link-to}} in its local database.
      {{else}}
        Rancher can be configured to restrict access to a set of accounts defined in the Rancher database.  This is not currently set up, so anybody that reach this page (or the API) has full control over the system.
      {{/if}}
    </div>
  </div>

  {{#if access.enabled}}
    <div class="well">
      <h4>Danger Zone&trade;</h4>
      <hr/>

      <p>
        <b class="text-danger">Caution:</b> Disabling access control will give complete control over Rancher to anyone that can reach this page or the API.
      </p>

      {{#if confirmDisable}}
        <button class="btn btn-danger" {{action "disable"}}>
          <i class="icon icon-alert"></i> Are you sure?  Click again to really disable access control
        </button>
      {{else}}
        <button class="btn btn-danger" {{action "promptDisable"}}>
          <i class="fa fa-umbrella"></i> Disable access control
        </button>
      {{/if}}

    </div>
  {{/if}}

  {{#unless access.enabled}}
    <div class="well">
      <h4>1. Setup an Admin user </h4>
      <hr/>
      <p class="help-block">This user will become the admin that has full control over Rancher.</p>
      <div class="row">
        <div class="col-md-6">
          <div class="form-group">
            <label>Login Username*</label>
            {{input type="text" value=adminPublicValue placeholder="e.g. jsmith" classNames="form-control"}}
          </div>
        </div>
        <div class="col-md-6">
          <div class="form-group">
            <label>Full Name</label>
            {{input type="text" value=adminName placeholder="e.g. John Smith" classNames="form-control"}}
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-md-6">
          <div class="form-group">
            <label>Password*</label>
            {{input type="password" value=adminSecretValue classNames="form-control"}}
          </div>
        </div>
        <div class="col-md-6">
          <div class="form-group">
            <label>Confirm Password*</label>
            {{input type="password" value=adminSecretValue2 classNames="form-control"}}
          </div>
        </div>
      </div>
    </div>

    <div class="well">
      <h4>2. There is no step two</h4>
      <hr/>
      <p class="help-block">Click to enable access control and log in.</p>
      {{top-errors errors=errors}}

      <button disabled={{createDisabled}} class="btn btn-primary" style="display: block;" {{action "test"}}>
        {{#if testing}}
          <i class="icon icon-spinner icon-spin"></i> Enabling...
        {{else}}
          Enable Local Auth
        {{/if}}
      </button>
    </div>
  {{/unless}}
</section>
