Sha256: b9c6305271eb004a3fe99202cde08da1c9f734f33f9f2b8753543afec2277899

Contents?: true

Size: 790 Bytes

Versions: 90

Compression:

Stored size: 790 Bytes

Contents

- box_id = "user_#{form.object.id || 'new'}"
%div{id: box_id}
  = form.text_field :login
  /= form.text_field :mail
  - if current_user.logged?
    = form.check_box :generate_password, class: 'generate_password'
  .passwords
    = form.password_field :password
    = form.password_field :password_confirmation
  = form.text_field :firstname
  = form.text_field :lastname

:javascript
  $(function(){
    function toggle_paswords(state){
      var $passwd = $('##{box_id} .passwords');
      $passwd.find(':input').prop('disabled', !state);
      $passwd.toggle(state);
    }

    var $generate_check = $('##{box_id} .generate_password');
    toggle_paswords(!$generate_check.is(':checked'))
    $generate_check.on('change', function(evt){ toggle_paswords(!$(this).is(':checked')) });
  });

Version data entries

90 entries across 90 versions & 1 rubygems

Version Path
egov_utils-0.2.9 app/views/egov_utils/users/_form.html.haml
egov_utils-0.2.8 app/views/egov_utils/users/_form.html.haml
egov_utils-0.2.7 app/views/egov_utils/users/_form.html.haml
egov_utils-0.2.6 app/views/egov_utils/users/_form.html.haml
egov_utils-0.2.5 app/views/egov_utils/users/_form.html.haml
egov_utils-0.2.4 app/views/egov_utils/users/_form.html.haml
egov_utils-0.2.3 app/views/egov_utils/users/_form.html.haml
egov_utils-0.2.2 app/views/egov_utils/users/_form.html.haml
egov_utils-0.2.1 app/views/egov_utils/users/_form.html.haml
egov_utils-0.2.0 app/views/egov_utils/users/_form.html.haml