will_filter 3.1.11 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/Gemfile +8 -3
  4. data/Gemfile.lock +182 -127
  5. data/README.rdoc +1 -10
  6. data/app/assets/images/will_filter/loading.gif +0 -0
  7. data/app/assets/javascripts/will_filter/filter.js +526 -517
  8. data/app/assets/stylesheets/will_filter/filter.css.scss +405 -108
  9. data/app/controllers/will_filter/calendar_controller.rb +10 -1
  10. data/app/controllers/will_filter/exporter_controller.rb +12 -3
  11. data/app/controllers/will_filter/filter_controller.rb +19 -10
  12. data/app/models/will_filter/filter.rb +254 -203
  13. data/app/views/will_filter/calendar/index.html.erb +55 -43
  14. data/app/views/will_filter/common/_actions_bar.html.erb +3 -3
  15. data/app/views/will_filter/common/_results_table.html.erb +55 -39
  16. data/app/views/will_filter/common/_scripts.html.erb +2 -12
  17. data/app/views/will_filter/exporter/index.html.erb +26 -22
  18. data/app/views/will_filter/filter/_condition.html.erb +25 -9
  19. data/app/views/will_filter/filter/_conditions.html.erb +12 -9
  20. data/app/views/will_filter/filter/_conditions_footer.html.erb +25 -10
  21. data/app/views/will_filter/filter/_conditions_header.html.erb +38 -24
  22. data/app/views/will_filter/filter/_container.html.erb +10 -9
  23. data/app/views/will_filter/filter/containers/_date.html.erb +8 -10
  24. data/app/views/will_filter/filter/containers/_date_range.html.erb +21 -13
  25. data/app/views/will_filter/filter/containers/_date_time.html.erb +8 -10
  26. data/app/views/will_filter/filter/containers/_date_time_range.html.erb +21 -13
  27. data/app/views/will_filter/filter/containers/_list.html.erb +16 -6
  28. data/config/routes.rb +26 -16
  29. data/deploy +63 -0
  30. data/lib/generators/will_filter/templates/config.yml +18 -5
  31. data/lib/generators/will_filter/templates/create_will_filter_filters.rb +12 -1
  32. data/lib/generators/will_filter/will_filter_generator.rb +10 -1
  33. data/lib/tasks/will_filter_tasks.rake +10 -2
  34. data/lib/will_filter.rb +10 -1
  35. data/lib/will_filter/calendar.rb +10 -1
  36. data/lib/will_filter/config.rb +31 -4
  37. data/lib/will_filter/containers/boolean.rb +10 -1
  38. data/lib/will_filter/containers/date.rb +10 -1
  39. data/lib/will_filter/containers/date_range.rb +10 -1
  40. data/lib/will_filter/containers/date_time.rb +10 -1
  41. data/lib/will_filter/containers/date_time_range.rb +10 -1
  42. data/lib/will_filter/containers/double.rb +10 -1
  43. data/lib/will_filter/containers/double_delimited.rb +10 -1
  44. data/lib/will_filter/containers/double_range.rb +10 -1
  45. data/lib/will_filter/containers/filter_list.rb +21 -7
  46. data/lib/will_filter/containers/list.rb +10 -1
  47. data/lib/will_filter/containers/nil.rb +10 -1
  48. data/lib/will_filter/containers/numeric.rb +10 -1
  49. data/lib/will_filter/containers/numeric_delimited.rb +10 -1
  50. data/lib/will_filter/containers/numeric_range.rb +10 -1
  51. data/lib/will_filter/containers/single_date.rb +12 -1
  52. data/lib/will_filter/containers/text.rb +10 -1
  53. data/lib/will_filter/containers/text_delimited.rb +11 -2
  54. data/lib/will_filter/engine.rb +10 -1
  55. data/lib/will_filter/extensions/action_controller_extension.rb +34 -10
  56. data/lib/will_filter/extensions/action_view_extension.rb +12 -3
  57. data/lib/will_filter/extensions/active_record_extension.rb +11 -1
  58. data/lib/will_filter/extensions/active_record_relation_extension.rb +51 -0
  59. data/lib/will_filter/extensions/array_extension.rb +10 -1
  60. data/lib/will_filter/filter_condition.rb +11 -7
  61. data/lib/will_filter/filter_container.rb +10 -1
  62. data/lib/will_filter/filter_exception.rb +10 -1
  63. data/lib/will_filter/railtie.rb +14 -4
  64. data/lib/will_filter/version.rb +11 -2
  65. data/spec/config/config_spec.rb +5 -5
  66. data/spec/models/will_filter/filter_spec.rb +130 -131
  67. data/test/dummy/app/assets/javascripts/application.js +3 -0
  68. data/test/dummy/app/assets/javascripts/bootstrap.js +1951 -0
  69. data/test/dummy/app/assets/javascripts/jquery-2.1.3.min.js +4 -0
  70. data/test/dummy/app/assets/javascripts/select2.min.js +3 -0
  71. data/test/dummy/app/assets/stylesheets/{application.css → application.css.sass} +5 -2
  72. data/test/dummy/app/assets/stylesheets/bootstrap.min.css +7 -0
  73. data/test/dummy/app/assets/stylesheets/select2.min.css +1 -0
  74. data/test/dummy/app/controllers/advanced_controller.rb +4 -4
  75. data/test/dummy/app/controllers/orders_controller.rb +2 -2
  76. data/test/dummy/app/controllers/simple_controller.rb +3 -3
  77. data/test/dummy/app/models/event.rb +1 -1
  78. data/test/dummy/app/models/user.rb +1 -1
  79. data/test/dummy/app/views/common/_events.html.erb +7 -13
  80. data/test/dummy/app/views/common/_menu.html.erb +25 -27
  81. data/test/dummy/app/views/layouts/application.html.erb +3 -5
  82. data/test/dummy/config/environments/development.rb +2 -0
  83. data/test/dummy/config/environments/production.rb +2 -0
  84. data/test/dummy/config/environments/test.rb +2 -0
  85. data/test/dummy/config/initializers/assets.rb +12 -0
  86. data/test/dummy/config/routes.rb +10 -10
  87. data/test/dummy/db/schema.rb +46 -50
  88. data/will_filter.gemspec +3 -3
  89. metadata +39 -44
  90. data/.rvmrc +0 -1
  91. data/app/assets/javascripts/will_filter/filter_prototype_effects.js +0 -38
  92. data/app/assets/stylesheets/will_filter/actions.css.scss +0 -27
  93. data/app/assets/stylesheets/will_filter/buttons.css.scss +0 -24
  94. data/app/assets/stylesheets/will_filter/calendar.css.scss +0 -102
  95. data/app/assets/stylesheets/will_filter/exporter.css.scss +0 -89
  96. data/app/assets/stylesheets/will_filter/results.css.scss +0 -63
  97. data/app/views/layouts/will_filter/application.html.erb +0 -14
  98. data/test/dummy/app/assets/javascripts/orders.js +0 -2
  99. data/test/dummy/app/assets/stylesheets/orders.css +0 -4
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm use 1.9.2@will_filter --create
@@ -1,38 +0,0 @@
1
- /****************************************************************************
2
- # Copyright (c) 2010-2012 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
- }
@@ -1,27 +0,0 @@
1
- @mixin rounded-corners($radius) {
2
- border-radius: $radius;
3
- -moz-border-radius: $radius;
4
- -webkit-border-radius: $radius;
5
- }
6
-
7
- .wf_actions_bar_yellow {
8
- margin-top:10px;
9
- margin-bottom:10px;
10
- padding:10px;
11
- background-color: #f9f8f7;
12
- border-color: #E8E8E8 #BABABA #BABABA #E8E8E8;
13
- border-style: solid;
14
- border-width: 1px;
15
- @include rounded-corners(10px);
16
- }
17
-
18
- .wf_actions_bar_blue {
19
- margin-top:10px;
20
- margin-bottom:10px;
21
- padding:10px;
22
- background-color: #f1f4fa;
23
- border-color: #E8E8E8 #BABABA #BABABA #E8E8E8;
24
- border-style: solid;
25
- border-width: 1px;
26
- @include rounded-corners(10px);
27
- }
@@ -1,24 +0,0 @@
1
- /*
2
- Pure CSS Buttons.
3
- Learn more ~ http://www.halmatferello.com/lab/pure-css-buttons/
4
-
5
- Licensed under GPL and MIT.
6
- */
7
- .wf_pcb, .wf_pcb span {background: url('/assets/will_filter/buttons.png') no-repeat; height: 23px; line-height: 23px; padding: 3px 0 7px 0; }
8
- .wf_pcb, a.wf_pcb:link, a.wf_pcb:visited {color: #333; font-size: 12px; font-style:bold; font-family:arial; padding-left: 14px; text-decoration: none !important; }
9
-
10
- /* ie 6 hack */
11
- * html div#frame .wf_pcb {color: #333; padding-top: 0px; padding-bottom: 0px; text-decoration: none; }
12
-
13
- /* ie 7 hack */
14
- *:first-child + html .wf_pcb {color: #333; padding-top: 0px; padding-bottom: 0px; text-decoration: none; }
15
-
16
- .wf_pcb span {background-position: right -326px; padding-right: 14px; }
17
- a.wf_grey_button {background-position: left -219px; padding-top: 3px; }
18
- a.wf_grey_button span {background-position: right -545px; padding-top: 3px; }
19
- a.wf_grey_button:hover {background-position: left -246px; }
20
- a.wf_grey_button:hover span {background-position: right -572px; }
21
- a.wf_grey_button:active, .grey_active_button {background-position: left -273px; }
22
- a.wf_grey_button:active span, .grey_active_button span {background-position: right -599px; }
23
- body.wf_grey_disabled_button {background-position: left -300px; color: #bbb !important; }
24
- body.wf_grey_disabled_button span {background-position: right -626px; }
@@ -1,102 +0,0 @@
1
- @mixin rounded-corners($radius) {
2
- border-radius: $radius;
3
- -moz-border-radius: $radius;
4
- -webkit-border-radius: $radius;
5
- }
6
-
7
- @mixin shadow($info) {
8
- box-shadow:$info;
9
- -moz-box-shadow:$info;
10
- -webkit-box-shadow:$info;
11
- }
12
-
13
- .wf_calendar_trigger {border:0px; padding-left:2px; padding-right:2px;}
14
-
15
- .wf_calendar {
16
- background-color:#eee;
17
- position:absolute;
18
- font-size:10px;
19
- border:solid 1px #e8e8e8;
20
- border-color:#e8e8e8 #bababa #bababa #e8e8e8;
21
- padding: 5px;
22
- @include rounded-corners(10px);
23
- @include shadow(2px 3px 3px 2px rgba(0,0,0,0.6));
24
-
25
- input {
26
- border: 1px solid #ccc;
27
- font-size: 12px;
28
- font-family: Arial;
29
- @include rounded-corners(10px);
30
- }
31
-
32
- select {
33
- border: 1px solid #ccc;
34
- font-size: 12px;
35
- font-family: Arial;
36
- padding:2px;
37
- background-color:#EDEDED;
38
- @include rounded-corners(10px);
39
- }
40
- }
41
-
42
- .wf_calendar_container {
43
- background-color:white;
44
- padding: 5px;
45
- margin: 5px;
46
- font-size:10px;
47
- border:solid 1px #bababa;
48
- border-color:#bababa #e8e8e8 #e8e8e8 #bababa;
49
- @include rounded-corners(10px);
50
- }
51
-
52
- .wf_calendar_table {
53
- width:100%;
54
- td {
55
- padding:2px;
56
- margin:2px;
57
- text-align:center;
58
- vertical-align:top;
59
- }
60
- img {
61
- border: 0px;
62
- }
63
- }
64
-
65
- .wf_calendar_cells {
66
- border:1px dotted #ccc;
67
- width:100%;
68
- padding:2px;
69
- margin:0px;
70
- td {
71
- padding:2px;
72
- border: 0px;
73
- text-align:center;
74
- vertical-align:middle;
75
- font-size:8px;
76
- color:black;
77
- background-color:white;
78
- cursor:pointer;
79
- }
80
- }
81
-
82
- .wf_calendar_title {
83
- text-align:center;
84
- border-top:1px solid #ccc;
85
- border-bottom:1px solid #ccc;
86
- background: #eee;
87
- }
88
-
89
- .wf_calendar_date_cell {
90
- width:11px;
91
- border: 1px solid #ccc;
92
- padding:2px;
93
- margin:1px;
94
- cursor:pointer;
95
- vertical-align:middle;
96
- text-align:center;
97
- background-color:white;
98
- }
99
-
100
- .wf_calendar_date_cell.today {background-color:light-blue; }
101
- .wf_calendar_date_cell.selected {background-color:#ccc; }
102
- .wf_calendar_date_cell:hover {background-color:#ccc; }
@@ -1,89 +0,0 @@
1
- @mixin rounded-corners($radius) {
2
- border-radius: $radius;
3
- -moz-border-radius: $radius;
4
- -webkit-border-radius: $radius;
5
- }
6
-
7
- @mixin shadow($info) {
8
- box-shadow:$info;
9
- -moz-box-shadow:$info;
10
- -webkit-box-shadow:$info;
11
- }
12
-
13
- .wf_exporter_header {
14
- font-size:12px;
15
- font-weight:bold;
16
- margin:0 10px;
17
-
18
- .close {
19
- text-decoration:none;
20
- font-size:18px;
21
- color:#888;
22
- &:hover { color:#222;}
23
- }
24
- }
25
-
26
- .wf_exporter {
27
- background-color:#eee;
28
- position:absolute;
29
- width:230px;
30
- padding: 5px;
31
- font-size:10px;
32
- border:solid 1px #e8e8e8;
33
- border-color:#e8e8e8 #bababa #bababa #e8e8e8;
34
- @include rounded-corners(10px);
35
- @include shadow(2px 3px 3px 2px rgba(0,0,0,0.6));
36
-
37
- img {
38
- border: 0px;
39
- }
40
-
41
- input {
42
- border: 1px solid #ccc;
43
- font-size: 12px;
44
- font-family: Arial;
45
- @include rounded-corners(10px);
46
- }
47
-
48
- select {
49
- border: 1px solid #ccc;
50
- font-size: 12px;
51
- font-family: Arial;
52
- background-color:#EDEDED;
53
- @include rounded-corners(10px);
54
- }
55
-
56
- table {
57
- width:100%;
58
- border-collapse: collapse;
59
- font-size:12px;
60
- padding:0px;
61
- margin:0px;
62
-
63
- thead tr {
64
- border-bottom:1px solid #bababa;
65
- font-weight:bold;
66
- }
67
-
68
- td {
69
- vertical-align:top;
70
- padding: 0px;
71
- margin: 0px;
72
- }
73
-
74
- }
75
-
76
- .center { padding-bottom: 5px;}
77
-
78
- }
79
-
80
- .wf_exporter_container {
81
- background-color:white;
82
- padding: 5px;
83
- margin: 5px;
84
- font-size:10px;
85
- border:solid 1px #bababa;
86
- border-color:#bababa #e8e8e8 #e8e8e8 #bababa;
87
- @include rounded-corners(10px);
88
- }
89
-
@@ -1,63 +0,0 @@
1
- .wf_paginator { width:100%; margin-bottom: 10px; font-size: 12px; font-family: Arial;}
2
-
3
- .wf_results_table {
4
- width: 100%;
5
- font-size: 12px;
6
- border: 1px #e5e5e5 solid;
7
- border-collapse: collapse;
8
- background-color: white;
9
- margin-bottom: 10px;
10
- }
11
-
12
- .wf_results_table thead th {
13
- background-color:#F5F5F5;
14
- border-bottom:1px solid #CCCCCC;
15
- border-top:1px solid #CCCCCC;
16
- font-size:12px;
17
- padding:5px 5px 5px 10px;
18
- text-align:left;
19
- white-space:nowrap;
20
- }
21
- .wf_results_table th,
22
- .wf_results_table td {padding-right:10px;padding-left:10px; border-left:1px solid #eee;}
23
- .wf_results_table td {padding:10px;border-bottom:solid 1px #ddd;vertical-align:top;}
24
- .wf_results_table th {border-left:1px solid #ccc;padding-right:0px;font-weight:normal}
25
- .wf_results_table th.first {border-left:none;}
26
- .wf_results_table th {background: transparent url(/assets/will_filter/sort_bg.gif) repeat-x scroll 0 0;}
27
-
28
- .wf_results_table th.sortable:hover {background-color:#ddd;}
29
- .wf_results_table th.sortable:hover .sort_control {display:block;}
30
- .wf_results_table th.sortable .sort_link {text-decoration:none;;width:100%;display:block;}
31
-
32
- .wf_results_table th.current_sort {background: transparent url(/assets/will_filter/sort_bg.gif) repeat-x scroll 0 -100px;}
33
- .wf_results_table th.current_sort .sort_control {display:block;}
34
- .wf_results_table th.current_sort .sort_link {color:#000}
35
-
36
- .wf_results_table th.desc .sort_control {display:block;}
37
- .wf_results_table th.asc .sort_control .up {background: url(/assets/will_filter/sort_arrow_all.gif) -17px 0 no-repeat;}
38
- .wf_results_table th.desc .sort_control .down {background: url(/assets/will_filter/sort_arrow_all.gif) -17px -13px no-repeat;}
39
- .wf_results_table td.current_sort {font-weight:bold;border-left:1px solid #ccc;border-right:1px solid #ccc;}
40
- .wf_results_table tr.data_row:hover {background-color: #eee;}
41
-
42
- .wf_results_table .sort_title {float:left;}
43
- .wf_results_table .table_head_container {position:relative;padding-right:20px;}
44
-
45
- .wf_results_table .edit_location th,
46
- .wf_results_table .edit_location td {background:none;padding:1px 2px;border:none;font-size:11px;}
47
- .wf_results_table .edit_location_link {font-size:11px;}
48
-
49
- .wf_results_table .sort_control {position:absolute;right:21px;margin:-5px -20px -5px 5px;display:none;height:24px;}
50
- .wf_results_table .sort_control .up {width:17px;height:11px;display:block;background: url(/assets/will_filter/sort_arrow_all.gif) 0 0 no-repeat;}
51
- .wf_results_table .sort_control .up:hover {width:17px;height:11px;display:block;background: url(/assets/will_filter/sort_arrow_all.gif) -17px 0 no-repeat;}
52
- .wf_results_table .sort_control .down {width:17px;height:11px;display:block;background: url(/assets/will_filter/sort_arrow_all.gif) 0 -13px no-repeat;}
53
- .wf_results_table .sort_control .down:hover {width:17px;height:11px;display:block;background: url(/assets/will_filter/sort_arrow_all.gif) -17px -13px no-repeat;}
54
-
55
- .wf_results_table th .sort_control .up,
56
- .wf_results_table th .sort_control .down {_height:12px !important;overflow:hidden;}
57
-
58
- .wf_results_table {width:100%;margin:0}
59
- .wf_results_table.short {margin-bottom:200px;}
60
-
61
- .wf_results_table thead th {padding:5px 5px 5px 10px;text-align:left;font-size:12px;border-bottom:solid 1px #ccc;border-top:solid 1px #eee;background-color:#f5f5f5;white-space:nowrap;}
62
- .wf_results_table th.active {background:url(/assets/will_filter/results_table_th_active.gif) repeat-x;color:#fff;border-left:solid 1px #ccc;border-right:solid 1px #ccc}
63
- .wf_results_table th.active a {color:#fff;}
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>WillFilter</title>
5
- <%= stylesheet_link_tag "will_filter/application" %>
6
- <%= javascript_include_tag "will_filter/application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
@@ -1,2 +0,0 @@
1
- // Place all the behaviors and hooks related to the matching controller here.
2
- // All this logic will automatically be available in application.js.
@@ -1,4 +0,0 @@
1
- /*
2
- Place all the styles related to the matching controller here.
3
- They will automatically be included in application.css.
4
- */