effective_datatables 4.37.1 → 4.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7b568f77617338c71896ed913c966b16eb1ae7263e300e6859a40eb3aa780301
|
|
4
|
+
data.tar.gz: 10453b93f5ffbc7fedd7722b0fdd8bbfc519f6c269c4999424a4896dd2b0c71d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b622e880079211198883d2e02f1fa399fe38faec4511a188174ed7e149b588349408c5e894d5dfd1b49e6f381690943f068d2591d7c026f857f214f63a84c06
|
|
7
|
+
data.tar.gz: 37d0f1f75c4744e6ccff4ecf9db76898ea2a60de2bbcb76e3e7738e821b4a2434edd6f48b9bdce2fa487c57bfb2c18bc3a1981daf2a1a163ce9fac5e819680d4
|
|
@@ -47,11 +47,16 @@ module EffectiveDatatablesPrivateHelper
|
|
|
47
47
|
btn_class = EffectiveDatatables.new_action_button_class || 'btn-sm btn-success'
|
|
48
48
|
action = { action: :new, class: "btn #{btn_class}", 'data-remote': true }
|
|
49
49
|
|
|
50
|
+
# Pass actions_col(new: { label: 'New Thing' }) to override the button label on one datatable.
|
|
51
|
+
label = t('effective_datatables.new')
|
|
52
|
+
|
|
50
53
|
if column[:actions][:new].kind_of?(Hash) # This might be active_record_array_collection?
|
|
51
|
-
|
|
54
|
+
new_opts = column[:actions][:new]
|
|
55
|
+
label = new_opts[:label] if new_opts[:label].present?
|
|
56
|
+
action = action.merge(new_opts.except(:label, :klass))
|
|
52
57
|
|
|
53
58
|
effective_resource = (datatable.effective_resource || datatable.fallback_effective_resource)
|
|
54
|
-
klass = (
|
|
59
|
+
klass = (new_opts[:klass] || effective_resource&.klass || datatable.collection_class)
|
|
55
60
|
elsif Array(datatable.effective_resource&.actions).include?(:new)
|
|
56
61
|
effective_resource = datatable.effective_resource
|
|
57
62
|
klass = effective_resource.klass
|
|
@@ -60,7 +65,7 @@ module EffectiveDatatablesPrivateHelper
|
|
|
60
65
|
end
|
|
61
66
|
|
|
62
67
|
# Will only work if permitted
|
|
63
|
-
render_resource_actions(klass, actions: {
|
|
68
|
+
render_resource_actions(klass, actions: { label => action }, effective_resource: effective_resource)
|
|
64
69
|
end
|
|
65
70
|
|
|
66
71
|
def datatable_label_tag(datatable, name, opts)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: effective_datatables
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.37.
|
|
4
|
+
version: 4.37.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Code and Effect
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06
|
|
11
|
+
date: 2026-07-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|