datagrid 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/datagrid.gemspec +26 -164
- data/lib/datagrid/columns.rb +5 -10
- data/lib/datagrid/filters.rb +3 -6
- data/lib/datagrid/filters/base_filter.rb +8 -0
- data/lib/datagrid/form_builder.rb +14 -13
- data/lib/datagrid/version.rb +3 -0
- metadata +10 -196
- data/.document +0 -5
- data/.rspec +0 -1
- data/.travis.yml +0 -23
- data/Gemfile +0 -33
- data/Rakefile +0 -43
- data/VERSION +0 -1
- data/spec/datagrid/active_model_spec.rb +0 -33
- data/spec/datagrid/column_names_attribute_spec.rb +0 -86
- data/spec/datagrid/columns/column_spec.rb +0 -19
- data/spec/datagrid/columns_spec.rb +0 -592
- data/spec/datagrid/core_spec.rb +0 -210
- data/spec/datagrid/drivers/active_record_spec.rb +0 -79
- data/spec/datagrid/drivers/array_spec.rb +0 -106
- data/spec/datagrid/drivers/mongo_mapper_spec.rb +0 -101
- data/spec/datagrid/drivers/mongoid_spec.rb +0 -109
- data/spec/datagrid/drivers/sequel_spec.rb +0 -111
- data/spec/datagrid/filters/base_filter_spec.rb +0 -19
- data/spec/datagrid/filters/boolean_enum_filter_spec.rb +0 -5
- data/spec/datagrid/filters/composite_filters_spec.rb +0 -65
- data/spec/datagrid/filters/date_filter_spec.rb +0 -198
- data/spec/datagrid/filters/date_time_filter_spec.rb +0 -157
- data/spec/datagrid/filters/dynamic_filter_spec.rb +0 -175
- data/spec/datagrid/filters/enum_filter_spec.rb +0 -51
- data/spec/datagrid/filters/extended_boolean_filter_spec.rb +0 -46
- data/spec/datagrid/filters/float_filter_spec.rb +0 -15
- data/spec/datagrid/filters/integer_filter_spec.rb +0 -144
- data/spec/datagrid/filters/string_filter_spec.rb +0 -35
- data/spec/datagrid/filters_spec.rb +0 -332
- data/spec/datagrid/form_builder_spec.rb +0 -611
- data/spec/datagrid/helper_spec.rb +0 -683
- data/spec/datagrid/ordering_spec.rb +0 -150
- data/spec/datagrid/scaffold_spec.rb +0 -45
- data/spec/datagrid/stylesheet_spec.rb +0 -12
- data/spec/datagrid/utils_spec.rb +0 -19
- data/spec/datagrid_spec.rb +0 -94
- data/spec/spec_helper.rb +0 -123
- data/spec/support/active_record.rb +0 -38
- data/spec/support/configuration.rb +0 -28
- data/spec/support/i18n_helpers.rb +0 -6
- data/spec/support/matchers.rb +0 -101
- data/spec/support/mongo_mapper.rb +0 -32
- data/spec/support/mongoid.rb +0 -36
- data/spec/support/sequel.rb +0 -39
- data/spec/support/simple_report.rb +0 -64
- data/spec/support/test_partials/_actions.html.erb +0 -1
- data/spec/support/test_partials/client/datagrid/_form.html.erb +0 -13
- data/spec/support/test_partials/client/datagrid/_head.html.erb +0 -9
- data/spec/support/test_partials/client/datagrid/_order_for.html.erb +0 -11
- data/spec/support/test_partials/client/datagrid/_row.html.erb +0 -6
- data/spec/support/test_partials/client/datagrid/_table.html.erb +0 -19
- data/spec/support/test_partials/custom_checkboxes/_enum_checkboxes.html.erb +0 -1
- data/spec/support/test_partials/custom_form/_form.html.erb +0 -7
- data/spec/support/test_partials/custom_range/_range_filter.html.erb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4accb02f36dc5af245b6dd84008c22293e9bc0f6105b7fdfebe9458b6a7fa1e1
|
4
|
+
data.tar.gz: 4ca75ebff1804e8eaba5b0e41cae04e32f63c24211baffdc501a93870e1ba7e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8ab20bbbaec525f993c7e20a1ed5bd0105f6d2fc0c9ab098570401e610b7030a696c263959478b0cb4a39ecf921c81e5621bb76198cbc96060f433f23cbcaa5
|
7
|
+
data.tar.gz: 9158b9d0f26ee862292a5fdc0d9b596ee2ac70e52006cb559af1bfc043a5d43419c476e1b5a796a42a19e7bc5efcfb9e2b4e37e0fdfa9a8286c795a505aad573
|
data/CHANGELOG.md
ADDED
data/datagrid.gemspec
CHANGED
@@ -1,179 +1,41 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
# stub: datagrid 1.6.1 ruby lib
|
1
|
+
# frozen_string_literal: true
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "datagrid/version"
|
6
5
|
|
7
6
|
Gem::Specification.new do |s|
|
8
|
-
s.name = "datagrid"
|
9
|
-
s.version =
|
10
|
-
|
11
|
-
s.
|
12
|
-
s.require_paths = ["lib".freeze]
|
13
|
-
s.authors = ["Bogdan Gusiev".freeze]
|
7
|
+
s.name = "datagrid"
|
8
|
+
s.version = Datagrid::VERSION
|
9
|
+
s.require_paths = ["lib"]
|
10
|
+
s.authors = ["Bogdan Gusiev"]
|
14
11
|
s.date = "2020-09-07"
|
15
|
-
s.
|
16
|
-
s.
|
12
|
+
s.summary = "Ruby gem to create datagrids"
|
13
|
+
s.description = "This allows you to easily build datagrid aka data tables with sortable columns and filters"
|
14
|
+
s.email = "agresso@gmail.com"
|
17
15
|
s.extra_rdoc_files = [
|
18
16
|
"LICENSE.txt",
|
19
17
|
"Readme.markdown"
|
20
18
|
]
|
21
19
|
s.files = [
|
22
|
-
".document",
|
23
|
-
".rspec",
|
24
|
-
".travis.yml",
|
25
|
-
"Gemfile",
|
26
20
|
"LICENSE.txt",
|
27
|
-
"
|
21
|
+
"CHANGELOG.md",
|
28
22
|
"Readme.markdown",
|
29
|
-
"VERSION",
|
30
|
-
"app/assets/stylesheets/datagrid.sass",
|
31
|
-
"app/views/datagrid/_enum_checkboxes.html.erb",
|
32
|
-
"app/views/datagrid/_form.html.erb",
|
33
|
-
"app/views/datagrid/_head.html.erb",
|
34
|
-
"app/views/datagrid/_order_for.html.erb",
|
35
|
-
"app/views/datagrid/_range_filter.html.erb",
|
36
|
-
"app/views/datagrid/_row.html.erb",
|
37
|
-
"app/views/datagrid/_table.html.erb",
|
38
23
|
"datagrid.gemspec",
|
39
|
-
"lib/datagrid.rb",
|
40
|
-
"lib/datagrid/active_model.rb",
|
41
|
-
"lib/datagrid/column_names_attribute.rb",
|
42
|
-
"lib/datagrid/columns.rb",
|
43
|
-
"lib/datagrid/columns/column.rb",
|
44
|
-
"lib/datagrid/configuration.rb",
|
45
|
-
"lib/datagrid/core.rb",
|
46
|
-
"lib/datagrid/drivers.rb",
|
47
|
-
"lib/datagrid/drivers/abstract_driver.rb",
|
48
|
-
"lib/datagrid/drivers/active_record.rb",
|
49
|
-
"lib/datagrid/drivers/array.rb",
|
50
|
-
"lib/datagrid/drivers/mongo_mapper.rb",
|
51
|
-
"lib/datagrid/drivers/mongoid.rb",
|
52
|
-
"lib/datagrid/drivers/sequel.rb",
|
53
|
-
"lib/datagrid/engine.rb",
|
54
|
-
"lib/datagrid/filters.rb",
|
55
|
-
"lib/datagrid/filters/base_filter.rb",
|
56
|
-
"lib/datagrid/filters/boolean_enum_filter.rb",
|
57
|
-
"lib/datagrid/filters/boolean_filter.rb",
|
58
|
-
"lib/datagrid/filters/composite_filters.rb",
|
59
|
-
"lib/datagrid/filters/date_filter.rb",
|
60
|
-
"lib/datagrid/filters/date_time_filter.rb",
|
61
|
-
"lib/datagrid/filters/default_filter.rb",
|
62
|
-
"lib/datagrid/filters/dynamic_filter.rb",
|
63
|
-
"lib/datagrid/filters/enum_filter.rb",
|
64
|
-
"lib/datagrid/filters/extended_boolean_filter.rb",
|
65
|
-
"lib/datagrid/filters/float_filter.rb",
|
66
|
-
"lib/datagrid/filters/integer_filter.rb",
|
67
|
-
"lib/datagrid/filters/ranged_filter.rb",
|
68
|
-
"lib/datagrid/filters/select_options.rb",
|
69
|
-
"lib/datagrid/filters/string_filter.rb",
|
70
|
-
"lib/datagrid/form_builder.rb",
|
71
|
-
"lib/datagrid/helper.rb",
|
72
|
-
"lib/datagrid/locale/en.yml",
|
73
|
-
"lib/datagrid/ordering.rb",
|
74
|
-
"lib/datagrid/renderer.rb",
|
75
|
-
"lib/datagrid/rspec.rb",
|
76
|
-
"lib/datagrid/scaffold.rb",
|
77
|
-
"lib/datagrid/utils.rb",
|
78
|
-
"lib/tasks/datagrid_tasks.rake",
|
79
|
-
"spec/datagrid/active_model_spec.rb",
|
80
|
-
"spec/datagrid/column_names_attribute_spec.rb",
|
81
|
-
"spec/datagrid/columns/column_spec.rb",
|
82
|
-
"spec/datagrid/columns_spec.rb",
|
83
|
-
"spec/datagrid/core_spec.rb",
|
84
|
-
"spec/datagrid/drivers/active_record_spec.rb",
|
85
|
-
"spec/datagrid/drivers/array_spec.rb",
|
86
|
-
"spec/datagrid/drivers/mongo_mapper_spec.rb",
|
87
|
-
"spec/datagrid/drivers/mongoid_spec.rb",
|
88
|
-
"spec/datagrid/drivers/sequel_spec.rb",
|
89
|
-
"spec/datagrid/filters/base_filter_spec.rb",
|
90
|
-
"spec/datagrid/filters/boolean_enum_filter_spec.rb",
|
91
|
-
"spec/datagrid/filters/composite_filters_spec.rb",
|
92
|
-
"spec/datagrid/filters/date_filter_spec.rb",
|
93
|
-
"spec/datagrid/filters/date_time_filter_spec.rb",
|
94
|
-
"spec/datagrid/filters/dynamic_filter_spec.rb",
|
95
|
-
"spec/datagrid/filters/enum_filter_spec.rb",
|
96
|
-
"spec/datagrid/filters/extended_boolean_filter_spec.rb",
|
97
|
-
"spec/datagrid/filters/float_filter_spec.rb",
|
98
|
-
"spec/datagrid/filters/integer_filter_spec.rb",
|
99
|
-
"spec/datagrid/filters/string_filter_spec.rb",
|
100
|
-
"spec/datagrid/filters_spec.rb",
|
101
|
-
"spec/datagrid/form_builder_spec.rb",
|
102
|
-
"spec/datagrid/helper_spec.rb",
|
103
|
-
"spec/datagrid/ordering_spec.rb",
|
104
|
-
"spec/datagrid/scaffold_spec.rb",
|
105
|
-
"spec/datagrid/stylesheet_spec.rb",
|
106
|
-
"spec/datagrid/utils_spec.rb",
|
107
|
-
"spec/datagrid_spec.rb",
|
108
|
-
"spec/spec_helper.rb",
|
109
|
-
"spec/support/active_record.rb",
|
110
|
-
"spec/support/configuration.rb",
|
111
|
-
"spec/support/i18n_helpers.rb",
|
112
|
-
"spec/support/matchers.rb",
|
113
|
-
"spec/support/mongo_mapper.rb",
|
114
|
-
"spec/support/mongoid.rb",
|
115
|
-
"spec/support/sequel.rb",
|
116
|
-
"spec/support/simple_report.rb",
|
117
|
-
"spec/support/test_partials/_actions.html.erb",
|
118
|
-
"spec/support/test_partials/client/datagrid/_form.html.erb",
|
119
|
-
"spec/support/test_partials/client/datagrid/_head.html.erb",
|
120
|
-
"spec/support/test_partials/client/datagrid/_order_for.html.erb",
|
121
|
-
"spec/support/test_partials/client/datagrid/_row.html.erb",
|
122
|
-
"spec/support/test_partials/client/datagrid/_table.html.erb",
|
123
|
-
"spec/support/test_partials/custom_checkboxes/_enum_checkboxes.html.erb",
|
124
|
-
"spec/support/test_partials/custom_form/_form.html.erb",
|
125
|
-
"spec/support/test_partials/custom_range/_range_filter.html.erb",
|
126
|
-
"templates/base.rb.erb",
|
127
|
-
"templates/controller.rb.erb",
|
128
|
-
"templates/grid.rb.erb",
|
129
|
-
"templates/index.html.erb"
|
130
24
|
]
|
131
|
-
s.
|
132
|
-
s.
|
133
|
-
s.
|
134
|
-
s.
|
135
|
-
s.
|
136
|
-
|
137
|
-
|
138
|
-
|
25
|
+
s.files += `git ls-files | grep -E '^(app|lib|templates)'`.split("\n")
|
26
|
+
s.homepage = "http://github.com/bogdan/datagrid"
|
27
|
+
s.licenses = ["MIT"]
|
28
|
+
s.required_ruby_version = Gem::Requirement.new(">= 2.0")
|
29
|
+
s.rubygems_version = "3.0.8"
|
30
|
+
url = 'https://github.com/bogdan/datagrid'
|
31
|
+
s.metadata = {
|
32
|
+
"homepage_uri" => url,
|
33
|
+
"bug_tracker_uri" => "#{url}/issues",
|
34
|
+
"documentation_uri" => "#{url}/wiki",
|
35
|
+
"changelog_uri" => "#{url}/blob/master/CHANGELOG.md",
|
36
|
+
"source_code_uri" => url,
|
37
|
+
}
|
139
38
|
|
140
|
-
|
141
|
-
s.add_runtime_dependency(%q<rails>.freeze, [">= 4.0"])
|
142
|
-
s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
|
143
|
-
s.add_development_dependency(%q<jeweler>.freeze, [">= 2.1.2"])
|
144
|
-
s.add_development_dependency(%q<pry-byebug>.freeze, [">= 0"])
|
145
|
-
s.add_development_dependency(%q<rspec>.freeze, [">= 3"])
|
146
|
-
s.add_development_dependency(%q<nokogiri>.freeze, [">= 0"])
|
147
|
-
s.add_development_dependency(%q<sqlite3>.freeze, ["~> 1.4"])
|
148
|
-
s.add_development_dependency(%q<sequel>.freeze, [">= 0"])
|
149
|
-
s.add_development_dependency(%q<mongoid>.freeze, [">= 0"])
|
150
|
-
s.add_development_dependency(%q<bson>.freeze, [">= 0"])
|
151
|
-
s.add_development_dependency(%q<bson_ext>.freeze, [">= 0"])
|
152
|
-
else
|
153
|
-
s.add_dependency(%q<rails>.freeze, [">= 4.0"])
|
154
|
-
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
155
|
-
s.add_dependency(%q<jeweler>.freeze, [">= 2.1.2"])
|
156
|
-
s.add_dependency(%q<pry-byebug>.freeze, [">= 0"])
|
157
|
-
s.add_dependency(%q<rspec>.freeze, [">= 3"])
|
158
|
-
s.add_dependency(%q<nokogiri>.freeze, [">= 0"])
|
159
|
-
s.add_dependency(%q<sqlite3>.freeze, ["~> 1.4"])
|
160
|
-
s.add_dependency(%q<sequel>.freeze, [">= 0"])
|
161
|
-
s.add_dependency(%q<mongoid>.freeze, [">= 0"])
|
162
|
-
s.add_dependency(%q<bson>.freeze, [">= 0"])
|
163
|
-
s.add_dependency(%q<bson_ext>.freeze, [">= 0"])
|
164
|
-
end
|
165
|
-
else
|
166
|
-
s.add_dependency(%q<rails>.freeze, [">= 4.0"])
|
167
|
-
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
168
|
-
s.add_dependency(%q<jeweler>.freeze, [">= 2.1.2"])
|
169
|
-
s.add_dependency(%q<pry-byebug>.freeze, [">= 0"])
|
170
|
-
s.add_dependency(%q<rspec>.freeze, [">= 3"])
|
171
|
-
s.add_dependency(%q<nokogiri>.freeze, [">= 0"])
|
172
|
-
s.add_dependency(%q<sqlite3>.freeze, ["~> 1.4"])
|
173
|
-
s.add_dependency(%q<sequel>.freeze, [">= 0"])
|
174
|
-
s.add_dependency(%q<mongoid>.freeze, [">= 0"])
|
175
|
-
s.add_dependency(%q<bson>.freeze, [">= 0"])
|
176
|
-
s.add_dependency(%q<bson_ext>.freeze, [">= 0"])
|
177
|
-
end
|
39
|
+
s.add_dependency(%q<rails>, [">= 4.0"])
|
178
40
|
end
|
179
41
|
|
data/lib/datagrid/columns.rb
CHANGED
@@ -121,8 +121,8 @@ module Datagrid
|
|
121
121
|
# * <tt>:preload</tt> - spefies which associations of the scope should be preloaded for this column
|
122
122
|
#
|
123
123
|
# See: https://github.com/bogdan/datagrid/wiki/Columns for examples
|
124
|
-
def column(name,
|
125
|
-
define_column(columns_array, name,
|
124
|
+
def column(name, query = nil, **options, &block)
|
125
|
+
define_column(columns_array, name, query, options, &block)
|
126
126
|
end
|
127
127
|
|
128
128
|
# Returns column definition with given name
|
@@ -195,12 +195,7 @@ module Datagrid
|
|
195
195
|
end
|
196
196
|
end
|
197
197
|
|
198
|
-
def define_column(columns, name,
|
199
|
-
if options_or_query.is_a?(String)
|
200
|
-
query = options_or_query
|
201
|
-
else
|
202
|
-
options = options_or_query
|
203
|
-
end
|
198
|
+
def define_column(columns, name, query = nil, **options, &block) #:nodoc:
|
204
199
|
check_scope_defined!("Scope should be defined before columns")
|
205
200
|
block ||= lambda do |model|
|
206
201
|
model.send(name)
|
@@ -406,8 +401,8 @@ module Datagrid
|
|
406
401
|
# Defines a column at instance level
|
407
402
|
#
|
408
403
|
# See Datagrid::Columns::ClassMethods#column for more info
|
409
|
-
def column(name,
|
410
|
-
self.class.define_column(columns_array, name,
|
404
|
+
def column(name, query = nil, **options, &block)
|
405
|
+
self.class.define_column(columns_array, name, query, options, &block)
|
411
406
|
end
|
412
407
|
|
413
408
|
def initialize(*) #:nodoc:
|
data/lib/datagrid/filters.rb
CHANGED
@@ -90,14 +90,11 @@ module Datagrid
|
|
90
90
|
# Accepts a block or a symbol with an instance method name
|
91
91
|
# * <tt>:unless</tt> - specify the reverse condition when the filter can be dislayed and used.
|
92
92
|
# Accepts a block or a symbol with an instance method name
|
93
|
+
# * <tt>:input_options</tt> - options passed when rendering html input tag attributes
|
94
|
+
# * <tt>:label_options</tt> - options passed when rendering html label tag attributes
|
93
95
|
#
|
94
96
|
# See: https://github.com/bogdan/datagrid/wiki/Filters for examples
|
95
|
-
def filter(name, type = :default, options
|
96
|
-
if type.is_a?(Hash)
|
97
|
-
options = type
|
98
|
-
type = :default
|
99
|
-
end
|
100
|
-
|
97
|
+
def filter(name, type = :default, **options, &block)
|
101
98
|
klass = type.is_a?(Class) ? type : FILTER_TYPES[type]
|
102
99
|
raise ConfigurationError, "filter class #{type.inspect} not found" unless klass
|
103
100
|
|
@@ -84,6 +84,14 @@ class Datagrid::Filters::BaseFilter #:nodoc:
|
|
84
84
|
options[:allow_blank]
|
85
85
|
end
|
86
86
|
|
87
|
+
def input_options
|
88
|
+
options[:input_options] || {}
|
89
|
+
end
|
90
|
+
|
91
|
+
def label_options
|
92
|
+
options[:label_options] || {}
|
93
|
+
end
|
94
|
+
|
87
95
|
def form_builder_helper_name
|
88
96
|
self.class.form_builder_helper_name
|
89
97
|
end
|
@@ -4,19 +4,21 @@ module Datagrid
|
|
4
4
|
module FormBuilder
|
5
5
|
|
6
6
|
# Returns a form input html for the corresponding filter name
|
7
|
-
def datagrid_filter(filter_or_attribute, options
|
7
|
+
def datagrid_filter(filter_or_attribute, **options, &block)
|
8
8
|
filter = datagrid_get_filter(filter_or_attribute)
|
9
|
-
options =
|
9
|
+
options = {
|
10
|
+
**filter.input_options,
|
11
|
+
**add_html_classes(options, filter.name, datagrid_filter_html_class(filter))
|
12
|
+
}
|
10
13
|
# Prevent partials option from appearing in HTML attributes
|
11
14
|
options.delete(:partials) # Legacy option
|
12
15
|
self.send(filter.form_builder_helper_name, filter, options, &block)
|
13
16
|
end
|
14
17
|
|
15
18
|
# Returns a form label html for the corresponding filter name
|
16
|
-
def datagrid_label(filter_or_attribute,
|
19
|
+
def datagrid_label(filter_or_attribute, text = nil, **options, &block)
|
17
20
|
filter = datagrid_get_filter(filter_or_attribute)
|
18
|
-
|
19
|
-
label(filter.name, text, options, &block)
|
21
|
+
label(filter.name, text || filter.header, **filter.label_options, **options, &block)
|
20
22
|
end
|
21
23
|
|
22
24
|
protected
|
@@ -42,7 +44,7 @@ module Datagrid
|
|
42
44
|
|
43
45
|
def datagrid_default_filter(attribute_or_filter, options = {})
|
44
46
|
filter = datagrid_get_filter(attribute_or_filter)
|
45
|
-
text_field filter.name,
|
47
|
+
text_field filter.name, value: object.filter_value_as_string(filter), **options
|
46
48
|
end
|
47
49
|
|
48
50
|
def datagrid_enum_filter(attribute_or_filter, options = {}, &block)
|
@@ -65,16 +67,15 @@ module Datagrid
|
|
65
67
|
}
|
66
68
|
)
|
67
69
|
else
|
68
|
-
if !options.has_key?(:multiple) && filter.multiple?
|
69
|
-
options[:multiple] = true
|
70
|
-
end
|
71
70
|
select(
|
72
71
|
filter.name,
|
73
72
|
object.select_options(filter) || [],
|
74
73
|
{:include_blank => filter.include_blank,
|
75
74
|
:prompt => filter.prompt,
|
76
75
|
:include_hidden => false},
|
77
|
-
|
76
|
+
multiple: filter.multiple?,
|
77
|
+
**options,
|
78
|
+
&block
|
78
79
|
)
|
79
80
|
end
|
80
81
|
end
|
@@ -119,7 +120,7 @@ module Datagrid
|
|
119
120
|
{:include_blank => false, :include_hidden => false, :prompt => false, :selected => operation },
|
120
121
|
add_html_classes(options, "operation")
|
121
122
|
)
|
122
|
-
value_input = text_field(filter.name, add_html_classes(options, "value")
|
123
|
+
value_input = text_field(filter.name, **add_html_classes(options, "value"), value: value)
|
123
124
|
[field_input, operation_input, value_input].join("\n").html_safe
|
124
125
|
end
|
125
126
|
|
@@ -129,7 +130,7 @@ module Datagrid
|
|
129
130
|
# select options format may vary
|
130
131
|
value = value.last if value.is_a?(Array)
|
131
132
|
# don't render any visible input when there is nothing to choose from
|
132
|
-
hidden_field(name, html_options
|
133
|
+
hidden_field(name, **html_options, value: value)
|
133
134
|
else
|
134
135
|
select(name, variants, select_options, html_options)
|
135
136
|
end
|
@@ -177,7 +178,7 @@ module Datagrid
|
|
177
178
|
end
|
178
179
|
|
179
180
|
def datagrid_get_attribute(attribute_or_filter)
|
180
|
-
Utils.string_like?(attribute_or_filter) ?
|
181
|
+
Utils.string_like?(attribute_or_filter) ? attribute_or_filter : attribute_or_filter.name
|
181
182
|
end
|
182
183
|
|
183
184
|
def datagrid_get_filter(attribute_or_filter)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datagrid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bogdan Gusiev
|
@@ -24,146 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: bundler
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: jeweler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 2.1.2
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 2.1.2
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: pry-byebug
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rspec
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '3'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '3'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: nokogiri
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: sqlite3
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '1.4'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '1.4'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: sequel
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: mongoid
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: bson
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - ">="
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: bson_ext
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - ">="
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - ">="
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
167
27
|
description: This allows you to easily build datagrid aka data tables with sortable
|
168
28
|
columns and filters
|
169
29
|
email: agresso@gmail.com
|
@@ -173,14 +33,9 @@ extra_rdoc_files:
|
|
173
33
|
- LICENSE.txt
|
174
34
|
- Readme.markdown
|
175
35
|
files:
|
176
|
-
-
|
177
|
-
- ".rspec"
|
178
|
-
- ".travis.yml"
|
179
|
-
- Gemfile
|
36
|
+
- CHANGELOG.md
|
180
37
|
- LICENSE.txt
|
181
|
-
- Rakefile
|
182
38
|
- Readme.markdown
|
183
|
-
- VERSION
|
184
39
|
- app/assets/stylesheets/datagrid.sass
|
185
40
|
- app/views/datagrid/_enum_checkboxes.html.erb
|
186
41
|
- app/views/datagrid/_form.html.erb
|
@@ -229,54 +84,8 @@ files:
|
|
229
84
|
- lib/datagrid/rspec.rb
|
230
85
|
- lib/datagrid/scaffold.rb
|
231
86
|
- lib/datagrid/utils.rb
|
87
|
+
- lib/datagrid/version.rb
|
232
88
|
- lib/tasks/datagrid_tasks.rake
|
233
|
-
- spec/datagrid/active_model_spec.rb
|
234
|
-
- spec/datagrid/column_names_attribute_spec.rb
|
235
|
-
- spec/datagrid/columns/column_spec.rb
|
236
|
-
- spec/datagrid/columns_spec.rb
|
237
|
-
- spec/datagrid/core_spec.rb
|
238
|
-
- spec/datagrid/drivers/active_record_spec.rb
|
239
|
-
- spec/datagrid/drivers/array_spec.rb
|
240
|
-
- spec/datagrid/drivers/mongo_mapper_spec.rb
|
241
|
-
- spec/datagrid/drivers/mongoid_spec.rb
|
242
|
-
- spec/datagrid/drivers/sequel_spec.rb
|
243
|
-
- spec/datagrid/filters/base_filter_spec.rb
|
244
|
-
- spec/datagrid/filters/boolean_enum_filter_spec.rb
|
245
|
-
- spec/datagrid/filters/composite_filters_spec.rb
|
246
|
-
- spec/datagrid/filters/date_filter_spec.rb
|
247
|
-
- spec/datagrid/filters/date_time_filter_spec.rb
|
248
|
-
- spec/datagrid/filters/dynamic_filter_spec.rb
|
249
|
-
- spec/datagrid/filters/enum_filter_spec.rb
|
250
|
-
- spec/datagrid/filters/extended_boolean_filter_spec.rb
|
251
|
-
- spec/datagrid/filters/float_filter_spec.rb
|
252
|
-
- spec/datagrid/filters/integer_filter_spec.rb
|
253
|
-
- spec/datagrid/filters/string_filter_spec.rb
|
254
|
-
- spec/datagrid/filters_spec.rb
|
255
|
-
- spec/datagrid/form_builder_spec.rb
|
256
|
-
- spec/datagrid/helper_spec.rb
|
257
|
-
- spec/datagrid/ordering_spec.rb
|
258
|
-
- spec/datagrid/scaffold_spec.rb
|
259
|
-
- spec/datagrid/stylesheet_spec.rb
|
260
|
-
- spec/datagrid/utils_spec.rb
|
261
|
-
- spec/datagrid_spec.rb
|
262
|
-
- spec/spec_helper.rb
|
263
|
-
- spec/support/active_record.rb
|
264
|
-
- spec/support/configuration.rb
|
265
|
-
- spec/support/i18n_helpers.rb
|
266
|
-
- spec/support/matchers.rb
|
267
|
-
- spec/support/mongo_mapper.rb
|
268
|
-
- spec/support/mongoid.rb
|
269
|
-
- spec/support/sequel.rb
|
270
|
-
- spec/support/simple_report.rb
|
271
|
-
- spec/support/test_partials/_actions.html.erb
|
272
|
-
- spec/support/test_partials/client/datagrid/_form.html.erb
|
273
|
-
- spec/support/test_partials/client/datagrid/_head.html.erb
|
274
|
-
- spec/support/test_partials/client/datagrid/_order_for.html.erb
|
275
|
-
- spec/support/test_partials/client/datagrid/_row.html.erb
|
276
|
-
- spec/support/test_partials/client/datagrid/_table.html.erb
|
277
|
-
- spec/support/test_partials/custom_checkboxes/_enum_checkboxes.html.erb
|
278
|
-
- spec/support/test_partials/custom_form/_form.html.erb
|
279
|
-
- spec/support/test_partials/custom_range/_range_filter.html.erb
|
280
89
|
- templates/base.rb.erb
|
281
90
|
- templates/controller.rb.erb
|
282
91
|
- templates/grid.rb.erb
|
@@ -284,7 +93,12 @@ files:
|
|
284
93
|
homepage: http://github.com/bogdan/datagrid
|
285
94
|
licenses:
|
286
95
|
- MIT
|
287
|
-
metadata:
|
96
|
+
metadata:
|
97
|
+
homepage_uri: https://github.com/bogdan/datagrid
|
98
|
+
bug_tracker_uri: https://github.com/bogdan/datagrid/issues
|
99
|
+
documentation_uri: https://github.com/bogdan/datagrid/wiki
|
100
|
+
changelog_uri: https://github.com/bogdan/datagrid/blob/master/CHANGELOG.md
|
101
|
+
source_code_uri: https://github.com/bogdan/datagrid
|
288
102
|
post_install_message:
|
289
103
|
rdoc_options: []
|
290
104
|
require_paths:
|
@@ -300,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
300
114
|
- !ruby/object:Gem::Version
|
301
115
|
version: '0'
|
302
116
|
requirements: []
|
303
|
-
rubygems_version: 3.0
|
117
|
+
rubygems_version: 3.2.0
|
304
118
|
signing_key:
|
305
119
|
specification_version: 4
|
306
120
|
summary: Ruby gem to create datagrids
|