effective_datatables 4.36.1 → 4.37.0

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: 5e64115315e92eab482dcf096351440e57bcf3aaf8fd260d766e0311dcf096df
4
- data.tar.gz: d7411c7a76eecc7623b75c9d6f628e1437318cc711feda532328544fa50d9fae
3
+ metadata.gz: 65762c9c87f1788ec63c7416237b71bccd9b6ed3f5c17f2a13e0f03a42278867
4
+ data.tar.gz: 6eef5d9930eb3d153f2eff69fbe8fecd3068543cd3fa32053a3b9054d65fca12
5
5
  SHA512:
6
- metadata.gz: 95f03a5e84ddc2e485b6afa2f9fcf099cbcc051b86ca16ac7ac5447dc5f78f568e4eaa4a213ea3726cbef3ee8a466bbf85f50194be18ddc9b0032272ed04dbe8
7
- data.tar.gz: 78b37da7540c2893d05e452cdc85433da090f32ce9a229b75031b65b3be2bf7d4f59d205e960e5ceb4aa01c855e7a08a3b09cc611d7ba733042720f2a323a21d
6
+ metadata.gz: 987b5ae60d844786ed4d0a7040035921d30251fc8e7d4312c25c69c6ae6d69ff4516c37b1ed486ce5ff7d25b36e0528605c5209af719e0313633d62ed56c6962
7
+ data.tar.gz: 585a6c409ca5c76959fde7038332f638915a7b1713b3669dee51b86fe0c9a939db7a1961f28d8d49125801e5942dd5c0bed65ce3876f4a7aa01ad88fed5c446d
@@ -44,8 +44,8 @@ module EffectiveDatatablesPrivateHelper
44
44
  def datatable_new_resource_button(datatable, name, column)
45
45
  return unless datatable.inline? && (column[:actions][:new] != false)
46
46
 
47
- # Override the default btn_class and use this one
48
- action = { action: :new, class: 'btn btn-sm btn-success', 'data-remote': true }
47
+ btn_class = EffectiveDatatables.new_action_button_class || 'btn-sm btn-success'
48
+ action = { action: :new, class: "btn #{btn_class}", 'data-remote': true }
49
49
 
50
50
  if column[:actions][:new].kind_of?(Hash) # This might be active_record_array_collection?
51
51
  actions = action.merge(column[:actions][:new])
@@ -101,7 +101,7 @@ module Effective
101
101
  action: false,
102
102
  as: :actions,
103
103
  compute: nil,
104
- btn_class: (btn_class || 'btn-sm btn-outline-primary'),
104
+ btn_class: (btn_class || EffectiveDatatables.default_button_class || 'btn-sm btn-outline-primary'),
105
105
  col_class: col_class,
106
106
  csv: false,
107
107
  format: (format if block_given?),
@@ -30,6 +30,10 @@ EffectiveDatatables.setup do |config|
30
30
  # Default class used on the <table> tag
31
31
  config.html_class = 'table table-hover'
32
32
 
33
+ # These are the button classes
34
+ # config.default_button_class = 'btn-outline-primary' # default class when btn_class option is unspecified
35
+ # config.new_action_button_class = 'btn-success' # overriding class on new action
36
+
33
37
  # Log search/sort information to the console
34
38
  config.debug = true
35
39
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.36.1'.freeze
2
+ VERSION = '4.37.0'.freeze
3
3
  end
@@ -12,6 +12,8 @@ module EffectiveDatatables
12
12
  mattr_accessor :length_menu
13
13
 
14
14
  mattr_accessor :html_class
15
+ mattr_accessor :default_button_class
16
+ mattr_accessor :new_action_button_class
15
17
  mattr_accessor :save_state
16
18
 
17
19
  mattr_accessor :cookie_max_size
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.36.1
4
+ version: 4.37.0
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-03-12 00:00:00.000000000 Z
11
+ date: 2026-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails