will_filter 3.0.5 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (233) hide show
  1. data/.gitignore +6 -0
  2. data/.rspec +1 -0
  3. data/.rvmrc +1 -0
  4. data/CHANGELOG.rdoc +2 -0
  5. data/Gemfile +4 -0
  6. data/Gemfile.lock +156 -0
  7. data/MIT-LICENSE +20 -0
  8. data/README.rdoc +78 -0
  9. data/Rakefile +68 -0
  10. data/app/.DS_Store +0 -0
  11. data/app/assets/images/.DS_Store +0 -0
  12. data/{public/favicon.ico → app/assets/images/will_filter/.gitkeep} +0 -0
  13. data/{public/will_filter/images → app/assets/images/will_filter}/buttons.png +0 -0
  14. data/{public/will_filter/images → app/assets/images/will_filter}/calendar.png +0 -0
  15. data/{public/will_filter/images → app/assets/images/will_filter}/clock.png +0 -0
  16. data/{public/will_filter/images → app/assets/images/will_filter}/close.gif +0 -0
  17. data/{public/will_filter/images → app/assets/images/will_filter}/sort_arrow_all.gif +0 -0
  18. data/{public/will_filter/images → app/assets/images/will_filter}/sort_bg.gif +0 -0
  19. data/{public/will_filter/images → app/assets/images/will_filter}/spinner.gif +0 -0
  20. data/{public/will_filter/javascripts/will_filter.js → app/assets/javascripts/will_filter/filter.js} +7 -7
  21. data/app/assets/javascripts/will_filter/filter_prototype_effects.js +38 -0
  22. data/app/assets/stylesheets/will_filter/actions.css.scss +27 -0
  23. data/app/assets/stylesheets/will_filter/buttons.css.scss +24 -0
  24. data/app/assets/stylesheets/will_filter/calendar.css.scss +55 -0
  25. data/app/assets/stylesheets/will_filter/exporter.css.scss +43 -0
  26. data/app/assets/stylesheets/will_filter/filter.css.scss +152 -0
  27. data/app/assets/stylesheets/will_filter/results.css.scss +63 -0
  28. data/app/controllers/{application_controller.rb → will_filter/application_controller.rb} +4 -4
  29. data/app/controllers/will_filter/calendar_controller.rb +1 -1
  30. data/app/controllers/will_filter/exporter_controller.rb +1 -1
  31. data/app/controllers/will_filter/filter_controller.rb +1 -7
  32. data/app/models/will_filter/filter.rb +12 -40
  33. data/app/views/.DS_Store +0 -0
  34. data/app/views/layouts/will_filter/application.html.erb +14 -0
  35. data/app/views/will_filter/.DS_Store +0 -0
  36. data/app/views/will_filter/calendar/.tmp__annual.html.erb.10120~ +32 -0
  37. data/app/views/will_filter/calendar/.tmp__annual.html.erb.2839~ +14 -0
  38. data/app/views/will_filter/calendar/.tmp__annual.html.erb.58862~ +14 -0
  39. data/app/views/will_filter/calendar/.tmp__annual.html.erb.64846~ +14 -0
  40. data/app/views/will_filter/calendar/.tmp__annual.html.erb.68789~ +32 -0
  41. data/app/views/will_filter/calendar/.tmp__annual.html.erb.93003~ +14 -0
  42. data/app/views/will_filter/calendar/.tmp__annual.html.erb.93827~ +32 -0
  43. data/app/views/will_filter/calendar/.tmp__month.html.erb.756~ +39 -0
  44. data/app/views/will_filter/calendar/.tmp__quarter.html.erb.69400~ +24 -0
  45. data/app/views/will_filter/calendar/.tmp_index.html.erb.11043~ +52 -0
  46. data/app/views/will_filter/calendar/.tmp_index.html.erb.33725~ +52 -0
  47. data/app/views/will_filter/calendar/.tmp_index.html.erb.56447~ +66 -0
  48. data/app/views/will_filter/calendar/.tmp_index.html.erb.85379~ +70 -0
  49. data/app/views/will_filter/calendar/.tmp_index.html.erb.86425~ +70 -0
  50. data/app/views/will_filter/calendar/.tmp_index.html.erb.95884~ +52 -0
  51. data/app/views/will_filter/calendar/index.html.erb +3 -3
  52. data/app/views/will_filter/common/.tmp__results_table.html.erb.47785~ +87 -0
  53. data/app/views/will_filter/common/.tmp__results_table.html.erb.88043~ +87 -0
  54. data/app/views/will_filter/common/.tmp__scripts.html.erb.51111~ +0 -0
  55. data/app/views/will_filter/common/.tmp__scripts.html.erb.6990~ +2 -0
  56. data/app/views/will_filter/common/.tmp__scripts.html.erb.88469~ +6 -0
  57. data/app/views/will_filter/common/_results_table.html.erb +6 -2
  58. data/app/views/will_filter/common/_scripts.html.erb +8 -2
  59. data/app/views/will_filter/exporter/.tmp_export.html.erb.10837~ +9 -0
  60. data/app/views/will_filter/exporter/.tmp_export.html.erb.1415~ +29 -0
  61. data/app/views/will_filter/exporter/.tmp_export.html.erb.60681~ +29 -0
  62. data/app/views/will_filter/exporter/.tmp_export.html.erb.61343~ +29 -0
  63. data/app/views/will_filter/exporter/.tmp_export_dialog.html.erb.22940~ +38 -0
  64. data/app/views/will_filter/exporter/.tmp_index.html.erb.13538~ +47 -0
  65. data/app/views/will_filter/exporter/.tmp_index.html.erb.23276~ +47 -0
  66. data/app/views/will_filter/exporter/.tmp_index.html.erb.28308~ +44 -0
  67. data/app/views/will_filter/exporter/.tmp_index.html.erb.29049~ +44 -0
  68. data/app/views/will_filter/exporter/index.html.erb +1 -1
  69. data/app/views/will_filter/filter/.tmp__condition.html.erb.24762~ +28 -0
  70. data/app/views/will_filter/filter/.tmp__condition.html.erb.27587~ +28 -0
  71. data/app/views/will_filter/filter/.tmp__condition.html.erb.45362~ +28 -0
  72. data/app/views/will_filter/filter/.tmp__condition.html.erb.49252~ +28 -0
  73. data/app/views/will_filter/filter/.tmp__condition.html.erb.58234~ +30 -0
  74. data/app/views/will_filter/filter/.tmp__condition.html.erb.60688~ +28 -0
  75. data/app/views/will_filter/filter/.tmp__condition.html.erb.66557~ +28 -0
  76. data/app/views/will_filter/filter/.tmp__condition.html.erb.68032~ +30 -0
  77. data/app/views/will_filter/filter/.tmp__condition.html.erb.73740~ +28 -0
  78. data/app/views/will_filter/filter/.tmp__condition.html.erb.81041~ +30 -0
  79. data/app/views/will_filter/filter/.tmp__condition.html.erb.98638~ +28 -0
  80. data/app/views/will_filter/filter/.tmp__conditions.html.erb.23216~ +50 -0
  81. data/app/views/will_filter/filter/.tmp__conditions.html.erb.53568~ +50 -0
  82. data/app/views/will_filter/filter/.tmp__conditions.html.erb.5788~ +56 -0
  83. data/app/views/will_filter/filter/.tmp__conditions.html.erb.79521~ +50 -0
  84. data/app/views/will_filter/filter/.tmp__conditions.html.erb.92102~ +56 -0
  85. data/app/views/will_filter/filter/.tmp__conditions.html.erb.97034~ +52 -0
  86. data/app/views/will_filter/filter/.tmp__container.html.erb.23178~ +30 -0
  87. data/app/views/will_filter/filter/.tmp__container.html.erb.25113~ +31 -0
  88. data/app/views/will_filter/filter/.tmp__container.html.erb.29332~ +36 -0
  89. data/app/views/will_filter/filter/.tmp__container.html.erb.31412~ +32 -0
  90. data/app/views/will_filter/filter/.tmp__container.html.erb.57958~ +32 -0
  91. data/app/views/will_filter/filter/.tmp__container.html.erb.80588~ +30 -0
  92. data/app/views/will_filter/filter/.tmp__container.html.erb.89054~ +30 -0
  93. data/app/views/will_filter/filter/.tmp__container.html.erb.92260~ +32 -0
  94. data/app/views/will_filter/filter/.tmp__container.html.erb.92798~ +36 -0
  95. data/app/views/will_filter/filter/.tmp__filter_conditions.html.erb.70617~ +78 -0
  96. data/app/views/will_filter/filter/.tmp_calendar.html.erb.30839~ +66 -0
  97. data/app/views/will_filter/filter/.tmp_calendar.html.erb.52766~ +66 -0
  98. data/app/views/will_filter/filter/.tmp_calendar.html.erb.83182~ +66 -0
  99. data/app/views/will_filter/filter/.tmp_export_data.html.erb.50322~ +44 -0
  100. data/app/views/will_filter/filter/.tmp_index.html.erb.40957~ +4 -0
  101. data/app/views/will_filter/filter/_condition.html.erb +5 -5
  102. data/app/views/will_filter/filter/_conditions.html.erb +4 -7
  103. data/app/views/will_filter/filter/_container.html.erb +5 -5
  104. data/app/views/will_filter/filter/containers/_boolean.html.erb +2 -2
  105. data/app/views/will_filter/filter/containers/_date.html.erb +3 -5
  106. data/app/views/will_filter/filter/containers/_date_range.html.erb +5 -9
  107. data/app/views/will_filter/filter/containers/_date_time.html.erb +3 -5
  108. data/app/views/will_filter/filter/containers/_date_time_range.html.erb +5 -9
  109. data/app/views/will_filter/filter/containers/_list.html.erb +1 -1
  110. data/app/views/will_filter/filter/containers/_numeric_range.html.erb +3 -3
  111. data/app/views/will_filter/filter/containers/_text.html.erb +2 -2
  112. data/app/views/will_filter/filter/index.html.erb +1 -1
  113. data/config/routes.rb +39 -17
  114. data/db/migrate/20110924023807_create_will_filter_filters.rb +15 -0
  115. data/lib/generators/.DS_Store +0 -0
  116. data/lib/generators/will_filter/templates/config.yml +0 -28
  117. data/lib/generators/will_filter/templates/create_will_filter_filters.rb +15 -0
  118. data/lib/generators/will_filter/will_filter_generator.rb +27 -4
  119. data/lib/tasks/will_filter_tasks.rake +1 -2
  120. data/lib/will_filter.rb +26 -1
  121. data/lib/will_filter/calendar.rb +1 -1
  122. data/lib/will_filter/config.rb +1 -6
  123. data/lib/will_filter/containers/filter_list.rb +2 -2
  124. data/lib/will_filter/engine.rb +23 -17
  125. data/lib/will_filter/{common_methods.rb → extensions/action_controller_extension.rb} +18 -20
  126. data/lib/will_filter/extensions/action_view_extension.rb +50 -0
  127. data/lib/{core_ext/active_record/base.rb → will_filter/extensions/active_record_extension.rb} +22 -17
  128. data/lib/{core_ext/array.rb → will_filter/extensions/array_extension.rb} +1 -1
  129. data/lib/{application_helper.rb → will_filter/railtie.rb} +30 -20
  130. data/{app/helpers/application_helper.rb → lib/will_filter/version.rb} +3 -3
  131. data/script/rails +6 -0
  132. data/spec/spec_helper.rb +27 -0
  133. data/test/.DS_Store +0 -0
  134. data/test/dummy/.DS_Store +0 -0
  135. data/test/dummy/.sass-cache/f9cb1ef521115be73f1c61d3d5d64f66c947af63/actions.css.scssc +0 -0
  136. data/test/dummy/.sass-cache/f9cb1ef521115be73f1c61d3d5d64f66c947af63/buttons.css.scssc +0 -0
  137. data/test/dummy/.sass-cache/f9cb1ef521115be73f1c61d3d5d64f66c947af63/calendar.css.scssc +0 -0
  138. data/test/dummy/.sass-cache/f9cb1ef521115be73f1c61d3d5d64f66c947af63/exporter.css.scssc +0 -0
  139. data/test/dummy/.sass-cache/f9cb1ef521115be73f1c61d3d5d64f66c947af63/filter.css.scssc +0 -0
  140. data/test/dummy/.sass-cache/f9cb1ef521115be73f1c61d3d5d64f66c947af63/results.css.scssc +0 -0
  141. data/test/dummy/Rakefile +7 -0
  142. data/test/dummy/app/.DS_Store +0 -0
  143. data/test/dummy/app/assets/javascripts/application.js +7 -0
  144. data/test/dummy/app/assets/stylesheets/application.css +7 -0
  145. data/test/dummy/app/assets/stylesheets/kaminari.css +10 -0
  146. data/test/dummy/app/controllers/advanced_controller.rb +19 -0
  147. data/test/dummy/app/controllers/application_controller.rb +8 -0
  148. data/test/dummy/app/controllers/simple_controller.rb +15 -0
  149. data/test/dummy/app/helpers/application_helper.rb +3 -0
  150. data/test/dummy/app/mailers/.gitkeep +0 -0
  151. data/test/dummy/app/models/.gitkeep +0 -0
  152. data/test/dummy/app/models/event.rb +15 -0
  153. data/test/dummy/app/models/event_filter.rb +41 -0
  154. data/test/dummy/app/models/event_user.rb +10 -0
  155. data/test/dummy/app/models/event_user_filter.rb +40 -0
  156. data/test/dummy/app/models/user.rb +42 -0
  157. data/test/dummy/app/models/user_filter.rb +57 -0
  158. data/test/dummy/app/views/advanced/event_members.html.erb +2 -0
  159. data/test/dummy/app/views/advanced/events.html.erb +2 -0
  160. data/test/dummy/app/views/advanced/users.html.erb +2 -0
  161. data/test/dummy/app/views/advanced/users_with_actions.html.erb +12 -0
  162. data/test/dummy/app/views/common/_event_members.html.erb +2 -0
  163. data/test/dummy/app/views/common/_events.html.erb +2 -0
  164. data/test/dummy/app/views/common/_menu.html.erb +23 -0
  165. data/test/dummy/app/views/common/_users.html.erb +2 -0
  166. data/test/dummy/app/views/kaminari/_first_page.html.erb +11 -0
  167. data/test/dummy/app/views/kaminari/_gap.html.erb +8 -0
  168. data/test/dummy/app/views/kaminari/_last_page.html.erb +11 -0
  169. data/test/dummy/app/views/kaminari/_next_page.html.erb +11 -0
  170. data/test/dummy/app/views/kaminari/_page.html.erb +12 -0
  171. data/test/dummy/app/views/kaminari/_paginator.html.erb +23 -0
  172. data/test/dummy/app/views/kaminari/_prev_page.html.erb +11 -0
  173. data/test/dummy/app/views/layouts/application.html.erb +17 -0
  174. data/test/dummy/app/views/simple/event_members.html.erb +2 -0
  175. data/test/dummy/app/views/simple/events.html.erb +3 -0
  176. data/test/dummy/app/views/simple/users.html.erb +2 -0
  177. data/test/dummy/config.ru +4 -0
  178. data/{config → test/dummy/config}/application.rb +11 -10
  179. data/test/dummy/config/boot.rb +10 -0
  180. data/test/dummy/config/data/female_names.txt +26 -0
  181. data/test/dummy/config/data/last_names.txt +50 -0
  182. data/test/dummy/config/data/male_names.txt +25 -0
  183. data/{config → test/dummy/config}/database.yml +3 -0
  184. data/test/dummy/config/environment.rb +5 -0
  185. data/{config → test/dummy/config}/environments/development.rb +8 -4
  186. data/{config → test/dummy/config}/environments/production.rb +24 -13
  187. data/{config → test/dummy/config}/environments/test.rb +9 -5
  188. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  189. data/test/dummy/config/initializers/inflections.rb +10 -0
  190. data/test/dummy/config/initializers/mime_types.rb +5 -0
  191. data/test/dummy/config/initializers/secret_token.rb +7 -0
  192. data/test/dummy/config/initializers/session_store.rb +8 -0
  193. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  194. data/test/dummy/config/locales/en.yml +5 -0
  195. data/test/dummy/config/routes.rb +13 -0
  196. data/test/dummy/config/will_filter/config.yml +97 -0
  197. data/test/dummy/db/migrate/.DS_Store +0 -0
  198. data/test/dummy/db/migrate/20090416182137_create_users.rb +15 -0
  199. data/test/dummy/db/migrate/20090418042757_create_events.rb +20 -0
  200. data/test/dummy/db/migrate/20090418062225_create_event_users.rb +17 -0
  201. data/test/dummy/db/schema.rb +61 -0
  202. data/test/dummy/lib/assets/.gitkeep +0 -0
  203. data/test/dummy/lib/tasks/dummy.rake +14 -0
  204. data/test/dummy/log/.gitkeep +0 -0
  205. data/{public → test/dummy/public}/404.html +0 -0
  206. data/{public → test/dummy/public}/422.html +0 -0
  207. data/{public → test/dummy/public}/500.html +0 -0
  208. data/test/dummy/public/favicon.ico +0 -0
  209. data/test/dummy/script/rails +6 -0
  210. data/test/dummy/test/functional/welcome_controller_test.rb +9 -0
  211. data/test/dummy/test/unit/helpers/welcome_helper_test.rb +4 -0
  212. data/test/fixtures/will_filter/filters.yml +11 -0
  213. data/test/functional/will_filter/calendar_controller_test.rb +9 -0
  214. data/test/functional/will_filter/exporter_controller_test.rb +9 -0
  215. data/test/functional/will_filter/filter_controller_test.rb +9 -0
  216. data/test/integration/navigation_test.rb +10 -0
  217. data/test/test_helper.rb +10 -0
  218. data/test/unit/helpers/will_filter/calendar_helper_test.rb +6 -0
  219. data/test/unit/helpers/will_filter/exporter_helper_test.rb +6 -0
  220. data/test/unit/helpers/will_filter/filter_helper_test.rb +6 -0
  221. data/test/unit/will_filter/filter_test.rb +9 -0
  222. data/test/will_filter_test.rb +7 -0
  223. data/will_filter.gemspec +38 -0
  224. metadata +446 -45
  225. data/app/views/layouts/application.html.erb +0 -11
  226. data/config/boot.rb +0 -6
  227. data/config/environment.rb +0 -15
  228. data/lib/core_ext/object.rb +0 -34
  229. data/lib/generators/will_filter/templates/create_will_filter_tables.rb +0 -19
  230. data/public/robots.txt +0 -5
  231. data/public/will_filter/images/results_table_th_active.gif +0 -0
  232. data/public/will_filter/javascripts/will_filter_prototype_effects.js +0 -15
  233. data/public/will_filter/stylesheets/will_filter.css +0 -168
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
4
+ test/dummy/db/*.sqlite3
5
+ test/dummy/log/*.log
6
+ test/dummy/tmp/
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm 1.9.2 --create
data/CHANGELOG.rdoc ADDED
@@ -0,0 +1,2 @@
1
+ == 3.1.1, released 2011-09-29
2
+ == 0.1.0, released 2010-07-02
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Declare your gem's dependencies in will_filter.gemspec.
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,156 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ will_filter (3.1.1)
5
+ coffee-script
6
+ kaminari
7
+ rails (>= 3.1.0)
8
+ sass
9
+
10
+ GEM
11
+ remote: http://rubygems.org/
12
+ specs:
13
+ actionmailer (3.1.0)
14
+ actionpack (= 3.1.0)
15
+ mail (~> 2.3.0)
16
+ actionpack (3.1.0)
17
+ activemodel (= 3.1.0)
18
+ activesupport (= 3.1.0)
19
+ builder (~> 3.0.0)
20
+ erubis (~> 2.7.0)
21
+ i18n (~> 0.6)
22
+ rack (~> 1.3.2)
23
+ rack-cache (~> 1.0.3)
24
+ rack-mount (~> 0.8.2)
25
+ rack-test (~> 0.6.1)
26
+ sprockets (~> 2.0.0)
27
+ activemodel (3.1.0)
28
+ activesupport (= 3.1.0)
29
+ bcrypt-ruby (~> 3.0.0)
30
+ builder (~> 3.0.0)
31
+ i18n (~> 0.6)
32
+ activerecord (3.1.0)
33
+ activemodel (= 3.1.0)
34
+ activesupport (= 3.1.0)
35
+ arel (~> 2.2.1)
36
+ tzinfo (~> 0.3.29)
37
+ activeresource (3.1.0)
38
+ activemodel (= 3.1.0)
39
+ activesupport (= 3.1.0)
40
+ activesupport (3.1.0)
41
+ multi_json (~> 1.0)
42
+ arel (2.2.1)
43
+ bcrypt-ruby (3.0.1)
44
+ builder (3.0.0)
45
+ capybara (1.1.1)
46
+ mime-types (>= 1.16)
47
+ nokogiri (>= 1.3.3)
48
+ rack (>= 1.0.0)
49
+ rack-test (>= 0.5.4)
50
+ selenium-webdriver (~> 2.0)
51
+ xpath (~> 0.1.4)
52
+ childprocess (0.2.2)
53
+ ffi (~> 1.0.6)
54
+ coffee-script (2.2.0)
55
+ coffee-script-source
56
+ execjs
57
+ coffee-script-source (1.1.2)
58
+ database_cleaner (0.6.7)
59
+ diff-lcs (1.1.3)
60
+ erubis (2.7.0)
61
+ execjs (1.2.9)
62
+ multi_json (~> 1.0)
63
+ factory_girl (2.1.2)
64
+ activesupport
65
+ ffi (1.0.9)
66
+ hike (1.2.1)
67
+ i18n (0.6.0)
68
+ json_pure (1.6.1)
69
+ kaminari (0.12.4)
70
+ rails (>= 3.0.0)
71
+ mail (2.3.0)
72
+ i18n (>= 0.4.0)
73
+ mime-types (~> 1.16)
74
+ treetop (~> 1.4.8)
75
+ mime-types (1.16)
76
+ multi_json (1.0.3)
77
+ nokogiri (1.5.0)
78
+ polyglot (0.3.2)
79
+ rack (1.3.3)
80
+ rack-cache (1.0.3)
81
+ rack (>= 0.4)
82
+ rack-mount (0.8.3)
83
+ rack (>= 1.0.0)
84
+ rack-ssl (1.3.2)
85
+ rack
86
+ rack-test (0.6.1)
87
+ rack (>= 1.0)
88
+ rails (3.1.0)
89
+ actionmailer (= 3.1.0)
90
+ actionpack (= 3.1.0)
91
+ activerecord (= 3.1.0)
92
+ activeresource (= 3.1.0)
93
+ activesupport (= 3.1.0)
94
+ bundler (~> 1.0)
95
+ railties (= 3.1.0)
96
+ railties (3.1.0)
97
+ actionpack (= 3.1.0)
98
+ activesupport (= 3.1.0)
99
+ rack-ssl (~> 1.3.2)
100
+ rake (>= 0.8.7)
101
+ rdoc (~> 3.4)
102
+ thor (~> 0.14.6)
103
+ rake (0.9.2)
104
+ rdoc (3.9.4)
105
+ rr (1.0.4)
106
+ rspec (2.6.0)
107
+ rspec-core (~> 2.6.0)
108
+ rspec-expectations (~> 2.6.0)
109
+ rspec-mocks (~> 2.6.0)
110
+ rspec-core (2.6.4)
111
+ rspec-expectations (2.6.0)
112
+ diff-lcs (~> 1.1.2)
113
+ rspec-mocks (2.6.0)
114
+ rspec-rails (2.6.1)
115
+ actionpack (~> 3.0)
116
+ activesupport (~> 3.0)
117
+ railties (~> 3.0)
118
+ rspec (~> 2.6.0)
119
+ rubyzip (0.9.4)
120
+ sass (3.1.7)
121
+ selenium-webdriver (2.7.0)
122
+ childprocess (>= 0.2.1)
123
+ ffi (>= 1.0.7)
124
+ json_pure
125
+ rubyzip
126
+ sprockets (2.0.0)
127
+ hike (~> 1.2)
128
+ rack (~> 1.0)
129
+ tilt (!= 1.3.0, ~> 1.1)
130
+ sqlite3 (1.3.4)
131
+ steak (2.0.0)
132
+ capybara (>= 1.0.0)
133
+ rspec-rails (>= 2.5.0)
134
+ thor (0.14.6)
135
+ tilt (1.3.3)
136
+ treetop (1.4.10)
137
+ polyglot
138
+ polyglot (>= 0.3.1)
139
+ tzinfo (0.3.29)
140
+ xpath (0.1.4)
141
+ nokogiri (~> 1.3)
142
+
143
+ PLATFORMS
144
+ ruby
145
+
146
+ DEPENDENCIES
147
+ bundler (>= 1.0.0)
148
+ capybara
149
+ database_cleaner
150
+ factory_girl
151
+ rr
152
+ rspec
153
+ rspec-rails
154
+ sqlite3
155
+ steak
156
+ will_filter!
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010-2011 Michael Berkovich
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,78 @@
1
+ = WillFilter
2
+
3
+ will_filter is a Rails engine plugin that provides a GUI for filtering your ActiveRecord models.
4
+
5
+ == Preamble
6
+
7
+ If you ever had to build an admin tool for your web site that displayed a list of objects that can be filtered using
8
+ various criteria, this plugin will make your life easier. Adding a filtered page can now be
9
+ a matter of adding two lines of code - one to your controller and one to your view. See examples below.
10
+
11
+ == Installation Instructions
12
+
13
+ Add the following gems to your Gemfile:
14
+
15
+ gem 'will_filter', "~> 3.1.0"
16
+
17
+ And run:
18
+
19
+ $ bundle
20
+
21
+ To configure and initialize will_filter engine, run the following commands:
22
+
23
+ $ rails generate will_filter
24
+ $ rake db:migrate
25
+
26
+ == Examples
27
+
28
+ To add a filtered result-set to your controller use the following method call:
29
+
30
+ class UsersController < ApplicationController
31
+
32
+ def index
33
+ @users = User.filter(:params => params)
34
+ end
35
+
36
+ end
37
+
38
+ Note: 'User' is a Rails ActiveRecord model
39
+
40
+ Now all you have to do is create a view for this action and add the following tag where you want the filter to be rendered:
41
+
42
+ <%= will_filter_tag(@users) %>
43
+
44
+ And optionally you can do (for results table):
45
+
46
+ <%= will_filter_table_tag(@users) %>
47
+
48
+ That's it. This will render a filter box with various conditions, operators and values for the model object you selected.
49
+
50
+ Below are a couple of screenshot of what the filter looks like when it is rendered on a page:
51
+
52
+ http://wiki.tr8n.org/images/e/e1/Wf1.png
53
+
54
+ http://wiki.tr8n.org/images/5/50/Wf2.png
55
+
56
+
57
+ This plugin comes with a dummy test project. To try out some of the examples, run the following commands:
58
+
59
+ $ git clone git://github.com/berk/will_filter.git
60
+ $ cd will_filter/test/dummy
61
+ $ rake db:migrate
62
+ $ rake samples:init
63
+ $ rails server
64
+
65
+ Open your browser and point to:
66
+
67
+ http://localhost:3000
68
+
69
+ Live will_filter_examples application is running here:
70
+
71
+ http://wf.tr8n.org
72
+
73
+ If you have any questions, comments or suggestions, email me at theiceberk@gmail.com
74
+
75
+ == Authors and credits
76
+
77
+ Authors:: Michael Berkovich
78
+
data/Rakefile ADDED
@@ -0,0 +1,68 @@
1
+ #--
2
+ # Copyright (c) 2010-2011 Michael Berkovich
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #++
23
+
24
+ #!/usr/bin/env rake
25
+ begin
26
+ require 'bundler/setup'
27
+ rescue LoadError
28
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
29
+ end
30
+ begin
31
+ require 'rdoc/task'
32
+ rescue LoadError
33
+ require 'rdoc/rdoc'
34
+ require 'rake/rdoctask'
35
+ RDoc::Task = Rake::RDocTask
36
+ end
37
+
38
+ RDoc::Task.new(:rdoc) do |rdoc|
39
+ require 'will_filter/version'
40
+
41
+ rdoc.rdoc_dir = 'rdoc'
42
+ rdoc.title = 'WillFilter #{WillFilter::VERSION}'
43
+ rdoc.options << '--line-numbers'
44
+ rdoc.rdoc_files.include('README.rdoc')
45
+ rdoc.rdoc_files.include('lib/**/*.rb')
46
+ end
47
+
48
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
49
+ load 'rails/tasks/engine.rake'
50
+
51
+ Bundler::GemHelper.install_tasks
52
+
53
+ require 'rake/testtask'
54
+
55
+ Rake::TestTask.new(:test) do |t|
56
+ t.libs << 'lib'
57
+ t.libs << 'test'
58
+ t.pattern = 'test/**/*_test.rb'
59
+ t.verbose = false
60
+ end
61
+
62
+ require 'rspec/core'
63
+ require 'rspec/core/rake_task'
64
+ RSpec::Core::RakeTask.new(:spec) do |spec|
65
+ spec.pattern = FileList['spec/**/*_spec.rb']
66
+ end
67
+
68
+ task :default => :spec
data/app/.DS_Store ADDED
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  /****************************************************************************
2
- Copyright (c) 2011 Michael Berkovich
2
+ Copyright (c) 2010-2011 Michael Berkovich
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining
5
5
  a copy of this software and associated documentation files (the
@@ -234,9 +234,9 @@ Wf.Calendar.prototype = {
234
234
  onComplete: function(transport) {
235
235
  var trigger_position = Wf.Utils.cumulativeOffset(wfCalendar.trigger);
236
236
  var calendar_container = Wf.element("wf_calendar");
237
- calendar_container.style.left = (trigger_position[0] - 237) + "px";
238
- calendar_container.style.top = trigger_position[1] + "px";
239
- calendar_container.style.width = "230px";
237
+ calendar_container.style.left = (trigger_position[0] - 273) + "px";
238
+ calendar_container.style.top = trigger_position[1] - 6 + "px";
239
+ calendar_container.style.width = "260px";
240
240
  Wf.Effects.appear("wf_calendar");
241
241
  }
242
242
  });
@@ -260,8 +260,8 @@ Wf.Calendar.prototype = {
260
260
  var trigger_position = Wf.Utils.cumulativeOffset(wfCalendar.trigger);
261
261
  var width = (mode=='annual' ? 760 : 400);
262
262
  var calendar_container = Wf.element("wf_calendar");
263
- calendar_container.style.left = (trigger_position[0] - width - 7) + "px";
264
- calendar_container.style.top = trigger_position[1] + "px";
263
+ calendar_container.style.left = (trigger_position[0] - width - 13) + "px";
264
+ calendar_container.style.top = trigger_position[1] - 6 + "px";
265
265
  calendar_container.style.width = width + "px";
266
266
  }
267
267
  });
@@ -340,7 +340,7 @@ Wf.Exporter.prototype = {
340
340
  onComplete: function(transport) {
341
341
  var trigger_position = Wf.Utils.cumulativeOffset(trigger);
342
342
  var exporter_container = Wf.element("wf_exporter");
343
- exporter_container.style.left = (trigger_position[0] - 240) + "px";
343
+ exporter_container.style.left = (trigger_position[0] - 245) + "px";
344
344
  exporter_container.style.top = trigger_position[1] + "px";
345
345
  Wf.Effects.appear("wf_exporter");
346
346
  }
@@ -0,0 +1,38 @@
1
+ /****************************************************************************
2
+ Copyright (c) 2010-2011 Michael Berkovich
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ ****************************************************************************/
23
+
24
+ var Wf = Wf || {};
25
+ Wf.Effects = {
26
+ blindUp: function(element_id) {
27
+ Effect.BlindUp(element_id, { duration: 0.25 });
28
+ },
29
+ blindDown: function(element_id) {
30
+ Effect.BlindDown(element_id, { duration: 0.25 });
31
+ },
32
+ appear: function(element_id) {
33
+ Effect.Appear(element_id, { duration: 0.25 });
34
+ },
35
+ fade: function(element_id) {
36
+ Effect.Fade(element_id, { duration: 0.25 });
37
+ }
38
+ }