Sha256: 41304bbfc7493ffd592c2ad48d93143714c9055aa2e97ca5fd340b6babc305c1

Contents?: true

Size: 1.29 KB

Versions: 25

Compression:

Stored size: 1.29 KB

Contents

= simple_form_for @role, url: admin_role_create_permissions_path(role), method: :post, remote: true do
  %label.switch-box{ style: 'padding-top: 5px; padding-right: 40px;' }
    - 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 }
        - actions.each do |act|
          %input{ name: 'role[actions][]', type: 'hidden', value: act }
        %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 }
        - actions.each do |act|
          %input{ name: 'role[actions][]', type: 'hidden', value: act }
        %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

25 entries across 24 versions & 1 rubygems

Version Path
keppler-2.1.22 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.21 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.20 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.19 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.18 testing-with-2.1.18/app/views/admin/roles/_switch.html.haml
keppler-2.1.18 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.17 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.16 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.15 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.14 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.13 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.12 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.11 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.10 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.9 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.8 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.7 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.6 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.5 installer/core/app/views/admin/roles/_switch.html.haml
keppler-2.1.4 installer/core/app/views/admin/roles/_switch.html.haml