ez-permissions-ui 0.4.4 → 0.5.0

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: 6494854d1be39d0a937be37cd761aadedd8e7eb78041d33390fdc24b019cacee
4
- data.tar.gz: 669177bb4d51df4c3f3e39a6949d1dcc6ac6bf5022f4abd211d20b7fa385e853
3
+ metadata.gz: 9f5e91c071404a896ab6ed10ea361a7d6063af92b62618abdce540682c408e3e
4
+ data.tar.gz: 71e2982aa429f2beb5a5c05fcfff015408bae5843fe9caee9e9e1dd51614b562
5
5
  SHA512:
6
- metadata.gz: 3d0ff495e35e0aafc271e742d1a27bccf249c664c5e247435c434c5b354ea9e84227d327667563bb115aa70b9edf78d0e4721f315560f1c62a6471b30a579531
7
- data.tar.gz: 43fb10206d5c58e8ac50fca467a512d662c56c28a59efdac403610aa9ec7329bf01859829395ee2142feda20c7cfcf1ae00b715ad05e4e6389e5e80865de7028
6
+ metadata.gz: fe93a0c959e1c6d32a7ee3d387be690d32181369fcf8e14c4a09d525c9a2ebd885f13d3f82354a712ba6c7802b53ccd698b44ae0478cd8881949cd0c0226b6d4
7
+ data.tar.gz: b6ff6f7b06a4853cbe8356df8d910d3f0bd49912a4489338bc33c31f3a9121422d1b1f04d6ab0e0303685698bc787c4e7d5cee4bbee418b51b710fbfea022902
@@ -4,7 +4,7 @@
4
4
  = div_for 'header-container'
5
5
  = div_for 'header-inner-container'
6
6
  h2 class=(css_for 'header-label') = model.name.humanize
7
-
7
+ br
8
8
  = div_for 'permissions-grant-all-container'
9
9
  = check_box_tag "grant_all", "grant_all", all_granted?, onclick: "checkAll(this)", id: 'permission-grant-all'
10
10
  = label_tag "grant_all", t('permissions.actions.grant_all')
@@ -21,7 +21,7 @@
21
21
  tbody class=(css_for 'table-tbody')
22
22
  - resources_names.select { |r| groups[group].map(&:name).include?(r.to_sym) }.each do |resource_name|
23
23
  tr class=(css_for 'table-tbody-tr') id=("resource-#{resource_name}")
24
- td class=(css_for 'table-tbody-td-name') style="width: 30%" = resource_name.humanize
24
+ td class=(css_for 'table-tbody-td-name') style="width: 30%" = resource_by(resource_name).label
25
25
  td class=(css_for 'table-tbody-td-action') style="width: 10%" id=("permission-#{resource_name}-all")
26
26
  = div_for 'table-permission-check'
27
27
  = check_box_tag "all_permissions[]", "all-permission-#{resource_name}", all_granted?(resource_name), class: 'toggle-all-resource-actions', id: "permission-checkbox-#{resource_name}"
@@ -32,7 +32,6 @@
32
32
  = permission_checkbox(resource_name, action_name)
33
33
  = permissions_label(resource_name, action_name)
34
34
 
35
-
36
35
  = f.submit t('permissions.actions.update'), class: css_for('permissions-submit-button')
37
36
  = link_to t('permissions.actions.cancel'), path_for, class: css_for('permissions-cancel-link')
38
37
 
@@ -49,9 +48,10 @@ javascript:
49
48
 
50
49
  // Toggle only row checkboxes
51
50
  var checkboxes = document.querySelectorAll('.toggle-all-resource-actions');
51
+
52
52
  [].forEach.call(checkboxes, function(checkbox) {
53
53
  checkbox.onchange = function() {
54
- var currentRow = this.parentNode.parentNode;
54
+ var currentRow = this.parentNode.parentNode.parentNode;
55
55
  var cbElems = currentRow.querySelectorAll('[type="checkbox"]');
56
56
  [].forEach.call(cbElems, function(cb) {
57
57
  cb.checked = this.checked;
@@ -27,6 +27,10 @@ module Ez
27
27
  @resources_names ||= permissions_actions.map(&:resource).uniq.sort
28
28
  end
29
29
 
30
+ def resource_by(name)
31
+ Ez::Permissions::DSL.resources.find { |r| r.name == name.to_sym }
32
+ end
33
+
30
34
  def permissions_actions
31
35
  @permissions_actions ||= Ez::Permissions::Permission.all.to_a
32
36
  end
@@ -3,7 +3,7 @@
3
3
  module Ez
4
4
  module Permissions
5
5
  module UI
6
- VERSION = '0.4.4'
6
+ VERSION = '0.5.0'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ez-permissions-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Volodya Sveredyuk
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-15 00:00:00.000000000 Z
11
+ date: 2020-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ez-permissions
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.4.3
19
+ version: 0.5.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.4.3
26
+ version: 0.5.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: cells-rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -257,7 +257,7 @@ licenses:
257
257
  - MIT
258
258
  metadata:
259
259
  allowed_push_host: https://rubygems.org
260
- post_install_message:
260
+ post_install_message:
261
261
  rdoc_options: []
262
262
  require_paths:
263
263
  - lib
@@ -273,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
273
273
  version: '0'
274
274
  requirements: []
275
275
  rubygems_version: 3.1.2
276
- signing_key:
276
+ signing_key:
277
277
  specification_version: 4
278
278
  summary: UI extension for ez-permissions.
279
279
  test_files: []