effective_datatables 4.8.9 → 4.8.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_datatables/initialize.js.coffee +2 -3
- data/app/assets/javascripts/effective_datatables/reorder.js.coffee +8 -2
- data/app/assets/javascripts/vendor/jquery.delayedChange.js +1 -1
- data/app/helpers/effective_datatables_helper.rb +1 -0
- data/app/models/effective/datatable.rb +1 -1
- data/app/models/effective/effective_datatable/format.rb +3 -3
- data/app/models/effective/effective_datatable/resource.rb +1 -1
- data/config/effective_datatables.rb +4 -0
- data/config/locales/en.yml +2 -1
- data/config/locales/es.yml +2 -1
- data/config/locales/nl.yml +2 -1
- data/lib/effective_datatables.rb +4 -0
- data/lib/effective_datatables/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 065a97713aa78f1febed39ab02736af303742cc15a691fa556f60225035bdc91
|
4
|
+
data.tar.gz: dcfe7909bd5e6a30a16ca700bdaf01721ca95590a58b36ee20c5f17f446faa36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea4bd624315535fd4eca9ae8abef4176c10fc7033e0dc45cf2d6fa56a439dad5adbf81a5249d727b02c0e4a0f6d799710779fd69b8d80aaab779c2b3dadb716c
|
7
|
+
data.tar.gz: 075defd26c55ed28f71dc6a8becd9efb71c2edf51799c56568b8fbfc612689e95b0cf3bdfe7b7447eb858261b11a1878366792074ba254cef7b2c0e0cb6eaecb
|
@@ -52,7 +52,7 @@ initializeDataTables = (target) ->
|
|
52
52
|
displayStart: datatable.data('display-start')
|
53
53
|
iDisplayLength: datatable.data('display-length')
|
54
54
|
language: datatable.data('language')
|
55
|
-
lengthMenu: [[5, 10, 25, 50, 100, 250, 500, 9999999], ['5', '10', '25', '50', '100', '250', '500', '
|
55
|
+
lengthMenu: [[5, 10, 25, 50, 100, 250, 500, 9999999], ['5', '10', '25', '50', '100', '250', '500', datatable.data('all-label')]]
|
56
56
|
order: datatable.data('display-order')
|
57
57
|
processing: true
|
58
58
|
responsive: true
|
@@ -80,7 +80,7 @@ initializeDataTables = (target) ->
|
|
80
80
|
filter_name = name.replace('filters[', '').substring(0, name.length-9)
|
81
81
|
|
82
82
|
params['filter'][filter_name] = $form.find("input[name='#{name}']:checked").val()
|
83
|
-
|
83
|
+
|
84
84
|
else if $input.attr('id')
|
85
85
|
filter_name = $input.attr('id').replace('filters_', '')
|
86
86
|
params['filter'][filter_name] = $input.val()
|
@@ -165,7 +165,6 @@ initializeDataTables = (target) ->
|
|
165
165
|
$input.on 'change', (event) -> dataTableSearch($(event.currentTarget))
|
166
166
|
else if $input.is('input')
|
167
167
|
$input.delayedChange ($input) -> dataTableSearch($input)
|
168
|
-
$input.on('paste', -> dataTableSearch($input))
|
169
168
|
|
170
169
|
# Do the actual search
|
171
170
|
dataTableSearch = ($input) -> # This is the function called by a select or input to run the search
|
@@ -8,7 +8,14 @@ reorder = (event, diff, edit) ->
|
|
8
8
|
return unless oldNode? && newNode?
|
9
9
|
|
10
10
|
url = @context[0].ajax.url.replace('.json', '/reorder.json')
|
11
|
-
|
11
|
+
|
12
|
+
data = {
|
13
|
+
'authenticity_token': $('head').find("meta[name='csrf-token']").attr('content'),
|
14
|
+
'reorder[id]': oldNode.data('reorder-resource'),
|
15
|
+
'reorder[old]': oldNode.val(),
|
16
|
+
'reorder[new]': newNode.val(),
|
17
|
+
'attributes': $table.data('attributes')
|
18
|
+
}
|
12
19
|
|
13
20
|
@context[0].rowreorder.c.enable = false
|
14
21
|
|
@@ -40,4 +47,3 @@ $(document).on 'click', '.dataTables_wrapper a.buttons-reorder', (event) ->
|
|
40
47
|
$table.addClass('reordering')
|
41
48
|
|
42
49
|
column.visible(!column.visible())
|
43
|
-
|
@@ -40,6 +40,7 @@ module EffectiveDatatablesHelper
|
|
40
40
|
id: datatable.to_param,
|
41
41
|
class: html_class,
|
42
42
|
data: {
|
43
|
+
'all-label' => I18n.t('effective_datatables.all'),
|
43
44
|
'attributes' => EffectiveDatatables.encrypt(datatable.attributes),
|
44
45
|
'authenticity-token' => form_authenticity_token,
|
45
46
|
'bulk-actions' => datatable_bulk_actions(datatable),
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Effective
|
2
2
|
class Datatable
|
3
3
|
attr_reader :attributes # Anything that we initialize our table with. That's it. Can't be changed by state.
|
4
|
-
attr_reader :effective_resource
|
5
4
|
attr_reader :state
|
5
|
+
attr_accessor :effective_resource
|
6
6
|
|
7
7
|
# Hashes of DSL options
|
8
8
|
attr_reader :_aggregates
|
@@ -88,9 +88,9 @@ module Effective
|
|
88
88
|
when :currency
|
89
89
|
view.number_to_currency(value)
|
90
90
|
when :date
|
91
|
-
(value.strftime(
|
91
|
+
value.respond_to?(:strftime) ? value.strftime(EffectiveDatatables.format_date) : BLANK
|
92
92
|
when :datetime
|
93
|
-
(value.strftime(
|
93
|
+
value.respond_to?(:strftime) ? value.strftime(EffectiveDatatables.format_datetime) : BLANK
|
94
94
|
when :decimal
|
95
95
|
value
|
96
96
|
when :duration
|
@@ -116,7 +116,7 @@ module Effective
|
|
116
116
|
when Numeric ; view.number_to_currency(value)
|
117
117
|
end
|
118
118
|
when :time
|
119
|
-
(value.strftime(
|
119
|
+
value.respond_to?(:strftime) ? value.strftime(EffectiveDatatables.format_time) : BLANK
|
120
120
|
else
|
121
121
|
value.to_s
|
122
122
|
end
|
@@ -31,7 +31,7 @@ module Effective
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def load_effective_resource!
|
34
|
-
@effective_resource
|
34
|
+
@effective_resource ||= if active_record_collection?
|
35
35
|
Effective::Resource.new(collection_class, namespace: controller_namespace)
|
36
36
|
end
|
37
37
|
end
|
@@ -39,4 +39,8 @@ EffectiveDatatables.setup do |config|
|
|
39
39
|
config.cookie_domain = :all # Should usually be :all
|
40
40
|
config.cookie_tld_length = nil # Leave nil to autodetect, or set to probably 2
|
41
41
|
|
42
|
+
# Date formatting
|
43
|
+
config.format_datetime = '%F %H:%M'
|
44
|
+
config.format_date = '%F'
|
45
|
+
config.format_time = '%H:%M'
|
42
46
|
end
|
data/config/locales/en.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/config/locales/nl.yml
CHANGED
data/lib/effective_datatables.rb
CHANGED
@@ -16,6 +16,10 @@ module EffectiveDatatables
|
|
16
16
|
mattr_accessor :cookie_domain
|
17
17
|
mattr_accessor :cookie_tld_length
|
18
18
|
|
19
|
+
mattr_accessor :format_datetime
|
20
|
+
mattr_accessor :format_date
|
21
|
+
mattr_accessor :format_time
|
22
|
+
|
19
23
|
mattr_accessor :debug
|
20
24
|
|
21
25
|
alias_method :max_cookie_size, :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.8.
|
4
|
+
version: 4.8.14
|
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:
|
11
|
+
date: 2021-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
195
|
requirements: []
|
196
|
-
rubygems_version: 3.1.
|
196
|
+
rubygems_version: 3.1.2
|
197
197
|
signing_key:
|
198
198
|
specification_version: 4
|
199
199
|
summary: Uniquely powerful server-side searching, sorting and filtering of any ActiveRecord
|