cm-admin 1.1.5 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop-https---raw-githubusercontent-com-commutatus-cm-linters-main-rubocop-yml +20 -0
  3. data/Gemfile.lock +60 -60
  4. data/app/assets/config/cm_admin_manifest.js +2 -1
  5. data/app/assets/fonts/fa-brands-400.ttf +0 -0
  6. data/app/assets/fonts/fa-brands-400.woff2 +0 -0
  7. data/app/assets/fonts/fa-regular-400.ttf +0 -0
  8. data/app/assets/fonts/fa-regular-400.woff2 +0 -0
  9. data/app/assets/fonts/fa-solid-900.ttf +0 -0
  10. data/app/assets/fonts/fa-solid-900.woff2 +0 -0
  11. data/app/assets/fonts/fa-v4compatibility.ttf +0 -0
  12. data/app/assets/fonts/fa-v4compatibility.woff2 +0 -0
  13. data/app/assets/javascripts/cm_admin/application.js +8 -3
  14. data/app/assets/javascripts/cm_admin/bulk_actions.js +36 -0
  15. data/app/assets/javascripts/cm_admin/custom.js +0 -0
  16. data/app/assets/stylesheets/cm_admin/cm_admin.css.scss +2 -2
  17. data/app/assets/stylesheets/cm_admin/dependency/fontawesome.all.css +7831 -0
  18. data/app/controllers/cm_admin/resource_controller.rb +16 -1
  19. data/app/helpers/cm_admin/application_helper.rb +4 -0
  20. data/app/javascript/packs/cm_admin/application.js +1 -0
  21. data/app/models/concerns/cm_admin/bulk_action_processor.rb +29 -0
  22. data/app/views/cm_admin/main/_associated_table.html.slim +19 -9
  23. data/app/views/cm_admin/main/_table.html.slim +27 -14
  24. data/app/views/cm_admin/main/index.html.slim +1 -1
  25. data/app/views/layouts/_custom_action_modals.html.slim +4 -1
  26. data/lib/cm_admin/model.rb +3 -1
  27. data/lib/cm_admin/models/action.rb +10 -4
  28. data/lib/cm_admin/models/bulk_action.rb +18 -0
  29. data/lib/cm_admin/models/dsl_method.rb +9 -0
  30. data/lib/cm_admin/version.rb +1 -1
  31. data/lib/cm_admin/view_helpers/page_info_helper.rb +10 -0
  32. metadata +16 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 824c3834294625da2c626f75005931ccf56711905e6ad223ac2613102db7d750
4
- data.tar.gz: 2beccd2743a656d7ffcd28b83b682513b372b7c64c8fb16df5e3272e431ad038
3
+ metadata.gz: 5aba23127b4e8223782b919d0c5c767b156262e55198835fb738c72fd9c5fa68
4
+ data.tar.gz: 89a3df2239cc6a56eb3360afe1502654c2ad83b1921c5f8f7dedcc1d8eaf3407
5
5
  SHA512:
6
- metadata.gz: d3f782ef53f1dbca5c8328649050cf55622f909635424d55662e09f6e98076a55cf7fba474aeec347258d2995eb1ec998c6e6b5f8d0d22d6e8237ea7d0b5fc8e
7
- data.tar.gz: 9310b42149f297a3df3fb564c1f6d800e7d0cf745e14fc1f7388f2e837e9e1812ef3884554994dc7978f05194a7a3acf9e9d332d73ba8164756f0d92b250ffad
6
+ metadata.gz: 66c416a85d9e84c5d9122adc0a14d8728ce51934711839db9a261ddba9aeae8d13d3033f3e06f3c359b5a3c7a62ed74c2d253aa1c038865ba77486f7ddc6fbf7
7
+ data.tar.gz: 5d91df86bb2cb64be4158688473c316c8e3c16b77bb11ed7a0a1e683f7e2af67e84b7240a45262ab79384cf1fdc238880f2da02525686ba73d43f9c5c98253c2
@@ -0,0 +1,20 @@
1
+ AllCops:
2
+ DisabledByDefault: false
3
+
4
+ Style/FrozenStringLiteralComment:
5
+ Enabled: false
6
+
7
+ Style/Documentation:
8
+ Enabled: false
9
+
10
+ Layout/IndentationStyle:
11
+ Enabled: false
12
+
13
+ Layout/LineLength:
14
+ Enabled: false
15
+
16
+ Metrics/MethodLength:
17
+ Enabled: false
18
+
19
+ Metrics/AbcSize:
20
+ Enabled: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cm-admin (1.1.5)
4
+ cm-admin (1.1.7)
5
5
  caxlsx_rails
6
6
  cocoon (~> 1.2.15)
7
7
  csv-importer (~> 0.8.2)
@@ -16,67 +16,67 @@ PATH
16
16
  GEM
17
17
  remote: https://rubygems.org/
18
18
  specs:
19
- actioncable (7.0.3.1)
20
- actionpack (= 7.0.3.1)
21
- activesupport (= 7.0.3.1)
19
+ actioncable (7.0.5.1)
20
+ actionpack (= 7.0.5.1)
21
+ activesupport (= 7.0.5.1)
22
22
  nio4r (~> 2.0)
23
23
  websocket-driver (>= 0.6.1)
24
- actionmailbox (7.0.3.1)
25
- actionpack (= 7.0.3.1)
26
- activejob (= 7.0.3.1)
27
- activerecord (= 7.0.3.1)
28
- activestorage (= 7.0.3.1)
29
- activesupport (= 7.0.3.1)
24
+ actionmailbox (7.0.5.1)
25
+ actionpack (= 7.0.5.1)
26
+ activejob (= 7.0.5.1)
27
+ activerecord (= 7.0.5.1)
28
+ activestorage (= 7.0.5.1)
29
+ activesupport (= 7.0.5.1)
30
30
  mail (>= 2.7.1)
31
31
  net-imap
32
32
  net-pop
33
33
  net-smtp
34
- actionmailer (7.0.3.1)
35
- actionpack (= 7.0.3.1)
36
- actionview (= 7.0.3.1)
37
- activejob (= 7.0.3.1)
38
- activesupport (= 7.0.3.1)
34
+ actionmailer (7.0.5.1)
35
+ actionpack (= 7.0.5.1)
36
+ actionview (= 7.0.5.1)
37
+ activejob (= 7.0.5.1)
38
+ activesupport (= 7.0.5.1)
39
39
  mail (~> 2.5, >= 2.5.4)
40
40
  net-imap
41
41
  net-pop
42
42
  net-smtp
43
43
  rails-dom-testing (~> 2.0)
44
- actionpack (7.0.3.1)
45
- actionview (= 7.0.3.1)
46
- activesupport (= 7.0.3.1)
47
- rack (~> 2.0, >= 2.2.0)
44
+ actionpack (7.0.5.1)
45
+ actionview (= 7.0.5.1)
46
+ activesupport (= 7.0.5.1)
47
+ rack (~> 2.0, >= 2.2.4)
48
48
  rack-test (>= 0.6.3)
49
49
  rails-dom-testing (~> 2.0)
50
50
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
51
- actiontext (7.0.3.1)
52
- actionpack (= 7.0.3.1)
53
- activerecord (= 7.0.3.1)
54
- activestorage (= 7.0.3.1)
55
- activesupport (= 7.0.3.1)
51
+ actiontext (7.0.5.1)
52
+ actionpack (= 7.0.5.1)
53
+ activerecord (= 7.0.5.1)
54
+ activestorage (= 7.0.5.1)
55
+ activesupport (= 7.0.5.1)
56
56
  globalid (>= 0.6.0)
57
57
  nokogiri (>= 1.8.5)
58
- actionview (7.0.3.1)
59
- activesupport (= 7.0.3.1)
58
+ actionview (7.0.5.1)
59
+ activesupport (= 7.0.5.1)
60
60
  builder (~> 3.1)
61
61
  erubi (~> 1.4)
62
62
  rails-dom-testing (~> 2.0)
63
63
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
64
- activejob (7.0.3.1)
65
- activesupport (= 7.0.3.1)
64
+ activejob (7.0.5.1)
65
+ activesupport (= 7.0.5.1)
66
66
  globalid (>= 0.3.6)
67
- activemodel (7.0.3.1)
68
- activesupport (= 7.0.3.1)
69
- activerecord (7.0.3.1)
70
- activemodel (= 7.0.3.1)
71
- activesupport (= 7.0.3.1)
72
- activestorage (7.0.3.1)
73
- actionpack (= 7.0.3.1)
74
- activejob (= 7.0.3.1)
75
- activerecord (= 7.0.3.1)
76
- activesupport (= 7.0.3.1)
67
+ activemodel (7.0.5.1)
68
+ activesupport (= 7.0.5.1)
69
+ activerecord (7.0.5.1)
70
+ activemodel (= 7.0.5.1)
71
+ activesupport (= 7.0.5.1)
72
+ activestorage (7.0.5.1)
73
+ actionpack (= 7.0.5.1)
74
+ activejob (= 7.0.5.1)
75
+ activerecord (= 7.0.5.1)
76
+ activesupport (= 7.0.5.1)
77
77
  marcel (~> 1.0)
78
78
  mini_mime (>= 1.1.0)
79
- activesupport (7.0.3.1)
79
+ activesupport (7.0.5.1)
80
80
  concurrent-ruby (~> 1.0, >= 1.0.2)
81
81
  i18n (>= 1.6, < 2)
82
82
  minitest (>= 5.1)
@@ -98,7 +98,7 @@ GEM
98
98
  cocoon (1.2.15)
99
99
  coercible (1.0.0)
100
100
  descendants_tracker (~> 0.0.1)
101
- concurrent-ruby (1.1.10)
101
+ concurrent-ruby (1.2.2)
102
102
  crass (1.0.6)
103
103
  csv-importer (0.8.2)
104
104
  virtus
@@ -110,7 +110,7 @@ GEM
110
110
  globalid (1.1.0)
111
111
  activesupport (>= 5.0)
112
112
  htmlentities (4.3.4)
113
- i18n (1.11.0)
113
+ i18n (1.14.1)
114
114
  concurrent-ruby (~> 1.0)
115
115
  ice_nine (0.11.2)
116
116
  importmap-rails (1.2.1)
@@ -129,7 +129,7 @@ GEM
129
129
  marcel (1.0.2)
130
130
  method_source (1.0.0)
131
131
  mini_mime (1.1.2)
132
- minitest (5.16.2)
132
+ minitest (5.18.1)
133
133
  net-imap (0.3.6)
134
134
  date
135
135
  net-protocol
@@ -149,25 +149,25 @@ GEM
149
149
  pundit (2.2.0)
150
150
  activesupport (>= 3.0.0)
151
151
  racc (1.7.1)
152
- rack (2.2.6.4)
152
+ rack (2.2.7)
153
153
  rack-proxy (0.7.6)
154
154
  rack
155
155
  rack-test (2.1.0)
156
156
  rack (>= 1.3)
157
- rails (7.0.3.1)
158
- actioncable (= 7.0.3.1)
159
- actionmailbox (= 7.0.3.1)
160
- actionmailer (= 7.0.3.1)
161
- actionpack (= 7.0.3.1)
162
- actiontext (= 7.0.3.1)
163
- actionview (= 7.0.3.1)
164
- activejob (= 7.0.3.1)
165
- activemodel (= 7.0.3.1)
166
- activerecord (= 7.0.3.1)
167
- activestorage (= 7.0.3.1)
168
- activesupport (= 7.0.3.1)
157
+ rails (7.0.5.1)
158
+ actioncable (= 7.0.5.1)
159
+ actionmailbox (= 7.0.5.1)
160
+ actionmailer (= 7.0.5.1)
161
+ actionpack (= 7.0.5.1)
162
+ actiontext (= 7.0.5.1)
163
+ actionview (= 7.0.5.1)
164
+ activejob (= 7.0.5.1)
165
+ activemodel (= 7.0.5.1)
166
+ activerecord (= 7.0.5.1)
167
+ activestorage (= 7.0.5.1)
168
+ activesupport (= 7.0.5.1)
169
169
  bundler (>= 1.15.0)
170
- railties (= 7.0.3.1)
170
+ railties (= 7.0.5.1)
171
171
  rails-dom-testing (2.1.1)
172
172
  activesupport (>= 5.0.0)
173
173
  minitest
@@ -175,9 +175,9 @@ GEM
175
175
  rails-html-sanitizer (1.6.0)
176
176
  loofah (~> 2.21)
177
177
  nokogiri (~> 1.14)
178
- railties (7.0.3.1)
179
- actionpack (= 7.0.3.1)
180
- activesupport (= 7.0.3.1)
178
+ railties (7.0.5.1)
179
+ actionpack (= 7.0.5.1)
180
+ activesupport (= 7.0.5.1)
181
181
  method_source
182
182
  rake (>= 12.2)
183
183
  thor (~> 1.0)
@@ -229,7 +229,7 @@ GEM
229
229
  thread_safe (0.3.6)
230
230
  tilt (2.0.10)
231
231
  timeout (0.4.0)
232
- tzinfo (2.0.4)
232
+ tzinfo (2.0.6)
233
233
  concurrent-ruby (~> 1.0)
234
234
  unicode-display_width (2.3.0)
235
235
  virtus (2.0.0)
@@ -1 +1,2 @@
1
- //= link_tree ../javascripts/cm_admin
1
+ //= link_tree ../javascripts/cm_admin
2
+ //= link_tree ../fonts
Binary file
Binary file
Binary file
Binary file
@@ -1,7 +1,12 @@
1
1
  import './scaffolds.js';
2
- import './cocoon.js'
3
2
  import './shared_scaffolds.js';
3
+
4
+ import './bulk_actions.js'
5
+ import './cocoon.js'
6
+ import './exports.js'
7
+ import './filters.js'
4
8
  import './form_validation.js'
5
9
  import './quick_search.js'
6
- import './filters.js'
7
- import './exports.js'
10
+ import './custom.js'
11
+
12
+
@@ -0,0 +1,36 @@
1
+ $(document).on('click', '[data-behaviour="bulk-action-checkbox"]', function(e) {
2
+ if ($('[data-behaviour="bulk-action-checkbox"]').is(':checked')) {
3
+ $('[data-section="bulk-action"]').removeClass('hidden')
4
+ setBulkActionParams()
5
+ } else {
6
+ $('[data-section="bulk-action"]').addClass('hidden')
7
+ }
8
+ });
9
+
10
+ $(document).on('click', '[data-behaviour="bulk-action-select-all"]', function(e) {
11
+ if ($(this).is(':checked')) {
12
+ $('[data-behaviour="bulk-action-checkbox"]').prop('checked', true)
13
+ $('[data-section="bulk-action"]').removeClass('hidden')
14
+ setBulkActionParams()
15
+ } else {
16
+ $('[data-behaviour="bulk-action-checkbox"]').prop('checked', false)
17
+ $('[data-section="bulk-action"]').addClass('hidden')
18
+ }
19
+ });
20
+
21
+ function setBulkActionParams() {
22
+ var selected_ids = []
23
+ $('[data-behaviour="bulk-action-checkbox"]:checked').each(function(){ selected_ids.push($(this).data('ar-object-id')) })
24
+ var bulk_action_form = '[data-section="bulk-action"] form'
25
+ if ($(bulk_action_form)) {
26
+ if ($(bulk_action_form + ' [name="selected_ids"]').length == 0) {
27
+ $('<input>').attr({
28
+ type: 'hidden',
29
+ name: 'selected_ids'
30
+ }).appendTo(bulk_action_form);
31
+ }
32
+ }
33
+ $('[data-section="bulk-action"] [name="selected_ids"]').each(function( i ) {
34
+ $(this).val(selected_ids)
35
+ })
36
+ }
File without changes
@@ -25,7 +25,7 @@
25
25
  *= require 'cm_admin/components/index'
26
26
  *= require 'cm_admin/dependency/bootstrap.min'
27
27
  *= require 'cm_admin/dependency/flatpickr.min'
28
+ *= require 'cm_admin/dependency/fontawesome.all'
28
29
  *= require 'cm_admin/scaffold'
29
30
  *= require_self
30
- *= require font-awesome
31
- */
31
+ */