Sha256: 196a01b51bd244f3ee4f7239a70ad1beec67e60d28dd1213b8eee35e9e51aae7

Contents?: true

Size: 1.03 KB

Versions: 6

Compression:

Stored size: 1.03 KB

Contents

= simple_form_for @role, url: admin_role_create_permissions_path(role), method: :post, remote: true do
  %label
    - if !role.action?(module_name, action)
      %label.switch
        %input{ name: 'role[module]', type: 'hidden', value: module_name }
        %input{ name: 'role[action]', type: 'hidden', value: action }
        %input{ id: "switch-#{module_name.split('::').join('')}-#{action}", type: 'checkbox' }
        %span.slider.round{ onclick: "sendPermission('#{module_name}', '#{action}')" }

    - else
      %label.switch
        %input{ name: 'role[module]', type: 'hidden', value: module_name }
        %input{ name: 'role[action]', type: 'hidden', value: action }
        %input.active{ id: "switch-#{module_name.split('::').join('')}-#{action}", type: 'checkbox', checked: 'checked' }
        %span.slider.round{ onclick: "sendPermission('#{module_name}', '#{action}')" }

:javascript
  function sendPermission(module_name, action) {
    $('#switch-'+module_name.split('::').join('')+'-'+action).parent().parent().parent().submit()
  }

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
keppler-2.0.7 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.0.6 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.0.5 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.0.4.p1 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.0.4.pre.p1 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.0.4 installer/core/app/views/admin/roles/_switch.html.haml