effective_datatables 3.7.6 → 3.7.8
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 +4 -4
- data/app/assets/config/effective_datatables_manifest.js +3 -0
- data/app/models/effective/effective_datatable/format.rb +3 -3
- data/config/effective_datatables.rb +4 -0
- data/lib/effective_datatables/engine.rb +14 -4
- data/lib/effective_datatables/version.rb +1 -1
- data/lib/effective_datatables.rb +4 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38eec9522fdd8de424386c526871a7953c855f76d0c704a4f423fb733c2f94b6
|
4
|
+
data.tar.gz: 5977d5f6c3a49c1aeb28b9eca4eeba0689e7b03768dd276bccc3323870d0523d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 926539ee80184218783912a302bdd4f5a371c4d6c27b6a96ab414d4c3b03536da0cf23b6669342aebfb5cd208ef2ca984bcc645bd27517981cee024420b5a04b
|
7
|
+
data.tar.gz: cdab59641cc16f52ec8444b7efcde008e8c57902938d04a214e8c801b7446616212ea21a826ba5668a2b089cd9db99c760444146d4c4f30a00fa53f1f05a88ab
|
@@ -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
|
@@ -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
|
@@ -1,16 +1,26 @@
|
|
1
|
+
require_relative '../../app/helpers/effective_datatables_controller_helper'
|
2
|
+
require_relative '../../app/helpers/effective_datatables_helper'
|
3
|
+
require_relative '../../app/helpers/effective_datatables_private_helper'
|
4
|
+
|
1
5
|
module EffectiveDatatables
|
2
6
|
class Engine < ::Rails::Engine
|
3
7
|
engine_name 'effective_datatables'
|
4
8
|
|
5
9
|
config.autoload_paths += Dir["#{config.root}/app/models/concerns", '/app/datatables/**/']
|
6
10
|
|
11
|
+
initializer 'effective_datatables.assets' do |app|
|
12
|
+
app.config.assets.precompile += ['effective_datatables_manifest.js', 'images/*']
|
13
|
+
end
|
14
|
+
|
7
15
|
# Include Helpers to base application
|
8
16
|
initializer 'effective_datatables.action_controller' do |app|
|
9
|
-
|
10
|
-
|
11
|
-
|
17
|
+
app.config.to_prepare do
|
18
|
+
ActiveSupport.on_load :action_controller_base do
|
19
|
+
helper EffectiveDatatablesHelper
|
20
|
+
helper EffectiveDatatablesPrivateHelper
|
12
21
|
|
13
|
-
|
22
|
+
ActionController::Base.send :include, ::EffectiveDatatablesControllerHelper
|
23
|
+
end
|
14
24
|
end
|
15
25
|
end
|
16
26
|
|
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: 3.7.
|
4
|
+
version: 3.7.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -91,6 +91,7 @@ extra_rdoc_files: []
|
|
91
91
|
files:
|
92
92
|
- MIT-LICENSE
|
93
93
|
- README.md
|
94
|
+
- app/assets/config/effective_datatables_manifest.js
|
94
95
|
- app/assets/images/dataTables/sort_asc.png
|
95
96
|
- app/assets/images/dataTables/sort_both.png
|
96
97
|
- app/assets/images/dataTables/sort_desc.png
|
@@ -176,7 +177,7 @@ homepage: https://github.com/code-and-effect/effective_datatables
|
|
176
177
|
licenses:
|
177
178
|
- MIT
|
178
179
|
metadata: {}
|
179
|
-
post_install_message:
|
180
|
+
post_install_message:
|
180
181
|
rdoc_options: []
|
181
182
|
require_paths:
|
182
183
|
- lib
|
@@ -191,8 +192,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
191
192
|
- !ruby/object:Gem::Version
|
192
193
|
version: '0'
|
193
194
|
requirements: []
|
194
|
-
rubygems_version: 3.
|
195
|
-
signing_key:
|
195
|
+
rubygems_version: 3.1.2
|
196
|
+
signing_key:
|
196
197
|
specification_version: 4
|
197
198
|
summary: Uniquely powerful server-side searching, sorting and filtering of any ActiveRecord
|
198
199
|
or Array collection as well as post-rendered content displayed as a frontend jQuery
|