effective_datatables 2.2.2 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/effective_datatables/_overrides.scss.erb +5 -0
- data/app/helpers/effective_datatables_helper.rb +0 -2
- data/app/models/effective/active_record_datatable_tool.rb +6 -2
- data/app/models/effective/effective_datatable/options.rb +9 -2
- data/app/models/effective/effective_datatable/rendering.rb +4 -0
- data/lib/effective_datatables/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: accdc49e5adcbb84639c6f04e26a080544bd8f4b
|
4
|
+
data.tar.gz: 763d0016579e806d0d77b54a62caedcbf049b6df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63c01f326d91d3eac11bf530291e193f44e96b418ad2162e54a636b0cba91b4911b751c3389221841470a79ba382f4662a799fc6c133769642fe915088c3e8e4
|
7
|
+
data.tar.gz: 1690d18d9e6656b9ddf3dfdeb4351203355fc6c188434dcfde87a0cc7d0d7de5a1a7690f97ec1198f3fb89dc426b00a9a0b7cf49e8cb3f3c7cc0850a3fe7af3d
|
@@ -35,6 +35,11 @@ table.dataTable thead th {
|
|
35
35
|
.form-group { margin-bottom: 0px; font-weight: normal; }
|
36
36
|
}
|
37
37
|
|
38
|
+
table.dataTable td ul {
|
39
|
+
list-style: none;
|
40
|
+
padding-left: 0;
|
41
|
+
}
|
42
|
+
|
38
43
|
// Sorting disabled
|
39
44
|
table.dataTable.sort-hidden thead .sorting { background-image: none; }
|
40
45
|
table.dataTable.sort-hidden thead .sorting_asc { background-image: none; }
|
@@ -78,8 +78,6 @@ module EffectiveDatatablesHelper
|
|
78
78
|
group_method: opts[:filter][:group_method] || :last,
|
79
79
|
input_html: { name: nil, autocomplete: 'off', data: {'column-name' => opts[:name], 'column-index' => opts[:index]} },
|
80
80
|
input_js: { placeholder: (opts[:label] || name.titleize) }
|
81
|
-
else
|
82
|
-
content_tag(:p, opts[:label] || name)
|
83
81
|
end
|
84
82
|
end
|
85
83
|
|
@@ -24,7 +24,7 @@ module Effective
|
|
24
24
|
before = ''; after = ''
|
25
25
|
|
26
26
|
if postgres?
|
27
|
-
after =
|
27
|
+
after = " NULLS #{order_direction == 'DESC' ? 'FIRST' : 'LAST' }"
|
28
28
|
elsif mysql?
|
29
29
|
before = "ISNULL(#{column}), "
|
30
30
|
end
|
@@ -54,7 +54,11 @@ module Effective
|
|
54
54
|
case table_column[:type]
|
55
55
|
when :string, :text
|
56
56
|
if (table_column[:filter][:type] == :select && table_column[:filter][:fuzzy] != true) || sql_op != :where
|
57
|
-
|
57
|
+
if ['null', 'nil', nil].include?(term)
|
58
|
+
collection.public_send(sql_op, "#{column} = :term OR #{column} IS NULL", term: term)
|
59
|
+
else
|
60
|
+
collection.public_send(sql_op, "#{column} = :term", term: term)
|
61
|
+
end
|
58
62
|
else
|
59
63
|
collection.public_send(sql_op, "#{column} #{ilike} :term", term: "%#{term}%")
|
60
64
|
end
|
@@ -99,7 +99,7 @@ module Effective
|
|
99
99
|
cols[name][:type] = :effective_roles
|
100
100
|
end
|
101
101
|
|
102
|
-
if sql_table.present? && sql_column.blank? # This is a SELECT AS column
|
102
|
+
if sql_table.present? && sql_column.blank? # This is a SELECT AS column, or a JOIN column
|
103
103
|
cols[name][:sql_as_column] = true
|
104
104
|
end
|
105
105
|
|
@@ -131,8 +131,15 @@ module Effective
|
|
131
131
|
# This is a fix for passing filter[:selected] == false, it needs to be 'false'
|
132
132
|
filter[:selected] = filter[:selected].to_s unless filter[:selected].nil?
|
133
133
|
|
134
|
+
# Allow values or collection to be used interchangeably
|
135
|
+
if filter.key?(:collection)
|
136
|
+
filter[:values] ||= filter[:collection]
|
137
|
+
end
|
138
|
+
|
134
139
|
# If you pass values, just assume it's a select
|
135
|
-
|
140
|
+
if filter.key?(:values) && col_type != :belongs_to_polymorphic
|
141
|
+
filter[:type] ||= :select
|
142
|
+
end
|
136
143
|
|
137
144
|
# Check if this is an aggregate column
|
138
145
|
if ['SUM(', 'COUNT(', 'MAX(', 'MIN(', 'AVG('].any? { |str| sql_column.include?(str) }
|
@@ -141,6 +141,10 @@ module Effective
|
|
141
141
|
next if value == nil || value == BLANK || opts[:visible] == false
|
142
142
|
next if opts[:block] || opts[:partial] || opts[:proc]
|
143
143
|
|
144
|
+
if opts[:sql_as_column]
|
145
|
+
row[index] = value.to_s
|
146
|
+
end
|
147
|
+
|
144
148
|
case opts[:type]
|
145
149
|
when :belongs_to, :belongs_to_polymorphic
|
146
150
|
row[index] = value.to_s
|
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: 2.2.
|
4
|
+
version: 2.2.3
|
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: 2015-12-
|
11
|
+
date: 2015-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|