usefull_table 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA512:
3
+ data.tar.gz: 3276384c51f0a33e1ecf5b54fc9a0ef703a42467491db557bc5912016d8817817f5b4bb7741c042e0d38c7bd54c3bc3d164af30d3995ec7b0f724782af3082a6
4
+ metadata.gz: 5a5ca6e936cfa419d2575078a68c3025cbc47eda83905d5622e2243bef1741bf3e949db2f613c67099a40213fcea7b195d2acf03d62dac0518d166a2807e455b
5
+ SHA1:
6
+ data.tar.gz: 8922127ac80f0b21bea4c79f2fd97a5f84059098
7
+ metadata.gz: 3d87304a4132628a005132cae449818301e03cda
@@ -11,6 +11,12 @@ BugToFix
11
11
  - Export: currency column must not be renderered as string
12
12
  - Export: unable to find local view if namespace are used. If I call export from /production/orders/index.html
13
13
  contrllers.paths has only /orders/index.xlsx.maker
14
+ - Rails 3.0.20 introduce problem in exporting excel files (json sending symbols)
15
+
16
+ 1.0.9 (October 15, 2013)
17
+ - Fixed metasearch and willpaginate dependency
18
+ - Added usefull_table.en.yml, to make gem working out of the box for en users!
19
+ - Fixed Excel Export problem with Rails 3.0.20 due to xml decode symbols
14
20
 
15
21
  1.0.8 (September 5, 2013)
16
22
  - Fixed Header Link localization, now localize association correctly
data/Gemfile CHANGED
@@ -1,14 +1,15 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem "rails", "~>3.0.14"
3
+ gem "rails", "~>3.0.20"
4
+ gem "acts_as_monitor"
5
+ gem "acts_as_xls"
6
+ gem 'nokogiri', "1.5.5"
4
7
 
5
8
  group :development, :test do
6
9
  #gem "acts_as_monitor", :path => "/home/www/gems/acts_as_monitor"
7
10
  #gem "acts_as_xls", :path => "/home/www/gems/acts_as_xls"
8
11
  gem "acts_as_monitor"
9
12
  gem "acts_as_xls"
10
- gem "meta_search"
11
- gem "will_paginate"
12
13
  gem "ruby-debug"
13
14
  gem "capybara", ">= 0.4.0"
14
15
  end
@@ -3,7 +3,6 @@ module UsefullTable
3
3
 
4
4
  def create
5
5
  usefull_table = HashWithIndifferentAccess.new(ActiveSupport::JSON.decode(params[:usefull_table]))
6
- #Rails::logger.info("MonitorsController back=#{usefull_table[:paths].inspect}")
7
6
  if usefull_table[:class_name].present?
8
7
  if usefull_table[:search].present?
9
8
  @object = usefull_table[:class_name].constantize.search(usefull_table[:search]).relation
@@ -205,11 +205,14 @@ module UsefullTableHelper
205
205
  @params[:search] = search.search_attributes unless search.blank?
206
206
  @params[:class_name] = object.first.class.name
207
207
  @params[:params] = builder.to_param
208
- @params[:paths] = view_paths.map {|path| "#{path.to_path}/#{controller_name}/#{action_name}.xlsx.maker"}
208
+ @params[:paths] = view_paths.map {|path| "#{path.to_path}/#{controller_name}/#{action_name}.xlsx.maker"}
209
209
  #Rails::logger.info("table_for#excel_tag @path=#{self.controller_name}, action=#{action_name}, path=#{view_paths.first.to_path}\n\n")
210
210
  content_tag(:div, :class => options[:class]) do
211
211
  form_tag( options[:url] , :method => :post) do
212
- hidden_field_tag("usefull_table", @params.to_json) +
212
+ hidden_field_tag("usefull_table", @params.to_json) +
213
+ #hidden_field_tag("usefull_table", Marshal.dump(@params)) +
214
+ #hidden_field_tag("usefull_table", @params.to_yaml) +
215
+ #hidden_field_tag("usefull_table", 'Ciccio') +
213
216
  submit_tag(I18n.t(:submit_excel, :scope => :usefull_table))
214
217
  end
215
218
  end
@@ -0,0 +1,30 @@
1
+ en:
2
+ usefull_table:
3
+ submit_excel: Excel
4
+ header_error: Error
5
+ body_error: Error
6
+ confirm: "Are you sure?"
7
+
8
+ #Localize monitor flag when exporting to_a (xlsx, xls, pdf)
9
+ monitor:
10
+ green: Ok
11
+ yellow: Problem
12
+ red: Error
13
+ title: "Status"
14
+
15
+ icons:
16
+ show: "usefull_table_show.png"
17
+ edit: "usefull_table_edit.png"
18
+ destroy: "usefull_table_destroy.png"
19
+ download: "usefull_table_download.png"
20
+ ok: "usefull_table_true.png"
21
+ ko: "usefull_table_false.png"
22
+ time:
23
+ formats:
24
+ usefull_table_time: "%H:%M"
25
+ usefull_table_datetime: "%m/%d/%Y %H:%M"
26
+ usefull_table_date: "%m/%d/%Y"
27
+
28
+ date:
29
+ formats:
30
+ usefull_table_date: "%m/%d/%Y"
@@ -5,8 +5,8 @@ module UsefullTable
5
5
  end
6
6
  end
7
7
 
8
- #require "meta_search"
9
- #require "will_paginate"
8
+ require "meta_search"
9
+ require "will_paginate"
10
10
  #require "acts_as_monitor"
11
11
  #require "acts_as_xls"
12
12
  require "usefull_table/engine"
@@ -40,9 +40,9 @@ module UsefullTable
40
40
  @template = template
41
41
 
42
42
  if options[:params]
43
- #debugger
43
+ #debugger
44
44
  @data = _decode_hash(options[:params][:data]).map{|e| e.with_indifferent_access } if options[:params][:data].present?
45
- opt = _decode_hash(options[:params][:options]).with_indifferent_access
45
+ opt = _decode_hash(options[:params][:options]).with_indifferent_access
46
46
  else
47
47
  @data ||= []
48
48
  end
@@ -52,7 +52,7 @@ module UsefullTable
52
52
  @excel = []
53
53
  yield(self) if block
54
54
 
55
- #Rendering order is importanto so body and header are pre-rendered by initilizer and returned at will.
55
+ #Rendering order is important so body and header are pre-rendered by initilizer and returned at will.
56
56
  @rendered_header = _render_header
57
57
  @rendered_body = _render_body
58
58
  end
@@ -235,7 +235,6 @@ module UsefullTable
235
235
  @params = {}
236
236
  @params[:data] = _encode_hash(_sanitize_data(@data))
237
237
  @params[:options] = _encode_hash(@options)
238
-
239
238
  @params
240
239
  end
241
240
 
@@ -259,11 +258,11 @@ module UsefullTable
259
258
  end
260
259
 
261
260
  def _encode_hash(a)
262
- a.to_xml
261
+ Marshal.dump(a)
263
262
  end
264
263
 
265
264
  def _decode_hash(a)
266
- ActiveResource::Formats::XmlFormat.decode(a)
265
+ Marshal.load(a)
267
266
  end
268
267
 
269
268
  #set default values for options
@@ -338,7 +337,7 @@ module UsefullTable
338
337
  #Render column Header
339
338
  def header(attribute)
340
339
  out = ""
341
- out_html = ""
340
+ out_html = ""
342
341
  case attribute[:header_type]
343
342
  when :sort then
344
343
  value = nestize(attribute)
@@ -1,3 +1,3 @@
1
1
  module UsefullTable
2
- VERSION = "1.0.8"
2
+ VERSION = "1.0.9"
3
3
  end
metadata CHANGED
@@ -1,13 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usefull_table
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
5
- prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 8
10
- version: 1.0.8
4
+ version: 1.0.9
11
5
  platform: ruby
12
6
  authors:
13
7
  - Andrea Bignozzi
@@ -15,54 +9,55 @@ autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
11
 
18
- date: 2013-10-04 00:00:00 Z
12
+ date: 2013-10-22 00:00:00 Z
19
13
  dependencies:
20
14
  - !ruby/object:Gem::Dependency
15
+ type: :runtime
21
16
  version_requirements: &id001 !ruby/object:Gem::Requirement
22
- none: false
23
17
  requirements:
24
18
  - - ~>
25
19
  - !ruby/object:Gem::Version
26
- hash: 27
27
- segments:
28
- - 3
29
- - 0
30
- - 14
31
20
  version: 3.0.14
32
- prerelease: false
33
- type: :runtime
34
21
  name: rails
22
+ prerelease: false
35
23
  requirement: *id001
36
24
  - !ruby/object:Gem::Dependency
25
+ type: :runtime
37
26
  version_requirements: &id002 !ruby/object:Gem::Requirement
38
- none: false
39
27
  requirements:
40
- - - "="
28
+ - - <
41
29
  - !ruby/object:Gem::Version
42
- hash: 23
43
- segments:
44
- - 1
45
- - 3
46
- - 6
47
30
  version: 1.3.6
48
- prerelease: false
49
- type: :runtime
50
31
  name: axlsx
32
+ prerelease: false
51
33
  requirement: *id002
52
34
  - !ruby/object:Gem::Dependency
35
+ type: :runtime
53
36
  version_requirements: &id003 !ruby/object:Gem::Requirement
54
- none: false
55
37
  requirements:
56
- - - ">="
38
+ - &id004
39
+ - ">="
57
40
  - !ruby/object:Gem::Version
58
- hash: 3
59
- segments:
60
- - 0
61
41
  version: "0"
62
- prerelease: false
63
- type: :runtime
64
42
  name: acts_as_xls
43
+ prerelease: false
65
44
  requirement: *id003
45
+ - !ruby/object:Gem::Dependency
46
+ type: :runtime
47
+ version_requirements: &id005 !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - *id004
50
+ name: meta_search
51
+ prerelease: false
52
+ requirement: *id005
53
+ - !ruby/object:Gem::Dependency
54
+ type: :runtime
55
+ version_requirements: &id006 !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - *id004
58
+ name: will_paginate
59
+ prerelease: false
60
+ requirement: *id006
66
61
  description: Table Helper with Excel export, inline editing and monitoring funxtions
67
62
  email:
68
63
  - skylord73@gmail.com
@@ -77,6 +72,7 @@ files:
77
72
  - app/helpers/usefull_table_helper.rb
78
73
  - app/views/usefull_table/table/create.xlsx.maker
79
74
  - lib/generators/usefull_table/install/install_generator.rb
75
+ - lib/generators/usefull_table/install/templates/config/locales/usefull_table.en.yml
80
76
  - lib/generators/usefull_table/install/templates/config/locales/usefull_table.it.yml
81
77
  - lib/generators/usefull_table/install/templates/public/images/usefull_table_destroy.png
82
78
  - lib/generators/usefull_table/install/templates/public/images/usefull_table_download.png
@@ -103,35 +99,25 @@ files:
103
99
  homepage:
104
100
  licenses: []
105
101
 
102
+ metadata: {}
103
+
106
104
  post_install_message:
107
105
  rdoc_options: []
108
106
 
109
107
  require_paths:
110
108
  - lib
111
109
  required_ruby_version: !ruby/object:Gem::Requirement
112
- none: false
113
110
  requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- hash: 3
117
- segments:
118
- - 0
119
- version: "0"
111
+ - *id004
120
112
  required_rubygems_version: !ruby/object:Gem::Requirement
121
- none: false
122
113
  requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- hash: 3
126
- segments:
127
- - 0
128
- version: "0"
114
+ - *id004
129
115
  requirements: []
130
116
 
131
117
  rubyforge_project:
132
- rubygems_version: 1.8.24
118
+ rubygems_version: 2.0.10
133
119
  signing_key:
134
- specification_version: 3
120
+ specification_version: 4
135
121
  summary: Table Helper with Excel export, inline editing and monitoring funxtions
136
122
  test_files: []
137
123