<div class="md_simple_modal_wrap" my-modal-position>

  <div class="md_simple_modal_body">

    <form class="modal_simple_form" ng-submit="updatePassword()">

      <h4 ng-switch="action">
        <my-i18n ng-switch-when="disable" msgid="password_delete_title"></my-i18n>
        <my-i18n ng-switch-default msgid="password_change_title"></my-i18n>
      </h4>

      <div ng-if="password._ != 'account.noPassword'" class="md-input-group" ng-class="{'md-input-error': passwordSettings.error_field == 'cur_password'}" my-labeled-input>
        <label class="md-input-label" my-i18n="password_current_placeholder"></label>
        <input class="md-input" my-focused type="password" ng-model="passwordSettings.cur_password" name="cur_password" my-focus-on="cur_password_focus" />
      </div>

      <div ng-if="action != 'disable'" class="md-input-group md-input-grouped" ng-class="{'md-input-error': passwordSettings.error_field == 'new_password'}" my-labeled-input>
        <label class="md-input-label" my-i18n="password_new_placeholder"></label>
        <input class="md-input" type="password" ng-model="passwordSettings.new_password" name="new_password" my-focus-on="new_password_focus" />
      </div>

      <div ng-if="action != 'disable'" class="md-input-group" ng-class="{'md-input-error': passwordSettings.confirm_password && passwordSettings.new_password && passwordSettings.confirm_password != passwordSettings.new_password}" my-labeled-input>
        <label class="md-input-label" my-i18n="password_confirm_placeholder"></label>
        <input class="md-input" type="password" ng-model="passwordSettings.confirm_password" name="confirm_password" my-focus-on="confirm_password_focus" />
      </div>

      <div ng-if="action != 'disable'" class="md-input-group" my-labeled-input>
        <label class="md-input-label" my-i18n="password_hint_placeholder"></label>
        <input class="md-input" type="text" ng-model="passwordSettings.hint" name="hint" />
      </div>

      <div ng-if="action != 'disable'" class="md_simple_form_description" my-i18n="password_create_description"></div>

      <div ng-if="action != 'disable'" class="md-input-group" ng-class="{'md-input-error': passwordSettings.error_field == 'email'}" my-labeled-input>
        <label class="md-input-label" my-i18n="password_email_placeholder"></label>
        <input class="md-input" type="text" ng-model="passwordSettings.email" name="email" />
      </div>


    </form>

  </div>

  <div class="md_simple_modal_footer">

    <button class="btn btn-md" ng-click="$dismiss()" my-i18n="modal_cancel"></button>
    <button class="btn btn-md btn-md-primary" ng-class="{disabled: passwordSettings.updating}" ng-click="updatePassword()" ng-disabled="passwordSettings.updating" ng-switch="action">
      <span ng-switch-when="disable" ng-bind="passwordSettings.updating ? 'password_delete_active' : 'password_delete_submit' | i18n"></span>
      <span ng-switch-default ng-bind="passwordSettings.updating ? 'password_create_active' : 'password_create_submit' | i18n"></span>
    </button>

  </div>

</div>