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
@@ -0,0 +1,30 @@
1
+ <% form_tag({}, {:method => :get, :name=>'wf_form', :id => 'wf_form', :class => 'wf_form' }) do %>
2
+ <div class="wf_container">
3
+
4
+ <div id="wf_filter_conditions" class="conditions">
5
+ <%= render :partial=> "/wf/filter/conditions" %>
6
+ </div>
7
+
8
+ <div class="footer">
9
+ <div style="float:right">
10
+ <%=link_to_function("Toggle Conditions", "wfFilter.toggleDebugger()", :style=>"font-size:9px") %>
11
+ &nbsp;&nbsp;
12
+ Order:
13
+ <%= select_tag(:wf_order, options_for_select(@wf_filter.condition_options, @wf_filter.order), {:onChange=>"markDirty()"}) %>
14
+ <%= select_tag(:wf_order_type, options_for_select(@wf_filter.order_type_options, @wf_filter.order_type), {:onChange=>"markDirty()"}) %>
15
+ Per Page:
16
+ <%= select_tag(:wf_per_page, options_for_select(@wf_filter.per_page_options, @wf_filter.per_page), {:onChange=>"markDirty()"}) %>
17
+ &nbsp;&nbsp;<%=link_to_function("<span>Submit Filter</span>", "$('wf_form').submit()", :class => "grey-button pcb") %>
18
+ </div>
19
+ <div>
20
+ <%=link_to_function("<span>+ Add</span>", "wfFilter.addCondition()", :class => "grey-button pcb") %>
21
+ <%=link_to_function("<span>- Clear</span>", "wfFilter.removeAllConditions()", :class => "grey-button pcb") %>
22
+ &nbsp;&nbsp;<span id="wf_loader" class="spinner" style="display:none;"><%=image_tag "/wf/images/spinner.gif", {:style=>"vertical-align:middle"} %> Loading...</span>
23
+ </div>
24
+ </div>
25
+
26
+ <div id="wf_debugger" class="wf_debugger" style="display:none;">
27
+ <%= @wf_filter.debug_sql_conditions %>
28
+ </div>
29
+ </div>
30
+ <% end %>
@@ -0,0 +1,31 @@
1
+ <%=will_filter_scripts_tag %>
2
+
3
+ <% form_tag({}, {:method => :get, :name=>'wf_form', :id => 'wf_form', :class => 'wf_form' }) do %>
4
+ <div class="wf_container">
5
+ <div id="wf_filter_conditions" class="conditions">
6
+ <%= render :partial=> "/wf/filter/conditions", :locals => {:wf_filter => wf_filter} %>
7
+ </div>
8
+
9
+ <div class="wf_footer">
10
+ <div style="float:right">
11
+ <%=link_to_function("Toggle Conditions", "wfFilter.toggleDebugger()", :style=>"font-size:9px") %>
12
+ &nbsp;&nbsp;
13
+ Order:
14
+ <%= select_tag(:wf_order, options_for_select(wf_filter.condition_options, wf_filter.order), {:onChange=>"markDirty()"}) %>
15
+ <%= select_tag(:wf_order_type, options_for_select(wf_filter.order_type_options, wf_filter.order_type), {:onChange=>"markDirty()"}) %>
16
+ Per Page:
17
+ <%= select_tag(:wf_per_page, options_for_select(wf_filter.per_page_options, wf_filter.per_page.to_s), {:onChange=>"markDirty()"}) %>
18
+ &nbsp;&nbsp;<%=link_to_function("<span>Submit Filter</span>".html_safe, "wfFilter.submit()", :class => "wf_grey_button wf_pcb") %>
19
+ </div>
20
+ <div>
21
+ <%=link_to_function("<span>+ Add</span>".html_safe, "wfFilter.addCondition()", :class => "wf_grey_button wf_pcb") %>
22
+ <%=link_to_function("<span>- Clear</span>".html_safe, "wfFilter.removeAllConditions()", :class => "wf_grey_button wf_pcb") %>
23
+ &nbsp;&nbsp;<span id="wf_loader" class="spinner" style="display:none;"><%=image_tag "/wf/images/spinner.gif", {:style=>"vertical-align:middle"} %> Loading...</span>
24
+ </div>
25
+ </div>
26
+
27
+ <div id="wf_debugger" class="wf_debugger" style="display:none;">
28
+ <%= wf_filter.debug_sql_conditions %>
29
+ </div>
30
+ </div>
31
+ <% end %>
@@ -0,0 +1,36 @@
1
+ <%=stylesheet_link_tag("/wf/stylesheets/will_filter.css") -%>
2
+ <%=javascript_include_tag("/wf/javascripts/will_filter.js") -%>
3
+
4
+ <% form_tag({}, {:method => :get, :name=>'wf_form', :id => 'wf_form', :class => 'wf_form' }) do %>
5
+ <div class="will_filter">
6
+
7
+ <div id="wf_filter_conditions" class="conditions">
8
+ <%= render :partial=> "/wf/filter/conditions" %>
9
+ </div>
10
+
11
+ <div class="footer">
12
+ <div style="float:right">
13
+ <%=link_to_function("Toggle Conditions", "wfFilter.toggleDebugger()", :style=>"font-size:9px") %>
14
+ &nbsp;&nbsp;
15
+ Order:
16
+ <%= select_tag(:wf_order, options_for_select(@wf_filter.condition_options, @wf_filter.order), {:onChange=>"markDirty()"}) %>
17
+ <%= select_tag(:wf_order_type, options_for_select(@wf_filter.order_type_options, @wf_filter.order_type), {:onChange=>"markDirty()"}) %>
18
+ Per Page:
19
+ <%= select_tag(:wf_per_page, options_for_select(@wf_filter.per_page_options, @wf_filter.per_page), {:onChange=>"markDirty()"}) %>
20
+ &nbsp;&nbsp;<%=link_to_function("<span>Submit Filter</span>", "$('wf_form').submit()", :class => "grey-button pcb") %>
21
+ </div>
22
+ <div>
23
+ <%=link_to_function("<span>+ Add</span>", "wfFilter.addCondition()", :class => "grey-button pcb") %>
24
+ <%=link_to_function("<span>- Clear</span>", "wfFilter.removeAllConditions()", :class => "grey-button pcb") %>
25
+ &nbsp;&nbsp;<span id="wf_loader" class="spinner" style="display:none;"><%=image_tag "/wf/images/spinner.gif", {:style=>"vertical-align:middle"} %> Loading...</span>
26
+ </div>
27
+ </div>
28
+
29
+ <div id="wf_debugger" class="debug" style="display:none;">
30
+ <%= @wf_filter.debug_sql_conditions %>
31
+ </div>
32
+ </div>
33
+ <% end %>
34
+
35
+ <div id="wf_calendar" style="display:none">
36
+ </div>
@@ -0,0 +1,32 @@
1
+ <%=will_filter_scripts_tag %>
2
+
3
+ <% form_tag({}, {:method => :get, :name=>'wf_form', :id => 'wf_form', :class => 'wf_form' }) do %>
4
+ <div class="wf_container">
5
+
6
+ <div id="wf_filter_conditions" class="conditions">
7
+ <%= render :partial=> "/wf/filter/conditions", :locals => {:wf_filter => wf_filter} %>
8
+ </div>
9
+
10
+ <div class="wf_footer">
11
+ <div style="float:right">
12
+ <%=link_to_function("Toggle Conditions", "wfFilter.toggleDebugger()", :style=>"font-size:9px") %>
13
+ &nbsp;&nbsp;
14
+ Order:
15
+ <%= select_tag(:wf_order, options_for_select(wf_filter.condition_options, wf_filter.order), {:onChange=>"markDirty()"}) %>
16
+ <%= select_tag(:wf_order_type, options_for_select(wf_filter.order_type_options, wf_filter.order_type), {:onChange=>"markDirty()"}) %>
17
+ Per Page:
18
+ <%= select_tag(:wf_per_page, options_for_select(wf_filter.per_page_options, wf_filter.per_page.to_s), {:onChange=>"markDirty()"}) %>
19
+ &nbsp;&nbsp;<%=link_to_function("<span>Submit Filter</span>", "wfFilter.submit()", :class => "grey-button pcb") %>
20
+ </div>
21
+ <div>
22
+ <%=link_to_function("<span>+ Add</span>", "wfFilter.addCondition()", :class => "grey-button pcb") %>
23
+ <%=link_to_function("<span>- Clear</span>", "wfFilter.removeAllConditions()", :class => "grey-button pcb") %>
24
+ &nbsp;&nbsp;<span id="wf_loader" class="spinner" style="display:none;"><%=image_tag "/wf/images/spinner.gif", {:style=>"vertical-align:middle"} %> Loading...</span>
25
+ </div>
26
+ </div>
27
+
28
+ <div id="wf_debugger" class="wf_debugger" style="display:none;">
29
+ <%= wf_filter.debug_sql_conditions %>
30
+ </div>
31
+ </div>
32
+ <% end %>
@@ -0,0 +1,32 @@
1
+ <%=will_filter_scripts_tag %>
2
+
3
+ <% form_tag({}, {:method => :get, :name=>'wf_form', :id => 'wf_form', :class => 'wf_form' }) do %>
4
+ <div class="wf_container">
5
+
6
+ <div id="wf_filter_conditions" class="conditions">
7
+ <%= render :partial=> "/wf/filter/conditions" %>
8
+ </div>
9
+
10
+ <div class="footer">
11
+ <div style="float:right">
12
+ <%=link_to_function("Toggle Conditions", "wfFilter.toggleDebugger()", :style=>"font-size:9px") %>
13
+ &nbsp;&nbsp;
14
+ Order:
15
+ <%= select_tag(:wf_order, options_for_select(@wf_filter.condition_options, @wf_filter.order), {:onChange=>"markDirty()"}) %>
16
+ <%= select_tag(:wf_order_type, options_for_select(@wf_filter.order_type_options, @wf_filter.order_type), {:onChange=>"markDirty()"}) %>
17
+ Per Page:
18
+ <%= select_tag(:wf_per_page, options_for_select(@wf_filter.per_page_options, @wf_filter.per_page), {:onChange=>"markDirty()"}) %>
19
+ &nbsp;&nbsp;<%=link_to_function("<span>Submit Filter</span>", "wfFilter.submit()", :class => "grey-button pcb") %>
20
+ </div>
21
+ <div>
22
+ <%=link_to_function("<span>+ Add</span>", "wfFilter.addCondition()", :class => "grey-button pcb") %>
23
+ <%=link_to_function("<span>- Clear</span>", "wfFilter.removeAllConditions()", :class => "grey-button pcb") %>
24
+ &nbsp;&nbsp;<span id="wf_loader" class="spinner" style="display:none;"><%=image_tag "/wf/images/spinner.gif", {:style=>"vertical-align:middle"} %> Loading...</span>
25
+ </div>
26
+ </div>
27
+
28
+ <div id="wf_debugger" class="wf_debugger" style="display:none;">
29
+ <%= @wf_filter.debug_sql_conditions %>
30
+ </div>
31
+ </div>
32
+ <% end %>
@@ -0,0 +1,30 @@
1
+ <% form_tag({}, {:method => :get, :name=>'wf_form', :id => 'wf_form', :class => 'wf_form' }) do %>
2
+ <div class="wf_container">
3
+
4
+ <div id="wf_filter_conditions" class="conditions">
5
+ <%= render :partial=> "/wf/filter/conditions" %>
6
+ </div>
7
+
8
+ <div class="footer">
9
+ <div style="float:right">
10
+ <%=link_to_function("Toggle Conditions", "wfFilter.toggleDebugger()", :style=>"font-size:9px") %>
11
+ &nbsp;&nbsp;
12
+ Order:
13
+ <%= select_tag(:wf_order, options_for_select(@wf_filter.condition_options, @wf_filter.order), {:onChange=>"markDirty()"}) %>
14
+ <%= select_tag(:wf_order_type, options_for_select(@wf_filter.order_type_options, @wf_filter.order_type), {:onChange=>"markDirty()"}) %>
15
+ Per Page:
16
+ <%= select_tag(:wf_per_page, options_for_select(@wf_filter.per_page_options, @wf_filter.per_page), {:onChange=>"markDirty()"}) %>
17
+ &nbsp;&nbsp;<%=link_to_function("<span>Submit Filter</span>", "$('wf_form').submit()", :class => "grey-button pcb") %>
18
+ </div>
19
+ <div>
20
+ <%=link_to_function("<span>+ Add</span>", "wfFilter.addCondition()", :class => "grey-button pcb") %>
21
+ <%=link_to_function("<span>- Clear</span>", "wfFilter.removeAllConditions()", :class => "grey-button pcb") %>
22
+ &nbsp;&nbsp;<span id="wf_loader" class="spinner" style="display:none;"><%=image_tag "/wf/images/spinner.gif", {:style=>"vertical-align:middle"} %> Loading...</span>
23
+ </div>
24
+ </div>
25
+
26
+ <div id="wf_debugger" class="debug" style="display:none;">
27
+ <%= @wf_filter.debug_sql_conditions %>
28
+ </div>
29
+ </div>
30
+ <% end %>
@@ -0,0 +1,30 @@
1
+ <% form_tag({}, {:method => :get, :name=>'wf_form', :id => 'wf_form', :class => 'wf_form' }) do %>
2
+ <div class="wf_container">
3
+
4
+ <div id="wf_filter_conditions" class="conditions">
5
+ <%= render :partial=> "/wf/filter/conditions" %>
6
+ </div>
7
+
8
+ <div class="footer">
9
+ <div style="float:right">
10
+ <%=link_to_function("Toggle Conditions", "wfFilter.toggleDebugger()", :style=>"font-size:9px") %>
11
+ &nbsp;&nbsp;
12
+ Order:
13
+ <%= select_tag(:wf_order, options_for_select(@wf_filter.condition_options, @wf_filter.order), {:onChange=>"markDirty()"}) %>
14
+ <%= select_tag(:wf_order_type, options_for_select(@wf_filter.order_type_options, @wf_filter.order_type), {:onChange=>"markDirty()"}) %>
15
+ Per Page:
16
+ <%= select_tag(:wf_per_page, options_for_select(@wf_filter.per_page_options, @wf_filter.per_page), {:onChange=>"markDirty()"}) %>
17
+ &nbsp;&nbsp;<%=link_to_function("<span>Submit Filter</span>", "$('wf_form').submit()", :class => "grey-button pcb") %>
18
+ </div>
19
+ <div>
20
+ <%=link_to_function("<span>+ Add</span>", "wfFilter.addCondition()", :class => "grey-button pcb") %>
21
+ <%=link_to_function("<span>- Clear</span>", "wfFilter.removeAllConditions()", :class => "grey-button pcb") %>
22
+ &nbsp;&nbsp;<span id="wf_loader" class="spinner" style="display:none;"><%=image_tag "/wf/images/spinner.gif", {:style=>"vertical-align:middle"} %> Loading...</span>
23
+ </div>
24
+ </div>
25
+
26
+ <div id="wf_debugger" class="debug" style="display:none;">
27
+ <%= @wf_filter.debug_sql_conditions %>
28
+ </div>
29
+ </div>
30
+ <% end %>
@@ -0,0 +1,32 @@
1
+ <%=will_filter_scripts_tag %>
2
+
3
+ <% form_tag({}, {:method => :get, :name=>'wf_form', :id => 'wf_form', :class => 'wf_form' }) do %>
4
+ <div class="wf_container">
5
+
6
+ <div id="wf_filter_conditions" class="conditions">
7
+ <%= render :partial=> "/wf/filter/conditions", :locals => {:wf_filter => wf_filter} %>
8
+ </div>
9
+
10
+ <div class="wf_footer">
11
+ <div style="float:right">
12
+ <%=link_to_function("Toggle Conditions", "wfFilter.toggleDebugger()", :style=>"font-size:9px") %>
13
+ &nbsp;&nbsp;
14
+ Order:
15
+ <%= select_tag(:wf_order, options_for_select(wf_filter.condition_options, wf_filter.order), {:onChange=>"markDirty()"}) %>
16
+ <%= select_tag(:wf_order_type, options_for_select(wf_filter.order_type_options, wf_filter.order_type), {:onChange=>"markDirty()"}) %>
17
+ Per Page:
18
+ <%= select_tag(:wf_per_page, options_for_select(wf_filter.per_page_options, wf_filter.per_page.to_s), {:onChange=>"markDirty()"}) %>
19
+ &nbsp;&nbsp;<%=link_to_function("<span>Submit Filter</span>", "wfFilter.submit()", :class => "wf_grey_button wf_pcb") %>
20
+ </div>
21
+ <div>
22
+ <%=link_to_function("<span>+ Add</span>", "wfFilter.addCondition()", :class => "wf_grey_button wf_pcb") %>
23
+ <%=link_to_function("<span>- Clear</span>", "wfFilter.removeAllConditions()", :class => "wf_grey_button wf_pcb") %>
24
+ &nbsp;&nbsp;<span id="wf_loader" class="spinner" style="display:none;"><%=image_tag "/wf/images/spinner.gif", {:style=>"vertical-align:middle"} %> Loading...</span>
25
+ </div>
26
+ </div>
27
+
28
+ <div id="wf_debugger" class="wf_debugger" style="display:none;">
29
+ <%= wf_filter.debug_sql_conditions %>
30
+ </div>
31
+ </div>
32
+ <% end %>
@@ -0,0 +1,36 @@
1
+ <%=stylesheet_link_tag("/wf/stylesheets/will_filter.css") -%>
2
+ <%=javascript_include_tag("/wf/javascripts/will_filter.js") -%>
3
+
4
+ <% form_tag({}, {:method => :get, :name=>'wf_form', :id => 'wf_form', :class => 'wf_form' }) do %>
5
+ <div class="will_filter">
6
+
7
+ <div id="wf_filter_conditions" class="conditions">
8
+ <%= render :partial=> "/wf/filter/conditions" %>
9
+ </div>
10
+
11
+ <div class="footer">
12
+ <div style="float:right">
13
+ <%=link_to_function("Toggle Conditions", "wfFilter.toggleDebugger()", :style=>"font-size:9px") %>
14
+ &nbsp;&nbsp;
15
+ Order:
16
+ <%= select_tag(:wf_order, options_for_select(@wf_filter.condition_options, @wf_filter.order), {:onChange=>"markDirty()"}) %>
17
+ <%= select_tag(:wf_order_type, options_for_select(@wf_filter.order_type_options, @wf_filter.order_type), {:onChange=>"markDirty()"}) %>
18
+ Per Page:
19
+ <%= select_tag(:wf_per_page, options_for_select(@wf_filter.per_page_options, @wf_filter.per_page), {:onChange=>"markDirty()"}) %>
20
+ &nbsp;&nbsp;<%=link_to_function("<span>Submit Filter</span>", "$('wf_form').submit()", :class => "grey-button pcb") %>
21
+ </div>
22
+ <div>
23
+ <%=link_to_function("<span>+ Add</span>", "wfFilter.addCondition()", :class => "grey-button pcb") %>
24
+ <%=link_to_function("<span>- Clear</span>", "wfFilter.removeAllConditions()", :class => "grey-button pcb") %>
25
+ &nbsp;&nbsp;<span id="wf_loader" class="spinner" style="display:none;"><%=image_tag "/wf/images/spinner.gif", {:style=>"vertical-align:middle"} %> Loading...</span>
26
+ </div>
27
+ </div>
28
+
29
+ <div id="wf_debugger" class="debug" style="display:none;">
30
+ <%= @wf_filter.debug_sql_conditions %>
31
+ </div>
32
+ </div>
33
+ <% end %>
34
+
35
+ <div id="wf_calendar" style="display:none">
36
+ </div>
@@ -0,0 +1,78 @@
1
+ <%= hidden_field_tag(:mf_id, @model_filter.id) %>
2
+ <%= hidden_field_tag(:mf_name, @model_filter.name) %>
3
+ <%= hidden_field_tag(:mf_model, @model_filter.model_class_name) %>
4
+ <%= hidden_field_tag(:mf_identity_type, @model_filter.identity_type) %>
5
+ <%= hidden_field_tag(:mf_identity_id, @model_filter.identity_id) %>
6
+
7
+ <% if @model_filter.show_save_options? %>
8
+ <table class="mf_header">
9
+ <tr>
10
+ <td class='mf_header_presets'>
11
+ <% if @model_filter.saved_filters.size > 0 %>
12
+ <%= select_tag(:mf_key, options_for_select(@model_filter.saved_filters, @model_filter.key), {:onChange=>"loadPredefinedFilter()"}) %>
13
+ <% end %>
14
+ </td>
15
+ <td class='mf_header_actions'>
16
+ <%=link_to_function("<span>Save As New...</span>", "saveFilter()", :class => "grey-button pcb") %>
17
+ <%=link_to_function("<span>Update</span>", "updateFilter()", :class => "grey-button pcb") %>
18
+ <%=link_to_function("<span>Delete</span>", "deleteFilter()", :class => "grey-button pcb") %>
19
+ </td>
20
+ </tr>
21
+ </table>
22
+ <% end %>
23
+
24
+ <div class="mf_match_header">
25
+ Match
26
+ <%= select_tag(:mf_match, options_for_select(@model_filter.match_options, @model_filter.match), {:onChange=>"markDirty()"}) %>
27
+ of the following conditions:<br>
28
+ </div>
29
+
30
+ <% if @model_filter.errors[:filter] %>
31
+ <div style="padding-left:5px; padding-bottom:5px; color:red">
32
+ <%= @model_filter.errors[:filter] %>
33
+ </div>
34
+ <% end %>
35
+
36
+ <table width="100%" style="margin-top:5px; padding:0px;" cellspacing="0px" cellpadding="0px">
37
+
38
+ <% if @model_filter.size == 0 %>
39
+ <tr>
40
+ <td style="font-style:italic; padding:5px; color: black">
41
+ You haven't added any filter conditions, so all of the results were returned. Use the "Add" button in the bottom left corner to add a new condition or select a predefined filter from a drop-down list above.
42
+ </td>
43
+ </tr>
44
+
45
+ <% else %>
46
+ <%
47
+ 0.upto(@model_filter.size-1) do |index|
48
+ condition = @model_filter.condition_at(index)
49
+ %>
50
+ <% if @model_filter.errors[index] %>
51
+ <tr>
52
+ <td colspan="2">&nbsp;</td>
53
+ <td colspan="2" class="mf_condition_error">
54
+ <%= @model_filter.errors[index] %>
55
+ </td>
56
+ </tr>
57
+ <% end %>
58
+
59
+ <tr>
60
+ <td class="mf_condition">
61
+ <%= select_tag "mf_c_#{index}", options_for_select(@model_filter.condition_options, condition.key.to_s), {:style=>"width:100%", :onChange=>"performFilterAction('changedConditionAt_#{index}')"} %>
62
+ </td>
63
+ <td class="mf_operator">
64
+ <%= select_tag "mf_co_#{index}", options_for_select(@model_filter.operator_options_for(condition.key), condition.operator_key.to_s), {:style=>"width:100%", :onChange=>"performFilterAction('update')"} %>
65
+ </td>
66
+ <td class="mf_container">
67
+ <%= condition.container.render_html(index) %>
68
+ </td>
69
+ <td class="mf_condition_actions">
70
+ <%=link_to_function("<span>-</span>", "performFilterAction('removeConditionAt_#{index}')", :class => "grey-button pcb") %>
71
+ <%=link_to_function("<span>+</span>", "performFilterAction('addConditionAfter_#{index}')", :class => "grey-button pcb") %>
72
+ </td>
73
+ </tr>
74
+
75
+ <% end %>
76
+ <% end %>
77
+
78
+ </table>
@@ -0,0 +1,66 @@
1
+ <% form_tag(:action => :calendar) do %>
2
+ <%=hidden_field_tag :mf_selected_date, @date %>
3
+ <center>
4
+ &nbsp;
5
+ <%=link_to_function("&laquo;", "goToDate('#{@prev_month}', #{(@show_time==true)})", :style=>"font-size:16px;")%>
6
+ &nbsp;&nbsp;&nbsp;
7
+ <%= select_tag("month", options_for_select(@month_options, @month), {:id => "mf_cal_month", :onChange=>"goToDate('', #{(@show_time==true)})"}) %>
8
+ <%= select_tag("year", options_for_select(@year_options, @year), {:id => "mf_cal_year",:onChange=>"goToDate('', #{(@show_time==true)})"}) %>
9
+ &nbsp;&nbsp;&nbsp;
10
+ <%=link_to_function("&raquo", "goToDate('#{@next_month}', #{(@show_time==true)})", :style=>"font-size:16px;")%>
11
+ &nbsp;
12
+ </center>
13
+ <br>
14
+ <table class="calendar_cells">
15
+ <tr>
16
+ <% @days.each_with_index do |day, index| %>
17
+ <td style="text-align:center;color:grey;font-size:10px;">
18
+ <b><%= day %></b>
19
+ </td>
20
+ <% end %>
21
+ </tr>
22
+ <tr>
23
+ <% index = 0 %>
24
+ <% while @start_date <= @end_date do %>
25
+ <% if @start_date.wday == 0 %>
26
+ </tr><tr>
27
+ <% end %>
28
+
29
+ <% 0.upto(6) do |i| %>
30
+ <td valign="top" style="width:100px;border:1px solid #ccc;">
31
+ <% if @start_date.wday == i and @start_date <= @end_date %>
32
+ <% today = (@start_date==Date.today) ? "today" : "" %>
33
+ <% selected = (@start_date == @date and params[:skip_date].blank?) ? "selected" : "" %>
34
+ <% set_date = @show_time ? "" : "setDate();" %>
35
+ <table cellpadding="0px" cellspacing="0px" style="width:100%; background-color:white;">
36
+ <tr>
37
+ <td id="mf_cal_cell_<%=index%>" class="date_cell <%=today%> <%=selected%>" onClick="selectDateValue('<%=index%>', '<%=@start_date%>'); <%=set_date%>">
38
+ <%=@start_date.day %>
39
+ </td>
40
+ </tr>
41
+ </table>
42
+ <% @start_date = @start_date + 1.day %>
43
+ <% index += 1 %>
44
+ <% end %>
45
+ </td>
46
+ <% end %>
47
+ <% end %>
48
+ </tr>
49
+ </table>
50
+
51
+ <% if @show_time %>
52
+ <center>
53
+ <br>
54
+ Time: &nbsp;
55
+ <%= select_tag("mf_cal_hour", options_for_select(@hour_options, @hour)) %>
56
+ :
57
+ <%= select_tag("mf_cal_minute", options_for_select(@minute_options, @minute)) %>
58
+ :
59
+ <%= select_tag("mf_cal_second", options_for_select(@second_options, @second)) %>
60
+ <br><br>
61
+ <%=link_to_function "SET", "setDateTime();", :style => "font-size:14px;" %>
62
+ <br>
63
+ </center>
64
+ <% end %>
65
+
66
+ <% end %>