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 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.pre3
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 AN ALPHA VERSION OF THE PLUGIN FOR RAILS 3.0.
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.pre4
1
+ 3.0.0
@@ -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
- send_file temp_filename, :filename => filename, :type => 'text/csv'
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 'rake gemspec'
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.pre4"
8
+ s.version = "3.0.0"
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
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-04-21}
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
- "CHANGELOG",
20
- "MIT-LICENSE",
21
- "README.rdoc",
22
- "Rakefile",
23
- "SAVED_QUERIES_HOWTO.rdoc",
24
- "VERSION",
25
- "lib/generators/wice_grid/templates/calendarview.css",
26
- "lib/generators/wice_grid/templates/calendarview.js",
27
- "lib/generators/wice_grid/templates/icons/arrow_down.gif",
28
- "lib/generators/wice_grid/templates/icons/arrow_up.gif",
29
- "lib/generators/wice_grid/templates/icons/calendar_view_month.png",
30
- "lib/generators/wice_grid/templates/icons/delete.png",
31
- "lib/generators/wice_grid/templates/icons/expand.png",
32
- "lib/generators/wice_grid/templates/icons/page_white_excel.png",
33
- "lib/generators/wice_grid/templates/icons/page_white_find.png",
34
- "lib/generators/wice_grid/templates/icons/table.png",
35
- "lib/generators/wice_grid/templates/icons/table_refresh.png",
36
- "lib/generators/wice_grid/templates/icons/tick_all.png",
37
- "lib/generators/wice_grid/templates/icons/untick_all.png",
38
- "lib/generators/wice_grid/templates/wice_grid.css",
39
- "lib/generators/wice_grid/templates/wice_grid.yml",
40
- "lib/generators/wice_grid/templates/wice_grid_config.rb",
41
- "lib/generators/wice_grid/templates/wice_grid_jquery.js",
42
- "lib/generators/wice_grid/templates/wice_grid_prototype.js",
43
- "lib/generators/wice_grid/wice_grid_assets_jquery_generator.rb",
44
- "lib/generators/wice_grid/wice_grid_assets_prototype_generator.rb",
45
- "lib/grid_output_buffer.rb",
46
- "lib/grid_renderer.rb",
47
- "lib/helpers/js_calendar_helpers.rb",
48
- "lib/helpers/wice_grid_misc_view_helpers.rb",
49
- "lib/helpers/wice_grid_serialized_queries_view_helpers.rb",
50
- "lib/helpers/wice_grid_view_helpers.rb",
51
- "lib/js_adaptors/jquery_adaptor.rb",
52
- "lib/js_adaptors/js_adaptor.rb",
53
- "lib/js_adaptors/prototype_adaptor.rb",
54
- "lib/table_column_matrix.rb",
55
- "lib/tasks/wice_grid_tasks.rake",
56
- "lib/view_columns.rb",
57
- "lib/views/create.rjs",
58
- "lib/views/create_jq.rjs",
59
- "lib/views/delete.rjs",
60
- "lib/views/delete_jq.rjs",
61
- "lib/wice_grid.rb",
62
- "lib/wice_grid_controller.rb",
63
- "lib/wice_grid_core_ext.rb",
64
- "lib/wice_grid_misc.rb",
65
- "lib/wice_grid_serialized_queries_controller.rb",
66
- "lib/wice_grid_serialized_query.rb",
67
- "lib/wice_grid_spreadsheet.rb",
68
- "test/.gitignore",
69
- "test/database.yml",
70
- "test/schema.rb",
71
- "test/test_helper.rb",
72
- "test/views/projects_and_people_grid.html.erb",
73
- "test/views/projects_and_people_grid_invalid.html.erb",
74
- "test/views/simple_projects_grid.html.erb",
75
- "test/wice_grid_core_ext_test.rb",
76
- "test/wice_grid_functional_test.rb",
77
- "test/wice_grid_misc_test.rb",
78
- "test/wice_grid_test.rb",
79
- "test/wice_grid_view_helper_test.rb",
80
- "wice_grid.gemspec"
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
- "test/test_helper.rb",
89
- "test/wice_grid_core_ext_test.rb",
90
- "test/wice_grid_functional_test.rb",
91
- "test/wice_grid_misc_test.rb",
92
- "test/wice_grid_test.rb",
93
- "test/wice_grid_view_helper_test.rb"
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: -1876988209
5
- prerelease: true
4
+ hash: 7
5
+ prerelease: false
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
9
  - 0
10
- - pre4
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-04-21 00:00:00 +02:00
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: 25
132
+ hash: 3
133
133
  segments:
134
- - 1
135
- - 3
136
- - 1
137
- version: 1.3.1
134
+ - 0
135
+ version: "0"
138
136
  requirements: []
139
137
 
140
138
  rubyforge_project: