wice_grid 3.0.0.pre4 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.rdoc +14 -13
- data/VERSION +1 -1
- data/lib/wice_grid_controller.rb +56 -1
- data/wice_grid.gemspec +74 -72
- metadata +11 -13
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.DS_Store
|
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= WiceGrid
|
2
2
|
|
3
|
-
Version:: 3.0.0
|
3
|
+
Version:: 3.0.0
|
4
4
|
Author:: Yuri Leikind
|
5
5
|
Homepage:: http://leikind.org/pages/wicegrid
|
6
6
|
Examples online:: http://grid.leikind.org
|
@@ -10,7 +10,7 @@ Email:: "Yuri Leikind" <yuri.leikind at gmail dot com>
|
|
10
10
|
== Attention!
|
11
11
|
There are two major branches of WiceGrid.
|
12
12
|
|
13
|
-
THIS IS
|
13
|
+
THIS IS A VERSION OF THE PLUGIN FOR RAILS 3.0.
|
14
14
|
The current branch (https://github.com/leikind/wice_grid/tree/rails3) starts with version 3.0, works with Rails 3, and can only be used as a gem.
|
15
15
|
|
16
16
|
For Rails 2 WiceGrid only works as a Rails plugin. See WiceGrid version 0.6 (https://github.com/leikind/wice_grid/).
|
@@ -71,11 +71,11 @@ and run the <tt>bundle</tt> command.
|
|
71
71
|
|
72
72
|
If your application is Prototype-based , run the following generator to copy all plugin assets:
|
73
73
|
|
74
|
-
rails g wice_grid_assets_prototype
|
74
|
+
rails g wice_grid:wice_grid_assets_prototype
|
75
75
|
|
76
76
|
For jQuery:
|
77
77
|
|
78
|
-
rails g wice_grid_assets_jquery
|
78
|
+
rails g wice_grid:wice_grid_assets_jquery
|
79
79
|
|
80
80
|
This will copy images, stylesheets, configuration file <tt>config/initializers/wice_grid_config.rb</tt>, and the correct version of javascript files.
|
81
81
|
|
@@ -96,12 +96,12 @@ In the Prototype mode the plugin uses a forked[http://github.com/leikind/calenda
|
|
96
96
|
|
97
97
|
The jQuery version uses jQuery datepicker[http://jqueryui.com/demos/datepicker/]. Because this is part
|
98
98
|
of the standard jQuery codebase, it is not bundled together with the plugin, and it is the responsibility
|
99
|
-
of the programmer to include all necessary assets including localization files if the application is
|
99
|
+
of the programmer to include all necessary assets including localization files if the application is
|
100
100
|
multilingual.
|
101
101
|
|
102
102
|
It is always possible to fall back to simple dropdown lists that the standard date/datetime Rails helpers use.
|
103
103
|
|
104
|
-
JQUERY DATEPICKER IS ONLY USED FOR DATE FILTERS AT THE MOMENT. DATETIME FILTERS FALL BACK TO THE DEFAULT
|
104
|
+
JQUERY DATEPICKER IS ONLY USED FOR DATE FILTERS AT THE MOMENT. DATETIME FILTERS FALL BACK TO THE DEFAULT
|
105
105
|
RAILS DATE/DATETIME HELPERS.
|
106
106
|
|
107
107
|
|
@@ -837,7 +837,7 @@ keep ordering and filtering.
|
|
837
837
|
|
838
838
|
=== Javascript Calendar for Date and DateTime Filters.
|
839
839
|
|
840
|
-
Standard Rails Date and DateTime helpers are a set of dropdown lists, and while this is practical,
|
840
|
+
Standard Rails Date and DateTime helpers are a set of dropdown lists, and while this is practical,
|
841
841
|
displaying two Date or especially DateTime
|
842
842
|
helpers takes too much space on a page and is in general confusing.
|
843
843
|
|
@@ -848,16 +848,16 @@ In the Prototype mode the plugin uses a forked[http://github.com/leikind/calenda
|
|
848
848
|
|
849
849
|
The jQuery version uses jQuery datepicker[http://jqueryui.com/demos/datepicker/]. Because this is part
|
850
850
|
of the standard jQuery codebase, it is not bundled together with the plugin, and it is the responsibility
|
851
|
-
of the programmer to include all necessary assets including localization files if the application is
|
851
|
+
of the programmer to include all necessary assets including localization files if the application is
|
852
852
|
multilingual.
|
853
853
|
|
854
854
|
It is always possible to fall back to simple dropdown lists that the standard date/datetime Rails helpers use.
|
855
855
|
|
856
|
-
JQUERY DATEPICKER IS ONLY USED FOR DATE FILTERS AT THE MOMENT. DATETIME FILTERS FALL BACK TO THE DEFAULT
|
856
|
+
JQUERY DATEPICKER IS ONLY USED FOR DATE FILTERS AT THE MOMENT. DATETIME FILTERS FALL BACK TO THE DEFAULT
|
857
857
|
RAILS DATE/DATETIME HELPERS.
|
858
858
|
|
859
859
|
|
860
|
-
Calendar based helpers are enabled by default, but it's possible to change it in
|
860
|
+
Calendar based helpers are enabled by default, but it's possible to change it in
|
861
861
|
<tt>config/initializers/wice_grid_config.rb</tt>, variable HELPER_STYLE.
|
862
862
|
|
863
863
|
The flavor of the date filter can also be changed on per-column basis:
|
@@ -874,13 +874,13 @@ Constants +DATE_FORMAT+ and +DATETIME_FORMAT+ define the format of dates the use
|
|
874
874
|
format of the string sent in a HTTP parameter.
|
875
875
|
|
876
876
|
You can change the constants in
|
877
|
-
<tt>config/initializers/wice_grid_config.rb</tt>. Doing so, make sure that lamdbas defined
|
877
|
+
<tt>config/initializers/wice_grid_config.rb</tt>. Doing so, make sure that lamdbas defined
|
878
878
|
in +DATETIME_PARSER+ and +DATE_PARSER+ return valid DateTime and Date objects. The format
|
879
|
-
by default is <tt>%Y-%m-%d</tt> for the Date and the date part of DateTime, and <tt>Time.zone.parse</tt>
|
879
|
+
by default is <tt>%Y-%m-%d</tt> for the Date and the date part of DateTime, and <tt>Time.zone.parse</tt>
|
880
880
|
and <tt>Date.parse</tt> handle it.
|
881
881
|
Make sure it stays so.
|
882
882
|
|
883
|
-
jQuery +datepicker+ uses a different format flavor, therefore there is an additional constant
|
883
|
+
jQuery +datepicker+ uses a different format flavor, therefore there is an additional constant
|
884
884
|
+DATE_FORMAT_JQUERY+. While +DATE_FORMAT_JQUERY+ is fed to +datepicker+, +DATE_FORMAT+ is still used
|
885
885
|
for presenting initial date values in filters, so make sure that +DATE_FORMAT_JQUERY+ and +DATE_FORMAT+
|
886
886
|
result in an identical date representation.
|
@@ -1188,3 +1188,4 @@ only under certain circumstances:
|
|
1188
1188
|
|
1189
1189
|
Icons used by the plugin are courtesy of Mark James, the creator of the SILK icon set -
|
1190
1190
|
http://www.famfamfam.com/lab/icons/silk/.
|
1191
|
+
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.0
|
1
|
+
3.0.0
|
data/lib/wice_grid_controller.rb
CHANGED
@@ -117,7 +117,7 @@ module Wice
|
|
117
117
|
temp_filename.strip!
|
118
118
|
filename = (grid.csv_file_name || grid.name ) + '.csv'
|
119
119
|
grid.csv_tempfile.close
|
120
|
-
|
120
|
+
send_file_rails2 temp_filename, :filename => filename, :type => 'text/csv'
|
121
121
|
grid.csv_tempfile = nil
|
122
122
|
true
|
123
123
|
else
|
@@ -161,5 +161,60 @@ module Wice
|
|
161
161
|
{"#{options[:grid_name]}[f][#{attr_name}][]" => options[:value]}
|
162
162
|
end
|
163
163
|
|
164
|
+
private
|
165
|
+
|
166
|
+
|
167
|
+
def send_file_rails2(path, options = {}) #:doc:
|
168
|
+
raise MissingFile, "Cannot read file #{path}" unless File.file?(path) and File.readable?(path)
|
169
|
+
|
170
|
+
options[:length] ||= File.size(path)
|
171
|
+
options[:filename] ||= File.basename(path) unless options[:url_based_filename]
|
172
|
+
send_file_headers_rails2! options
|
173
|
+
|
174
|
+
@performed_render = false
|
175
|
+
|
176
|
+
logger.info "Sending file #{path}" unless logger.nil?
|
177
|
+
File.open(path, 'rb') { |file| render :status => options[:status], :text => file.read }
|
178
|
+
end
|
179
|
+
|
180
|
+
|
181
|
+
DEFAULT_SEND_FILE_OPTIONS_RAILS2 = {
|
182
|
+
:type => 'application/octet-stream'.freeze,
|
183
|
+
:disposition => 'attachment'.freeze,
|
184
|
+
:stream => true,
|
185
|
+
:buffer_size => 4096,
|
186
|
+
:x_sendfile => false
|
187
|
+
}.freeze
|
188
|
+
|
189
|
+
def send_file_headers_rails2!(options) #:doc:
|
190
|
+
|
191
|
+
options.update(DEFAULT_SEND_FILE_OPTIONS_RAILS2.merge(options))
|
192
|
+
[:length, :type, :disposition].each do |arg|
|
193
|
+
raise ArgumentError, ":#{arg} option required" if options[arg].nil?
|
194
|
+
end
|
195
|
+
|
196
|
+
disposition = options[:disposition].dup || 'attachment'
|
197
|
+
|
198
|
+
disposition <<= %(; filename="#{options[:filename]}") if options[:filename]
|
199
|
+
|
200
|
+
content_type = options[:type]
|
201
|
+
content_type = content_type.to_s.strip # fixes a problem with extra '\r' with some browsers
|
202
|
+
|
203
|
+
headers.merge!(
|
204
|
+
'Content-Length' => options[:length].to_s,
|
205
|
+
'Content-Type' => content_type,
|
206
|
+
'Content-Disposition' => disposition,
|
207
|
+
'Content-Transfer-Encoding' => 'binary'
|
208
|
+
)
|
209
|
+
|
210
|
+
# Fix a problem with IE 6.0 on opening downloaded files:
|
211
|
+
# If Cache-Control: no-cache is set (which Rails does by default),
|
212
|
+
# IE removes the file it just downloaded from its cache immediately
|
213
|
+
# after it displays the "open/save" dialog, which means that if you
|
214
|
+
# hit "open" the file isn't there anymore when the application that
|
215
|
+
# is called for handling the download is run, so let's workaround that
|
216
|
+
headers['Cache-Control'] = 'private' if headers['Cache-Control'] == 'no-cache'
|
217
|
+
end
|
218
|
+
|
164
219
|
end
|
165
220
|
end
|
data/wice_grid.gemspec
CHANGED
@@ -1,96 +1,98 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{wice_grid}
|
8
|
-
s.version = "3.0.0
|
8
|
+
s.version = "3.0.0"
|
9
9
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Yuri Leikind"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-06-28}
|
13
13
|
s.description = %q{A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters }
|
14
14
|
s.email = %q{yuri.leikind@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"README.rdoc"
|
17
17
|
]
|
18
18
|
s.files = [
|
19
|
-
"
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
19
|
+
".gitignore",
|
20
|
+
"CHANGELOG",
|
21
|
+
"MIT-LICENSE",
|
22
|
+
"README.rdoc",
|
23
|
+
"Rakefile",
|
24
|
+
"SAVED_QUERIES_HOWTO.rdoc",
|
25
|
+
"VERSION",
|
26
|
+
"lib/generators/wice_grid/templates/calendarview.css",
|
27
|
+
"lib/generators/wice_grid/templates/calendarview.js",
|
28
|
+
"lib/generators/wice_grid/templates/icons/arrow_down.gif",
|
29
|
+
"lib/generators/wice_grid/templates/icons/arrow_up.gif",
|
30
|
+
"lib/generators/wice_grid/templates/icons/calendar_view_month.png",
|
31
|
+
"lib/generators/wice_grid/templates/icons/delete.png",
|
32
|
+
"lib/generators/wice_grid/templates/icons/expand.png",
|
33
|
+
"lib/generators/wice_grid/templates/icons/page_white_excel.png",
|
34
|
+
"lib/generators/wice_grid/templates/icons/page_white_find.png",
|
35
|
+
"lib/generators/wice_grid/templates/icons/table.png",
|
36
|
+
"lib/generators/wice_grid/templates/icons/table_refresh.png",
|
37
|
+
"lib/generators/wice_grid/templates/icons/tick_all.png",
|
38
|
+
"lib/generators/wice_grid/templates/icons/untick_all.png",
|
39
|
+
"lib/generators/wice_grid/templates/wice_grid.css",
|
40
|
+
"lib/generators/wice_grid/templates/wice_grid.yml",
|
41
|
+
"lib/generators/wice_grid/templates/wice_grid_config.rb",
|
42
|
+
"lib/generators/wice_grid/templates/wice_grid_jquery.js",
|
43
|
+
"lib/generators/wice_grid/templates/wice_grid_prototype.js",
|
44
|
+
"lib/generators/wice_grid/wice_grid_assets_jquery_generator.rb",
|
45
|
+
"lib/generators/wice_grid/wice_grid_assets_prototype_generator.rb",
|
46
|
+
"lib/grid_output_buffer.rb",
|
47
|
+
"lib/grid_renderer.rb",
|
48
|
+
"lib/helpers/js_calendar_helpers.rb",
|
49
|
+
"lib/helpers/wice_grid_misc_view_helpers.rb",
|
50
|
+
"lib/helpers/wice_grid_serialized_queries_view_helpers.rb",
|
51
|
+
"lib/helpers/wice_grid_view_helpers.rb",
|
52
|
+
"lib/js_adaptors/jquery_adaptor.rb",
|
53
|
+
"lib/js_adaptors/js_adaptor.rb",
|
54
|
+
"lib/js_adaptors/prototype_adaptor.rb",
|
55
|
+
"lib/table_column_matrix.rb",
|
56
|
+
"lib/tasks/wice_grid_tasks.rake",
|
57
|
+
"lib/view_columns.rb",
|
58
|
+
"lib/views/create.rjs",
|
59
|
+
"lib/views/create_jq.rjs",
|
60
|
+
"lib/views/delete.rjs",
|
61
|
+
"lib/views/delete_jq.rjs",
|
62
|
+
"lib/wice_grid.rb",
|
63
|
+
"lib/wice_grid_controller.rb",
|
64
|
+
"lib/wice_grid_core_ext.rb",
|
65
|
+
"lib/wice_grid_misc.rb",
|
66
|
+
"lib/wice_grid_serialized_queries_controller.rb",
|
67
|
+
"lib/wice_grid_serialized_query.rb",
|
68
|
+
"lib/wice_grid_spreadsheet.rb",
|
69
|
+
"test/.gitignore",
|
70
|
+
"test/database.yml",
|
71
|
+
"test/schema.rb",
|
72
|
+
"test/test_helper.rb",
|
73
|
+
"test/views/projects_and_people_grid.html.erb",
|
74
|
+
"test/views/projects_and_people_grid_invalid.html.erb",
|
75
|
+
"test/views/simple_projects_grid.html.erb",
|
76
|
+
"test/wice_grid_core_ext_test.rb",
|
77
|
+
"test/wice_grid_functional_test.rb",
|
78
|
+
"test/wice_grid_misc_test.rb",
|
79
|
+
"test/wice_grid_test.rb",
|
80
|
+
"test/wice_grid_view_helper_test.rb",
|
81
|
+
"wice_grid.gemspec"
|
81
82
|
]
|
82
83
|
s.homepage = %q{http://github.com/lekind/wice_grid}
|
84
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
83
85
|
s.require_paths = ["lib"]
|
84
86
|
s.rubygems_version = %q{1.3.7}
|
85
87
|
s.summary = %q{Rails Grid Plugin}
|
86
88
|
s.test_files = [
|
87
89
|
"test/schema.rb",
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
90
|
+
"test/test_helper.rb",
|
91
|
+
"test/wice_grid_core_ext_test.rb",
|
92
|
+
"test/wice_grid_functional_test.rb",
|
93
|
+
"test/wice_grid_misc_test.rb",
|
94
|
+
"test/wice_grid_test.rb",
|
95
|
+
"test/wice_grid_view_helper_test.rb"
|
94
96
|
]
|
95
97
|
|
96
98
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wice_grid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 7
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
9
|
- 0
|
10
|
-
|
11
|
-
version: 3.0.0.pre4
|
10
|
+
version: 3.0.0
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- Yuri Leikind
|
@@ -16,7 +15,7 @@ autorequire:
|
|
16
15
|
bindir: bin
|
17
16
|
cert_chain: []
|
18
17
|
|
19
|
-
date: 2011-
|
18
|
+
date: 2011-06-28 00:00:00 +02:00
|
20
19
|
default_executable:
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|
@@ -44,6 +43,7 @@ extensions: []
|
|
44
43
|
extra_rdoc_files:
|
45
44
|
- README.rdoc
|
46
45
|
files:
|
46
|
+
- .gitignore
|
47
47
|
- CHANGELOG
|
48
48
|
- MIT-LICENSE
|
49
49
|
- README.rdoc
|
@@ -111,8 +111,8 @@ homepage: http://github.com/lekind/wice_grid
|
|
111
111
|
licenses: []
|
112
112
|
|
113
113
|
post_install_message:
|
114
|
-
rdoc_options:
|
115
|
-
|
114
|
+
rdoc_options:
|
115
|
+
- --charset=UTF-8
|
116
116
|
require_paths:
|
117
117
|
- lib
|
118
118
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -127,14 +127,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
127
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
128
|
none: false
|
129
129
|
requirements:
|
130
|
-
- - "
|
130
|
+
- - ">="
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
hash:
|
132
|
+
hash: 3
|
133
133
|
segments:
|
134
|
-
-
|
135
|
-
|
136
|
-
- 1
|
137
|
-
version: 1.3.1
|
134
|
+
- 0
|
135
|
+
version: "0"
|
138
136
|
requirements: []
|
139
137
|
|
140
138
|
rubyforge_project:
|