effective_datatables 4.24.2 → 4.25.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/effective_datatables_helper.rb +9 -1
- data/app/helpers/effective_datatables_private_helper.rb +1 -1
- data/app/models/effective/effective_datatable/collection.rb +4 -2
- data/app/models/effective/effective_datatable/format.rb +1 -1
- data/config/locales/en.yml +1 -0
- data/config/locales/es.yml +1 -0
- data/config/locales/nl.yml +1 -0
- data/lib/effective_datatables/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee2ffed192a97207be7e49f3dc13ea49695e6efa6a9f302b28cc6871fb501533
|
4
|
+
data.tar.gz: 747968e4eacfe8cbac5888a8535525c546465d70395b8fbad8880cd6d7f7b6cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d37a268fd08e0590a44dc8adf2fd041afe72ad3a49965ccfa4aac8237906d7ca4e1886a924254d2d3429e320b5c4a1f91ba9fa95aa3709b0e3bc0584796a5d1
|
7
|
+
data.tar.gz: 943b66cd71ec58c8bc4db1c3257d56d882e0abb047674b8303c301e1783614a8ec0cebc2fb48fd046bf060fbe7299b4c9c8a831fe78db2a7f5380fb2ac785fd9
|
@@ -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
|
-
|
49
|
-
|
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
|
|
@@ -96,7 +96,7 @@ module Effective
|
|
96
96
|
if csv
|
97
97
|
return value.map { |v| format_column(v, column, csv: csv) }.join("\n")
|
98
98
|
else
|
99
|
-
return value.map { |v| view.content_tag(:div, format_column(v, column, csv: csv), class: 'col-resource_item') }.join.html_safe
|
99
|
+
return value.map { |v| view.content_tag(:div, format_column(v, column, csv: csv).html_safe, class: 'col-resource_item') }.join.html_safe
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
data/config/locales/en.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/config/locales/nl.yml
CHANGED
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.
|
4
|
+
version: 4.25.1
|
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-
|
11
|
+
date: 2024-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|