amahi/platform

View on GitHub
plugins/010-users/app/views/users/_password.html.slim

Summary

Maintainability
Test Coverage
td.top
  label #{t('password')}
td.top
  = link_to content_tag('i', '', class: 'password glyphicon glyphicon-lock'),'#', :onclick=> "event.preventDefault();$(this).parent().find('.password-edit').toggle('slow');",
    :class => 'control-action',:id=>"user-password-control-action-#{user.id}"
  = form_for user, url: users_engine.update_password_user_path(user), remote: true, method: :put, html: { class: 'update-password update-form form-horizontal left-margin-20', id: "edit_user_password_#{user.id}" } do |f|
    .password-edit[style="display:none"]
      .control-group.form-group
        .controls= f.password_field :password, id: "password_#{user.id}", size: 16, maxlength: 12, class:'form-control input-sm input-field-style', placeholder: t('new')

      .control-group.form-group
        .controls= f.password_field :password_confirmation, id: "password_confirmation_#{user.id}", size: 16, maxlength: 12, class:'form-control input-sm input-field-style', placeholder: t('confirm')

      .control-group.form-group
        .controls
          = spinner
          = f.submit t('change'), :class => 'btnn btn btn-info btn-sm',:id=>"submit_password_#{user.id}"
          = link_to t('cancel'), '#', :onclick=>"event.preventDefault();$(this).parents('.password-edit').hide('slow').find('input[type=password]').val('');$(this).parents().parents()", :class => 'cancel-link cancel-btn-style btn-sm left-margin-10'
        .messages