effective_datatables 4.24.1 → 4.25.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: 4ead89fb1377a2310bef8d72b4ddba32369f369be7b5c49f48def4b43cfca364
4
- data.tar.gz: b2633a0f7bbcc366d10b84c92c48be6dffeb0eb44e9f2fd9e055d32552154cf3
3
+ metadata.gz: 83eb9275dcc75a256e935ee3ee51fdd515535fcf8457ce529df51243c2d96a8f
4
+ data.tar.gz: e5b94011f906b2630fb589a9b663dba4f7502f5f6a8bffae6f9b1b1860fe1de3
5
5
  SHA512:
6
- metadata.gz: 64cca992852889e969d3ad811b60392ef42f1ee4132d543ef11f6266c8fa6c4dcfee06f6e1db76a5c20ab6a7facb3da7074bffd80773c42fb56912e9e498ed1a
7
- data.tar.gz: d32031a018c8a819896d3901ca46c359ddc60296434d1f8ac83e66b4bad9f6efbb8ff9712d4c77db10f8af1e6c63e82248d83970d091a6db6e2d9c7b592a4b08
6
+ metadata.gz: 4a4ea51c92b53fce4dd5fba110e5040361f25d3902899c98ec825726da533012d5f7c9cba9902fed3d6472b5d0632be906d3300f706198007480bab8386fab4c
7
+ data.tar.gz: 3dda47408ab035642b4597a7a46f415568272c780691600974498ab3d3885c839f488bb7cf4cf7a00b88d1b8f70985edb446f2b727eba2c617559ea7a31fdf2b
@@ -269,12 +269,6 @@ table.dataTable.nowrap th,
269
269
  table.dataTable.nowrap td {
270
270
  white-space: nowrap;
271
271
  }
272
- table.dataTable.table-striped > tbody > tr:nth-of-type(2n+1) {
273
- background-color: transparent;
274
- }
275
- table.dataTable > tbody > tr {
276
- background-color: transparent;
277
- }
278
272
  table.dataTable > tbody > tr.selected > * {
279
273
  box-shadow: inset 0 0 0 9999px rgb(2, 117, 216);
280
274
  box-shadow: inset 0 0 0 9999px rgb(2, 117, 216);
@@ -2,7 +2,7 @@
2
2
 
3
3
  # These are expected to be called by a developer. They are part of the datatables DSL.
4
4
  module EffectiveDatatablesHelper
5
- def render_datatable(datatable, input_js: {}, buttons: true, charts: true, download: nil, entries: true, filters: true, inline: false, namespace: nil, pagination: true, search: true, simple: false, sort: true)
5
+ def render_datatable(datatable, input_js: {}, buttons: true, charts: true, download: nil, entries: true, filters: true, inline: false, namespace: nil, pagination: true, search: true, simple: false, short: false, sort: true)
6
6
  raise 'expected datatable to be present' unless datatable
7
7
  raise 'expected input_js to be a Hash' unless input_js.kind_of?(Hash)
8
8
 
@@ -14,6 +14,10 @@ module EffectiveDatatablesHelper
14
14
  buttons = charts = download = entries = filters = pagination = search = sort = false
15
15
  end
16
16
 
17
+ if short
18
+ entries = pagination = false
19
+ end
20
+
17
21
  datatable.attributes[:inline] = true if inline
18
22
  datatable.attributes[:sortable] = false unless sort
19
23
  datatable.attributes[:searchable] = false unless search
@@ -108,6 +112,10 @@ module EffectiveDatatablesHelper
108
112
  render_datatable(datatable, simple: true)
109
113
  end
110
114
 
115
+ def render_short_datatable(datatable)
116
+ render_datatable(datatable, short: true)
117
+ end
118
+
111
119
  def inline_datatable?
112
120
  params[:_datatable_id].present? && params[:_datatable_attributes].present?
113
121
  end
@@ -184,7 +184,7 @@ module EffectiveDatatablesPrivateHelper
184
184
  buttons: true,
185
185
  checked: value,
186
186
  feedback: false,
187
- label: false,
187
+ label: (datatable._filters.present? ? t("effective_datatables.display") : false),
188
188
  required: false,
189
189
  wrapper: { class: 'form-group col-auto'}
190
190
  }.merge(opts.except(:checked, :value))
@@ -45,8 +45,10 @@ module Effective
45
45
  raise "Unsupported collection. Expecting an ActiveRecord relation, an Array of ActiveRecord objects, or an Array of Arrays [[1, 'foo'], [2, 'bar']]"
46
46
  end
47
47
 
48
- _scopes.each do |scope, _|
49
- raise "invalid scope: :#{scope}. The collection must respond to :#{scope}" unless collection.respond_to?(scope)
48
+ if _collection_apply_scope
49
+ _scopes.each do |scope, _|
50
+ raise "invalid scope: :#{scope}. The collection must respond to :#{scope}" unless collection.respond_to?(scope)
51
+ end
50
52
  end
51
53
  end
52
54
 
@@ -13,3 +13,4 @@ en:
13
13
  boolean_true: 'Yes'
14
14
  boolean_false: 'No'
15
15
  all: All
16
+ display: 'Display'
@@ -13,3 +13,4 @@ es:
13
13
  boolean_true: 'Sí'
14
14
  boolean_false: 'No'
15
15
  all: Todo
16
+ display: Display
@@ -13,3 +13,4 @@ nl:
13
13
  boolean_true: 'Ja'
14
14
  boolean_false: 'Nee'
15
15
  all: Te doen
16
+ display: Display
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.24.1'.freeze
2
+ VERSION = '4.25.0'.freeze
3
3
  end
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.24.1
4
+ version: 4.25.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: 2024-02-08 00:00:00.000000000 Z
11
+ date: 2024-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  - !ruby/object:Gem::Version
196
196
  version: '0'
197
197
  requirements: []
198
- rubygems_version: 3.4.10
198
+ rubygems_version: 3.5.6
199
199
  signing_key:
200
200
  specification_version: 4
201
201
  summary: Uniquely powerful server-side searching, sorting and filtering of any ActiveRecord