ez-permissions-ui 0.4.4 → 0.8.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: a3f5948fbf434e80e8f607c37a8149199753b92131e184147c9d7358a2d62d7f
4
+ data.tar.gz: 914f008b3161c4396cbfdbf8717845269d1c2795cf205ed55ea358f896e8c9c9
5
5
  SHA512:
6
- metadata.gz: 3d0ff495e35e0aafc271e742d1a27bccf249c664c5e247435c434c5b354ea9e84227d327667563bb115aa70b9edf78d0e4721f315560f1c62a6471b30a579531
7
- data.tar.gz: 43fb10206d5c58e8ac50fca467a512d662c56c28a59efdac403610aa9ec7329bf01859829395ee2142feda20c7cfcf1ae00b715ad05e4e6389e5e80865de7028
6
+ metadata.gz: 82ca1d5ff5c2f38f8da2a8e75322a95950a49f13b974887cd43a55d189fccaeb105e7c2fda2bd7364e8bd3f4447ecf11d5290879ca3fc481890f17310f87c0e2
7
+ data.tar.gz: 2f9e0116dbd07d42328a9879db9bc1aa05279102aca47ccc548cd06e019fbb64bfd3c98dbfc7a78a1a284245aa04e1f7b95645246650c0b93d8d3203c73548bd
@@ -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.8.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.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Volodya Sveredyuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-15 00:00:00.000000000 Z
11
+ date: 2022-09-12 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.8.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.8.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: cells-rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -59,9 +59,6 @@ dependencies:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '5.2'
62
- - - "<="
63
- - !ruby/object:Gem::Version
64
- version: '7.0'
65
62
  type: :runtime
66
63
  prerelease: false
67
64
  version_requirements: !ruby/object:Gem::Requirement
@@ -69,9 +66,6 @@ dependencies:
69
66
  - - ">="
70
67
  - !ruby/object:Gem::Version
71
68
  version: '5.2'
72
- - - "<="
73
- - !ruby/object:Gem::Version
74
- version: '7.0'
75
69
  - !ruby/object:Gem::Dependency
76
70
  name: simple_form
77
71
  requirement: !ruby/object:Gem::Requirement
@@ -265,14 +259,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
265
259
  requirements:
266
260
  - - ">="
267
261
  - !ruby/object:Gem::Version
268
- version: '0'
262
+ version: 2.5.0
269
263
  required_rubygems_version: !ruby/object:Gem::Requirement
270
264
  requirements:
271
265
  - - ">="
272
266
  - !ruby/object:Gem::Version
273
267
  version: '0'
274
268
  requirements: []
275
- rubygems_version: 3.1.2
269
+ rubygems_version: 3.1.6
276
270
  signing_key:
277
271
  specification_version: 4
278
272
  summary: UI extension for ez-permissions.