tabulatr2 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +4 -0
  5. data/Changelog.textile +124 -0
  6. data/Gemfile +21 -0
  7. data/LICENSE +23 -0
  8. data/README.md +242 -0
  9. data/Rakefile +11 -0
  10. data/app/assets/images/tabulatr/buttons_lite_background.png +0 -0
  11. data/app/assets/images/tabulatr/pager_arrow_left.gif +0 -0
  12. data/app/assets/images/tabulatr/pager_arrow_left_off.gif +0 -0
  13. data/app/assets/images/tabulatr/pager_arrow_right.gif +0 -0
  14. data/app/assets/images/tabulatr/pager_arrow_right_off.gif +0 -0
  15. data/app/assets/images/tabulatr/sort_arrow_down.gif +0 -0
  16. data/app/assets/images/tabulatr/sort_arrow_down_off.gif +0 -0
  17. data/app/assets/images/tabulatr/sort_arrow_up.gif +0 -0
  18. data/app/assets/images/tabulatr/sort_arrow_up_off.gif +0 -0
  19. data/app/assets/javascripts/tabulatr/application.js +452 -0
  20. data/app/assets/javascripts/tabulatr/jquery.inview.min.js +3 -0
  21. data/app/assets/javascripts/tabulatr.js +1 -0
  22. data/app/assets/stylesheets/tabulatr/application.css +40 -0
  23. data/app/assets/stylesheets/tabulatr.css +4 -0
  24. data/init.rb +1 -0
  25. data/lib/generators/tabulatr/install_generator.rb +44 -0
  26. data/lib/generators/tabulatr/templates/tabulatr.rb +5 -0
  27. data/lib/generators/tabulatr/templates/tabulatr.yml +14 -0
  28. data/lib/initializers/action_controller.rb +13 -0
  29. data/lib/initializers/action_view.rb +31 -0
  30. data/lib/initializers/active_record.rb +48 -0
  31. data/lib/initializers/mark_as_localizable.rb +43 -0
  32. data/lib/tabulatr/engine.rb +3 -0
  33. data/lib/tabulatr/tabulatr/adapter/active_record.rb +84 -0
  34. data/lib/tabulatr/tabulatr/adapter.rb +55 -0
  35. data/lib/tabulatr/tabulatr/batch_actions.rb +51 -0
  36. data/lib/tabulatr/tabulatr/data_cell.rb +132 -0
  37. data/lib/tabulatr/tabulatr/dummy_record.rb +40 -0
  38. data/lib/tabulatr/tabulatr/empty_cell.rb +44 -0
  39. data/lib/tabulatr/tabulatr/filter_cell.rb +145 -0
  40. data/lib/tabulatr/tabulatr/filter_icon.rb +6 -0
  41. data/lib/tabulatr/tabulatr/finder/find_for_table.rb +187 -0
  42. data/lib/tabulatr/tabulatr/finder.rb +64 -0
  43. data/lib/tabulatr/tabulatr/formattr.rb +55 -0
  44. data/lib/tabulatr/tabulatr/header_cell.rb +146 -0
  45. data/lib/tabulatr/tabulatr/json_builder.rb +57 -0
  46. data/lib/tabulatr/tabulatr/paginator.rb +76 -0
  47. data/lib/tabulatr/tabulatr/row_builder.rb +128 -0
  48. data/lib/tabulatr/tabulatr/security.rb +21 -0
  49. data/lib/tabulatr/tabulatr/settings.rb +158 -0
  50. data/lib/tabulatr/tabulatr.rb +343 -0
  51. data/lib/tabulatr/version.rb +3 -0
  52. data/lib/tabulatr.rb +34 -0
  53. data/spec/dummy/.gitignore +18 -0
  54. data/spec/dummy/README.rdoc +28 -0
  55. data/spec/dummy/Rakefile +6 -0
  56. data/spec/dummy/app/assets/images/.keep +0 -0
  57. data/spec/dummy/app/assets/javascripts/application.js +16 -0
  58. data/spec/dummy/app/assets/stylesheets/application.css.scss +15 -0
  59. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  60. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  61. data/spec/dummy/app/controllers/products_controller.rb +24 -0
  62. data/spec/dummy/app/controllers/tags_controller.rb +5 -0
  63. data/spec/dummy/app/controllers/vendors_controller.rb +5 -0
  64. data/spec/dummy/app/helpers/application_helper.rb +9 -0
  65. data/spec/dummy/app/mailers/.keep +0 -0
  66. data/spec/dummy/app/models/.keep +0 -0
  67. data/spec/dummy/app/models/concerns/.keep +0 -0
  68. data/spec/dummy/app/models/product.rb +5 -0
  69. data/spec/dummy/app/models/tag.rb +3 -0
  70. data/spec/dummy/app/models/vendor.rb +2 -0
  71. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  72. data/spec/dummy/app/views/products/count_tags.html.erb +9 -0
  73. data/spec/dummy/app/views/products/one_item_per_page.html.erb +9 -0
  74. data/spec/dummy/app/views/products/simple_index.html.erb +9 -0
  75. data/spec/dummy/app/views/products/stupid_array.html.erb +20 -0
  76. data/spec/dummy/bin/bundle +3 -0
  77. data/spec/dummy/bin/rails +4 -0
  78. data/spec/dummy/bin/rake +4 -0
  79. data/spec/dummy/config/application.rb +23 -0
  80. data/spec/dummy/config/boot.rb +5 -0
  81. data/spec/dummy/config/database.yml +25 -0
  82. data/spec/dummy/config/environment.rb +5 -0
  83. data/spec/dummy/config/environments/development.rb +29 -0
  84. data/spec/dummy/config/environments/production.rb +80 -0
  85. data/spec/dummy/config/environments/test.rb +36 -0
  86. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  87. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  88. data/spec/dummy/config/initializers/inflections.rb +16 -0
  89. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  90. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  91. data/spec/dummy/config/initializers/session_store.rb +3 -0
  92. data/spec/dummy/config/initializers/tabulatr.rb +5 -0
  93. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  94. data/spec/dummy/config/locales/en.yml +23 -0
  95. data/spec/dummy/config/locales/tabulatr.yml +14 -0
  96. data/spec/dummy/config/routes.rb +13 -0
  97. data/spec/dummy/config.ru +4 -0
  98. data/spec/dummy/db/migrate/20130730132101_create_vendors.rb +12 -0
  99. data/spec/dummy/db/migrate/20130730132321_create_products.rb +12 -0
  100. data/spec/dummy/db/migrate/20130730132348_create_tags.rb +14 -0
  101. data/spec/dummy/db/schema.rb +47 -0
  102. data/spec/dummy/lib/assets/.keep +0 -0
  103. data/spec/dummy/log/.keep +0 -0
  104. data/spec/dummy/public/404.html +58 -0
  105. data/spec/dummy/public/422.html +58 -0
  106. data/spec/dummy/public/500.html +57 -0
  107. data/spec/dummy/public/favicon.ico +0 -0
  108. data/spec/features/tabulatrs_spec.rb +227 -0
  109. data/spec/lib/tabulatr/tabulatr/finder/find_for_table_spec.rb +187 -0
  110. data/spec/spec_helper.rb +45 -0
  111. data/tabulatr.gemspec +29 -0
  112. metadata +258 -0
@@ -0,0 +1,45 @@
1
+ ENV["RAILS_ENV"] ||= 'test'
2
+
3
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
4
+ ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
5
+
6
+ require 'rspec/rails'
7
+ require 'capybara/rspec'
8
+ require 'capybara/poltergeist'
9
+
10
+ Capybara.javascript_driver = :poltergeist
11
+
12
+ Capybara.register_driver :poltergeist do |app|
13
+ Capybara::Poltergeist::Driver.new(app, {js_errors: true})
14
+ end
15
+
16
+ # Requires supporting ruby files with custom matchers and macros, etc,
17
+ # in spec/support/ and its subdirectories.
18
+ Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
19
+
20
+
21
+ RSpec.configure do |config|
22
+ config.use_transactional_fixtures = false
23
+
24
+ config.before(:suite) do
25
+ DatabaseCleaner.clean_with(:truncation)
26
+ end
27
+
28
+ config.before(:each) do
29
+ DatabaseCleaner.strategy = :transaction
30
+ end
31
+
32
+ config.before(:each, :js => true) do
33
+ DatabaseCleaner.strategy = :truncation
34
+ end
35
+
36
+ config.before(:each) do
37
+ DatabaseCleaner.start
38
+ end
39
+
40
+ config.after(:each) do
41
+ DatabaseCleaner.clean
42
+ end
43
+
44
+
45
+ end
data/tabulatr.gemspec ADDED
@@ -0,0 +1,29 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "tabulatr/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "tabulatr2"
7
+ s.version = Tabulatr::VERSION.dup
8
+ s.platform = Gem::Platform::RUBY
9
+ s.summary = "A tight DSL to build tables of ActiveRecord "+
10
+ "models with sorting, pagination, finding/filtering, "+
11
+ "selecting and batch actions."
12
+ s.email = "info@provideal.net"
13
+ s.homepage = "http://github.com/provideal/tabulatr2"
14
+ s.description = "A tight DSL to build tables of ActiveRecord "+
15
+ "models with sorting, pagination, finding/filtering, "+
16
+ "selecting and batch actions. " +
17
+ "Tries to do for tables what formtastic and simple_form did "+
18
+ "for forms."
19
+ s.authors = ['Peter Horn', 'René Sprotte', 'Florian Thomas']
20
+
21
+ s.files = `git ls-files`.split("\n")
22
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
23
+ s.rdoc_options = ['--charset=UTF-8']
24
+
25
+
26
+ s.add_runtime_dependency('rails', '>= 4.0.0')
27
+ s.add_dependency('whiny_hash', '>= 0.0.2')
28
+ s.add_runtime_dependency('activerecord_outer_joins', '~> 0.0.1')
29
+ end
metadata ADDED
@@ -0,0 +1,258 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tabulatr2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.6.0
5
+ platform: ruby
6
+ authors:
7
+ - Peter Horn
8
+ - René Sprotte
9
+ - Florian Thomas
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2013-10-23 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rails
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 4.0.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - '>='
27
+ - !ruby/object:Gem::Version
28
+ version: 4.0.0
29
+ - !ruby/object:Gem::Dependency
30
+ name: whiny_hash
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - '>='
34
+ - !ruby/object:Gem::Version
35
+ version: 0.0.2
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - '>='
41
+ - !ruby/object:Gem::Version
42
+ version: 0.0.2
43
+ - !ruby/object:Gem::Dependency
44
+ name: activerecord_outer_joins
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ~>
48
+ - !ruby/object:Gem::Version
49
+ version: 0.0.1
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ~>
55
+ - !ruby/object:Gem::Version
56
+ version: 0.0.1
57
+ description: A tight DSL to build tables of ActiveRecord models with sorting, pagination,
58
+ finding/filtering, selecting and batch actions. Tries to do for tables what formtastic
59
+ and simple_form did for forms.
60
+ email: info@provideal.net
61
+ executables: []
62
+ extensions: []
63
+ extra_rdoc_files: []
64
+ files:
65
+ - .gitignore
66
+ - .rspec
67
+ - .travis.yml
68
+ - Changelog.textile
69
+ - Gemfile
70
+ - LICENSE
71
+ - README.md
72
+ - Rakefile
73
+ - app/assets/images/tabulatr/buttons_lite_background.png
74
+ - app/assets/images/tabulatr/pager_arrow_left.gif
75
+ - app/assets/images/tabulatr/pager_arrow_left_off.gif
76
+ - app/assets/images/tabulatr/pager_arrow_right.gif
77
+ - app/assets/images/tabulatr/pager_arrow_right_off.gif
78
+ - app/assets/images/tabulatr/sort_arrow_down.gif
79
+ - app/assets/images/tabulatr/sort_arrow_down_off.gif
80
+ - app/assets/images/tabulatr/sort_arrow_up.gif
81
+ - app/assets/images/tabulatr/sort_arrow_up_off.gif
82
+ - app/assets/javascripts/tabulatr.js
83
+ - app/assets/javascripts/tabulatr/application.js
84
+ - app/assets/javascripts/tabulatr/jquery.inview.min.js
85
+ - app/assets/stylesheets/tabulatr.css
86
+ - app/assets/stylesheets/tabulatr/application.css
87
+ - init.rb
88
+ - lib/generators/tabulatr/install_generator.rb
89
+ - lib/generators/tabulatr/templates/tabulatr.rb
90
+ - lib/generators/tabulatr/templates/tabulatr.yml
91
+ - lib/initializers/action_controller.rb
92
+ - lib/initializers/action_view.rb
93
+ - lib/initializers/active_record.rb
94
+ - lib/initializers/mark_as_localizable.rb
95
+ - lib/tabulatr.rb
96
+ - lib/tabulatr/engine.rb
97
+ - lib/tabulatr/tabulatr.rb
98
+ - lib/tabulatr/tabulatr/adapter.rb
99
+ - lib/tabulatr/tabulatr/adapter/active_record.rb
100
+ - lib/tabulatr/tabulatr/batch_actions.rb
101
+ - lib/tabulatr/tabulatr/data_cell.rb
102
+ - lib/tabulatr/tabulatr/dummy_record.rb
103
+ - lib/tabulatr/tabulatr/empty_cell.rb
104
+ - lib/tabulatr/tabulatr/filter_cell.rb
105
+ - lib/tabulatr/tabulatr/filter_icon.rb
106
+ - lib/tabulatr/tabulatr/finder.rb
107
+ - lib/tabulatr/tabulatr/finder/find_for_table.rb
108
+ - lib/tabulatr/tabulatr/formattr.rb
109
+ - lib/tabulatr/tabulatr/header_cell.rb
110
+ - lib/tabulatr/tabulatr/json_builder.rb
111
+ - lib/tabulatr/tabulatr/paginator.rb
112
+ - lib/tabulatr/tabulatr/row_builder.rb
113
+ - lib/tabulatr/tabulatr/security.rb
114
+ - lib/tabulatr/tabulatr/settings.rb
115
+ - lib/tabulatr/version.rb
116
+ - spec/dummy/.gitignore
117
+ - spec/dummy/README.rdoc
118
+ - spec/dummy/Rakefile
119
+ - spec/dummy/app/assets/images/.keep
120
+ - spec/dummy/app/assets/javascripts/application.js
121
+ - spec/dummy/app/assets/stylesheets/application.css.scss
122
+ - spec/dummy/app/controllers/application_controller.rb
123
+ - spec/dummy/app/controllers/concerns/.keep
124
+ - spec/dummy/app/controllers/products_controller.rb
125
+ - spec/dummy/app/controllers/tags_controller.rb
126
+ - spec/dummy/app/controllers/vendors_controller.rb
127
+ - spec/dummy/app/helpers/application_helper.rb
128
+ - spec/dummy/app/mailers/.keep
129
+ - spec/dummy/app/models/.keep
130
+ - spec/dummy/app/models/concerns/.keep
131
+ - spec/dummy/app/models/product.rb
132
+ - spec/dummy/app/models/tag.rb
133
+ - spec/dummy/app/models/vendor.rb
134
+ - spec/dummy/app/views/layouts/application.html.erb
135
+ - spec/dummy/app/views/products/count_tags.html.erb
136
+ - spec/dummy/app/views/products/one_item_per_page.html.erb
137
+ - spec/dummy/app/views/products/simple_index.html.erb
138
+ - spec/dummy/app/views/products/stupid_array.html.erb
139
+ - spec/dummy/bin/bundle
140
+ - spec/dummy/bin/rails
141
+ - spec/dummy/bin/rake
142
+ - spec/dummy/config.ru
143
+ - spec/dummy/config/application.rb
144
+ - spec/dummy/config/boot.rb
145
+ - spec/dummy/config/database.yml
146
+ - spec/dummy/config/environment.rb
147
+ - spec/dummy/config/environments/development.rb
148
+ - spec/dummy/config/environments/production.rb
149
+ - spec/dummy/config/environments/test.rb
150
+ - spec/dummy/config/initializers/backtrace_silencers.rb
151
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
152
+ - spec/dummy/config/initializers/inflections.rb
153
+ - spec/dummy/config/initializers/mime_types.rb
154
+ - spec/dummy/config/initializers/secret_token.rb
155
+ - spec/dummy/config/initializers/session_store.rb
156
+ - spec/dummy/config/initializers/tabulatr.rb
157
+ - spec/dummy/config/initializers/wrap_parameters.rb
158
+ - spec/dummy/config/locales/en.yml
159
+ - spec/dummy/config/locales/tabulatr.yml
160
+ - spec/dummy/config/routes.rb
161
+ - spec/dummy/db/migrate/20130730132101_create_vendors.rb
162
+ - spec/dummy/db/migrate/20130730132321_create_products.rb
163
+ - spec/dummy/db/migrate/20130730132348_create_tags.rb
164
+ - spec/dummy/db/schema.rb
165
+ - spec/dummy/lib/assets/.keep
166
+ - spec/dummy/log/.keep
167
+ - spec/dummy/public/404.html
168
+ - spec/dummy/public/422.html
169
+ - spec/dummy/public/500.html
170
+ - spec/dummy/public/favicon.ico
171
+ - spec/features/tabulatrs_spec.rb
172
+ - spec/lib/tabulatr/tabulatr/finder/find_for_table_spec.rb
173
+ - spec/spec_helper.rb
174
+ - tabulatr.gemspec
175
+ homepage: http://github.com/provideal/tabulatr2
176
+ licenses: []
177
+ metadata: {}
178
+ post_install_message:
179
+ rdoc_options:
180
+ - --charset=UTF-8
181
+ require_paths:
182
+ - lib
183
+ required_ruby_version: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - '>='
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ required_rubygems_version: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - '>='
191
+ - !ruby/object:Gem::Version
192
+ version: '0'
193
+ requirements: []
194
+ rubyforge_project:
195
+ rubygems_version: 2.0.6
196
+ signing_key:
197
+ specification_version: 4
198
+ summary: A tight DSL to build tables of ActiveRecord models with sorting, pagination,
199
+ finding/filtering, selecting and batch actions.
200
+ test_files:
201
+ - spec/dummy/.gitignore
202
+ - spec/dummy/README.rdoc
203
+ - spec/dummy/Rakefile
204
+ - spec/dummy/app/assets/images/.keep
205
+ - spec/dummy/app/assets/javascripts/application.js
206
+ - spec/dummy/app/assets/stylesheets/application.css.scss
207
+ - spec/dummy/app/controllers/application_controller.rb
208
+ - spec/dummy/app/controllers/concerns/.keep
209
+ - spec/dummy/app/controllers/products_controller.rb
210
+ - spec/dummy/app/controllers/tags_controller.rb
211
+ - spec/dummy/app/controllers/vendors_controller.rb
212
+ - spec/dummy/app/helpers/application_helper.rb
213
+ - spec/dummy/app/mailers/.keep
214
+ - spec/dummy/app/models/.keep
215
+ - spec/dummy/app/models/concerns/.keep
216
+ - spec/dummy/app/models/product.rb
217
+ - spec/dummy/app/models/tag.rb
218
+ - spec/dummy/app/models/vendor.rb
219
+ - spec/dummy/app/views/layouts/application.html.erb
220
+ - spec/dummy/app/views/products/count_tags.html.erb
221
+ - spec/dummy/app/views/products/one_item_per_page.html.erb
222
+ - spec/dummy/app/views/products/simple_index.html.erb
223
+ - spec/dummy/app/views/products/stupid_array.html.erb
224
+ - spec/dummy/bin/bundle
225
+ - spec/dummy/bin/rails
226
+ - spec/dummy/bin/rake
227
+ - spec/dummy/config.ru
228
+ - spec/dummy/config/application.rb
229
+ - spec/dummy/config/boot.rb
230
+ - spec/dummy/config/database.yml
231
+ - spec/dummy/config/environment.rb
232
+ - spec/dummy/config/environments/development.rb
233
+ - spec/dummy/config/environments/production.rb
234
+ - spec/dummy/config/environments/test.rb
235
+ - spec/dummy/config/initializers/backtrace_silencers.rb
236
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
237
+ - spec/dummy/config/initializers/inflections.rb
238
+ - spec/dummy/config/initializers/mime_types.rb
239
+ - spec/dummy/config/initializers/secret_token.rb
240
+ - spec/dummy/config/initializers/session_store.rb
241
+ - spec/dummy/config/initializers/tabulatr.rb
242
+ - spec/dummy/config/initializers/wrap_parameters.rb
243
+ - spec/dummy/config/locales/en.yml
244
+ - spec/dummy/config/locales/tabulatr.yml
245
+ - spec/dummy/config/routes.rb
246
+ - spec/dummy/db/migrate/20130730132101_create_vendors.rb
247
+ - spec/dummy/db/migrate/20130730132321_create_products.rb
248
+ - spec/dummy/db/migrate/20130730132348_create_tags.rb
249
+ - spec/dummy/db/schema.rb
250
+ - spec/dummy/lib/assets/.keep
251
+ - spec/dummy/log/.keep
252
+ - spec/dummy/public/404.html
253
+ - spec/dummy/public/422.html
254
+ - spec/dummy/public/500.html
255
+ - spec/dummy/public/favicon.ico
256
+ - spec/features/tabulatrs_spec.rb
257
+ - spec/lib/tabulatr/tabulatr/finder/find_for_table_spec.rb
258
+ - spec/spec_helper.rb