gridion 0.0.28 → 0.0.29
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.
- data/README.textile +5 -1
- data/lib/gridion/grid_helper.rb +4 -2
- data/lib/gridion/version.rb +1 -1
- data/test/dummy/log/test.log +1 -0
- metadata +4 -4
data/README.textile
CHANGED
@@ -7,7 +7,7 @@ h2. Features
|
|
7
7
|
Use @grid@ helper to render table with various options.
|
8
8
|
|
9
9
|
<pre>
|
10
|
-
grid(@patents, :object_class=>Patent, :columns=>%w(coverage_countries_serial patent_number_serial title grant_date status availability_serial), :actions=>nil, :paginate=>false, :render_empty_grid=>true, :object_class=>Patent)
|
10
|
+
grid(@patents, :object_class=>Patent, :columns=>%w(coverage_countries_serial patent_number_serial title grant_date status availability_serial), :actions=>nil, :paginate=>false, :skip_field_class=>true, :render_empty_grid=>true, :object_class=>Patent)
|
11
11
|
</pre>
|
12
12
|
|
13
13
|
h2. Parameters
|
@@ -20,4 +20,8 @@ h3. paginate
|
|
20
20
|
|
21
21
|
Turns on pagination (Kaminari required)
|
22
22
|
|
23
|
+
h4. skip_field_class
|
24
|
+
|
25
|
+
Turn off all field (th/td) column class name
|
26
|
+
|
23
27
|
|
data/lib/gridion/grid_helper.rb
CHANGED
@@ -94,6 +94,7 @@ module Gridion
|
|
94
94
|
table_header_wrapper_tag=options[:table_header_wrapper_tag]||"thead"
|
95
95
|
table_body_wrapper_tag=options[:table_body_wrapper_tag]||"tbody"
|
96
96
|
skip_field_class=options[:skip_field_class]||false
|
97
|
+
field_class_prefix=options[:field_class_prefix]||""
|
97
98
|
table_classes=[options[:class]].flatten.compact
|
98
99
|
safe_concat("<#{table_tag} class=\"#{klass.name.downcase} #{table_classes.join(' ')}\">")
|
99
100
|
|
@@ -104,7 +105,7 @@ module Gridion
|
|
104
105
|
(columns).each do |col|
|
105
106
|
col_label=klass.human_attribute_name(col)
|
106
107
|
col_label = sort_link(options[:q], col, col_label) if defined?(:sort_link) && options.has_key?(:q) && options[:q].present?
|
107
|
-
safe_concat("<#{table_header_tag} class=\"header_cell #{col.to_s.parameterize.underscore unless skip_field_class}\">#{col_label}</#{table_header_tag}>")
|
108
|
+
safe_concat("<#{table_header_tag} class=\"header_cell #{field_class_prefix + '_' + col.to_s.parameterize.underscore unless skip_field_class}\">#{col_label}</#{table_header_tag}>")
|
108
109
|
end
|
109
110
|
safe_concat("<#{table_header_tag} class=\"actions\">#{I18n.t("gridion.headers.actions", "Actions")}</#{table_header_tag}>") unless options[:actions].blank?
|
110
111
|
safe_concat("<#{table_header_tag} class=\"children\"></#{table_header_tag}>") if options.has_key?(:children)
|
@@ -118,6 +119,7 @@ module Gridion
|
|
118
119
|
table_row_tag=options[:table_row_tag]||"tr"
|
119
120
|
table_cell_tag=options[:table_cell_tag]||"td"
|
120
121
|
skip_field_class=options[:skip_field_class]||false
|
122
|
+
field_class_prefix=options[:field_class_prefix]||""
|
121
123
|
|
122
124
|
object_list=
|
123
125
|
if options.has_key?(:parent)
|
@@ -163,7 +165,7 @@ module Gridion
|
|
163
165
|
end
|
164
166
|
end
|
165
167
|
end
|
166
|
-
result << "<#{table_cell_tag} #{"class=\"#{col}\"" unless skip_field_class}>#{value}</#{table_cell_tag}>"
|
168
|
+
result << "<#{table_cell_tag} #{"class=\"#{field_class_prefix + '_' + col}\"" unless skip_field_class}>#{value}</#{table_cell_tag}>"
|
167
169
|
end
|
168
170
|
|
169
171
|
|
data/lib/gridion/version.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
Connecting to database specified by database.yml
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gridion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.29
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -118,7 +118,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
118
118
|
version: '0'
|
119
119
|
segments:
|
120
120
|
- 0
|
121
|
-
hash:
|
121
|
+
hash: 1529229783735647538
|
122
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
123
|
none: false
|
124
124
|
requirements:
|
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
version: '0'
|
128
128
|
segments:
|
129
129
|
- 0
|
130
|
-
hash:
|
130
|
+
hash: 1529229783735647538
|
131
131
|
requirements: []
|
132
132
|
rubyforge_project:
|
133
133
|
rubygems_version: 1.8.24
|