<div id="edit-password" v-cloak>
  <account-notification-banner></account-notification-banner>
  <div class="container pt-5 pb-5">
    <h1>Change password</h1>
    <hr/>
    <ajax-form action="updatePassword" :syncing.sync="syncing" :cloud-error.sync="cloudError" :form-data="formData" :form-rules="formRules" :form-errors.sync="formErrors" @submitted="submittedForm()">
      <div class="row">
        <div class="col-sm-6">
          <div class="form-group">
            <label for="password">New password</label>
            <input class="form-control" id="password" name="password" type="password"  :class="[formErrors.password ? 'is-invalid' : '']" v-model.trim="formData.password" placeholder="••••••••" autocomplete="new-password" focus-first>
            <div class="invalid-feedback" v-if="formErrors.password">Please enter a password or choose "Cancel".</div>
          </div>
        </div>
        <div class="col-sm-6">
          <div class="form-group">
            <label for="confirm-password">Confirm password</label>
            <input class="form-control" id="confirm-password" name="confirm-password" type="password"  :class="[formErrors.confirmPassword ? 'is-invalid' : '']" v-model.trim="formData.confirmPassword" autocomplete="new-password" placeholder="••••••••">
            <div class="invalid-feedback" v-if="formErrors.confirmPassword">Your new password and confirmation do not match.</div>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-sm-6">
          <cloud-error v-if="cloudError"></cloud-error>
        </div>
        <div class="col-sm-6">
          <div class="form-group text-right">
            <a class="btn btn-outline-info" href="/account">Cancel</a>
            <ajax-button type="submit" :syncing="syncing" class="btn btn-dark">Save changes</ajax-button>
          </div>
        </div>
      </div>
    </ajax-form>
  </div>
</div>
<%- /* Expose locals as `window.SAILS_LOCALS` :: */ exposeLocalsToBrowser() %>
