effective_datatables 4.33.1 → 4.34.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: 4cd8c154865bcef7dda9eb32691cab1b3b6d7e304b8ddff6813fa2df1394da5f
4
- data.tar.gz: ab4471b5df4f1fabadfa418f1cb8f9b5a5846895653fd76fa9a03e9b8bcdd0dd
3
+ metadata.gz: 26894b39aa930851150fb6139d8207d61dd054910d78b78a88cb8d961291b10e
4
+ data.tar.gz: d1c9d28d703e5db73743f23ca73c147e334d81b930219f8e756f72189ba03c1c
5
5
  SHA512:
6
- metadata.gz: 8b9a8106584a864a1a11c315c07f0cc473847f7292fb07b21d1f915fda0aadaea1a64fb242fdd8f511bb2a931796be841c571c4967dcd846e829df06eaee3533
7
- data.tar.gz: 05a640da917ab52ead1f88e91868152e20949143a975000ad838986b38dfdea67fa1087de69329f6aef7951090a729daa8019608fde69ade3ae360194fa445d8
6
+ metadata.gz: 2bfb288465fbb24ae508957762bc62f2f9b16628460304ff0d94337726b92535ecd82115d9fe518ddda0a9569a507e6a6d91e8a19a192ec56904ae5ee39558b6
7
+ data.tar.gz: fb1a9edee1c2d47158ac6cf352926ef05566d36bf88a54f0ad6dca288f2b89c44a73f2733576e57b76b1e8316edf72119e535abfb4ae591545f1867ab7ada703
@@ -117,7 +117,9 @@ module Effective
117
117
  when :actions
118
118
  raise("please use actions_col instead of col(#{name}, as: :actions)")
119
119
  when :boolean
120
- view.t("effective_datatables.boolean_#{value}")
120
+ label = view.t("effective_datatables.boolean_#{value}")
121
+ color = value ? EffectiveDatatables.format_true : EffectiveDatatables.format_false
122
+ color.present? ? view.badge(label, color) : label
121
123
  when :currency
122
124
  view.number_to_currency(value)
123
125
  when :date
@@ -46,6 +46,10 @@ EffectiveDatatables.setup do |config|
46
46
  config.format_date = '%F'
47
47
  config.format_time = '%H:%M'
48
48
 
49
+ # Boolean formatting. When present will render booleans as badges with this bootstrap color
50
+ config.format_true = 'success'
51
+ config.format_false = 'danger'
52
+
49
53
  # Enable the Download button which serves a CSV of your collection
50
54
  config.download = false
51
55
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.33.1'.freeze
2
+ VERSION = '4.34.0'.freeze
3
3
  end
@@ -22,6 +22,9 @@ module EffectiveDatatables
22
22
  mattr_accessor :format_date
23
23
  mattr_accessor :format_time
24
24
 
25
+ mattr_accessor :format_true
26
+ mattr_accessor :format_false
27
+
25
28
  mattr_accessor :debug
26
29
  mattr_accessor :download
27
30
 
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.33.1
4
+ version: 4.34.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: 2025-04-25 00:00:00.000000000 Z
11
+ date: 2025-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails