cm-admin 3.0.6 → 3.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edc4e96d677eaa2324f074cf028cf3defc717a49a64a64331e65d18c2b55ecce
4
- data.tar.gz: d3cb35655e16e1c36ebb221be9782d6720f556ed0dba3acff74afdf45981f61d
3
+ metadata.gz: 49dc645a75c337ee382e9980b395273206e2ee40351538f78464a0033910151f
4
+ data.tar.gz: a9be1c0fd8595bedfbaf5f228eedc006ed605472e79e579c617bdb2a67dfc35e
5
5
  SHA512:
6
- metadata.gz: '0686244e80d49a67a4caaa628c1dd05b6f09917fe6a74edd7707607f86d6e41325d7ba0da9d637080a8e0a616856f90d2f4d191a436a6a0fe724b1e94eeae674'
7
- data.tar.gz: 0fd14c5144600550b7cde3644c1f44e30f3aaa3c3099feb849784d8673cb1eac9dfa88a7257a42bad27b1f943bee1fc27ce44ba6c7ec488c50bdf0d914d2a3d1
6
+ metadata.gz: c3f01da5ade710831c3bb80380a950a159dd61196d61f981645f14ffe4a7f79a2067370a90c225dad5359b304128081a02d734c3187166526f244bbdd0dfa2db
7
+ data.tar.gz: 0f7da2b13d58d3438eda3dd084210420b83220651fddbc066d2dfe0a7f2f414df306348226247ae8baa6b97c0c38ca4808da681ab6b7b6e7963f0ac0467764b5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cm-admin (3.0.6)
4
+ cm-admin (3.0.8)
5
5
  caxlsx_rails
6
6
  cocoon (~> 1.2.15)
7
7
  csv-importer (~> 0.8.2)
@@ -13,6 +13,7 @@
13
13
  z-index: 5;
14
14
  }
15
15
  .form-container {
16
+ margin-bottom: 24px;
16
17
  .form-title {
17
18
  @extend .h6, .fw-semibold;
18
19
  color: $primary-text-clr;
@@ -32,7 +33,7 @@
32
33
 
33
34
  .form-section-container {
34
35
  @extend .p-4;
35
- margin-bottom: 64px;
36
+ margin-bottom: 40px;
36
37
  }
37
38
 
38
39
  .form-submit-button-container {
@@ -1,38 +1,39 @@
1
- .form-page.permission-form
2
- .form-page__body
3
- .form-container
4
- = form_for CmPermission.new, url: cm_admin.send('cm_create_role_permission_cm_role_path', @ar_object), method: :post do |f|
5
- - cm_models = CmAdmin.config.cm_admin_models.sort_by{|k, v| k.display_name}
6
- - cm_models.each do |model|
7
- - next if model.override_policy == true
8
- .row
9
- .col.form-container
10
- p.form-title
11
- = model.model_name
12
- .form-container__inner
13
- .row
14
- .col
15
- .form-field.disabled
16
- .form-check
17
- .permission-form__checkbox-wrapper
18
- - saved_permission = @ar_object.cm_permissions.where(ar_model_name: model.name)
19
- - available_actions = model.available_actions.reject {|x| ['custom_action_modal', 'custom_action', 'create', 'update'].include?(x.name)}
20
- - is_checked = (saved_permission.count >= available_actions.count)
21
- input.form-check-input[type="checkbox" value="" data-behaviour="permission-check-all" checked=is_checked]
22
- .cm-checkbox-label
23
- span.action-name
24
- | All
25
- - model.available_actions.each do |action|
26
- - permission = @ar_object.cm_permissions.where(ar_model_name: model.name, action_name: action.name).first
27
- - unless ['custom_action_modal', 'custom_action', 'create', 'update'].include?(action.name)
1
+ .form-page.permission-form
2
+ .form-page__body
3
+ .form-container
4
+ = form_for CmPermission.new, url: cm_admin.send('cm_create_role_permission_cm_role_path', @ar_object), method: :post do |f|
5
+ - cm_models = CmAdmin.config.cm_admin_models.sort_by{|k, v| k.display_name}
6
+ .form-section-container
7
+ - cm_models.each do |model|
8
+ - next if model.override_policy == true
9
+ .row
10
+ .col.form-container
11
+ p.form-title
12
+ = model.model_name
13
+ .form-container__inner
14
+ .row
15
+ .col
16
+ .form-field.disabled
28
17
  .form-check
29
18
  .permission-form__checkbox-wrapper
30
- input.form-check-input[type="checkbox" value="#{action.name}" checked=permission.present? name="role_permission[#{model.name}][#{action.name}][is_checked]" data-behaviour="permission-check-box"]
19
+ - saved_permission = @ar_object.cm_permissions.where(ar_model_name: model.name)
20
+ - available_actions = model.available_actions.reject {|x| ['custom_action_modal', 'custom_action', 'create', 'update'].include?(x.name)}
21
+ - is_checked = (saved_permission.count >= available_actions.count)
22
+ input.form-check-input[type="checkbox" value="" data-behaviour="permission-check-all" checked=is_checked]
31
23
  .cm-checkbox-label
32
24
  span.action-name
33
- = action.display_name || action.name.titleize
34
- .cm-select-tag class="#{permission.present? ? '' : 'hidden'}"
35
- = select_tag(:policy_scope_name, options_for_select(model.policy_scopes.map{|policy_hash| [policy_hash[:display_name], policy_hash[:scope_name]]}, permission&.scope_name), {name: "role_permission[#{model.name}][#{action.name}][scope_name]", class: 'select-2', id: "policy-scope-#{model.name}-#{action.name}"})
36
- div
37
- = f.submit 'Save Changes', class: "btn-cta"
38
- = link_to 'Discard', cm_admin.send('cm_index_cm_role_path'), class: "btn-secondary ml-10"
25
+ | All
26
+ - model.available_actions.each do |action|
27
+ - permission = @ar_object.cm_permissions.where(ar_model_name: model.name, action_name: action.name).first
28
+ - unless ['custom_action_modal', 'custom_action', 'create', 'update'].include?(action.name)
29
+ .form-check
30
+ .permission-form__checkbox-wrapper
31
+ input.form-check-input[type="checkbox" value="#{action.name}" checked=permission.present? name="role_permission[#{model.name}][#{action.name}][is_checked]" data-behaviour="permission-check-box"]
32
+ .cm-checkbox-label
33
+ span.action-name
34
+ = action.display_name || action.name.titleize
35
+ .cm-select-tag class="#{permission.present? ? '' : 'hidden'}"
36
+ = select_tag(:policy_scope_name, options_for_select(model.policy_scopes.map{|policy_hash| [policy_hash[:display_name], policy_hash[:scope_name]]}, permission&.scope_name), {name: "role_permission[#{model.name}][#{action.name}][scope_name]", class: 'select-2', id: "policy-scope-#{model.name}-#{action.name}"})
37
+ .form-submit-button-container
38
+ = f.submit 'Save Changes', class: "btn-cta"
39
+ = link_to 'Discard', cm_admin.send('cm_index_cm_role_path'), class: "btn-secondary ml-10"
@@ -1,3 +1,3 @@
1
1
  module CmAdmin
2
- VERSION = '3.0.6'
2
+ VERSION = '3.0.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cm-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.6
4
+ version: 3.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael