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
@@ -4,17 +4,22 @@
4
4
  -webkit-border-radius: $radius;
5
5
  }
6
6
 
7
+ @mixin shadow($info) {
8
+ box-shadow: $info;
9
+ -moz-box-shadow: $info;
10
+ -webkit-box-shadow: $info;
11
+ }
12
+
7
13
  .wf_container {
8
14
  padding:0px;
9
- background:#f1f4f9;
10
15
  margin:0px;
11
16
  margin-bottom:10px;
12
17
  font-size: 12px;
13
18
  font-family: Arial;
14
19
  width: 100%;
15
- border:solid 1px #e8e8e8;
16
- border-color:#e8e8e8 #bababa #bababa #e8e8e8;
17
- @include rounded-corners(10px);
20
+ //border:solid 1px #e8e8e8;
21
+ //border-color:#e8e8e8 #bababa #bababa #e8e8e8;
22
+ // @include rounded-corners(3px);
18
23
 
19
24
  .spinner {
20
25
  font-size: 10px;
@@ -25,113 +30,14 @@
25
30
  .debugger {
26
31
  padding:5px;
27
32
  margin:2px;
28
- background:white;
29
33
  border:solid 1px #bababa;
30
- border-color:#bababa #e8e8e8 #e8e8e8 #bababa;
34
+ border-color:#eee;
31
35
  font-size:10px;
32
36
  color: #777;
33
- @include rounded-corners(10px);
37
+ @include rounded-corners(3px);
34
38
  }
35
39
 
36
- .footer {
37
- padding:5px;
38
- margin-top:3px;
39
- .actions {
40
- float:right;
41
- }
42
- small {font-size:9px;}
43
- }
44
40
 
45
- .conditions {
46
- padding:0px;
47
- margin:5px;
48
- .header {
49
- margin:0px;
50
- height:25px;
51
- padding:5px;
52
- }
53
- .body {
54
- padding:5px;
55
- background:white;
56
- border:solid 1px #bababa;
57
- border-color:#bababa #e8e8e8 #e8e8e8 #bababa;
58
- @include rounded-corners(10px);
59
-
60
- .no_filter_hint {
61
- font-style:italic;
62
- padding:5px;
63
- color: black;
64
- }
65
-
66
- .filter_match_type {
67
- padding:5px;
68
- }
69
- }
70
- .condition {
71
- padding-left:5px;
72
- padding-right:2px;
73
- padding-bottom:0px;
74
- width:20%;
75
- white-space:nowrap;
76
- vertical-align: top;
77
- }
78
- .operator {
79
- padding-right:2px;
80
- padding-bottom:0px;
81
- width:15%;
82
- white-space:nowrap;
83
- vertical-align: top;
84
- }
85
- .values {
86
- padding-right:2px;
87
- width:70%;
88
- margin:0px;
89
- vertical-align:top;
90
- }
91
- .actions {
92
- padding-right:5px;
93
- padding-bottom:2px;
94
- white-space:nowrap;
95
- text-align:right;
96
- width:100px;
97
- vertical-align: top;
98
- }
99
- .table {
100
- border:0px;
101
- width:100%;
102
- margin:0px;
103
- padding:0px;
104
- td {
105
- padding: 2px;
106
- vertical-align:top;
107
- white-space:nowrap;
108
- }
109
-
110
- td.actions {padding:0;}
111
- .error {
112
- padding: 2px 10px;
113
- margin:2px;
114
- font-size: 10px;
115
- background-color: #ffeded;
116
- font-family: Arial;
117
- border: 1px #f58a8a solid;
118
- color:#b60e0e;
119
- @include rounded-corners(10px);
120
- }
121
- }
122
-
123
- .values {
124
- border:0px;
125
- width:100%;
126
- margin:0px;
127
- padding:0px;
128
- td {
129
- vertical-align:top;
130
- padding: 0px;
131
- margin: 0px;
132
- }
133
- }
134
- }
135
41
 
136
42
  input {
137
43
  border: 1px solid #ccc;
@@ -139,7 +45,8 @@
139
45
  font-family: Arial;
140
46
  margin:0px;
141
47
  padding: 2px !important;
142
- @include rounded-corners(10px);
48
+ height: 24px;
49
+ @include rounded-corners(3px);
143
50
  }
144
51
 
145
52
  select {
@@ -147,9 +54,8 @@
147
54
  font-size: 12px;
148
55
  font-family: Arial;
149
56
  margin:0px;
57
+ height: 24px;
150
58
  padding: 1px !important;
151
- background-color:#EDEDED;
152
- @include rounded-corners(10px);
153
59
  }
154
60
 
155
61
  a {
@@ -162,6 +68,25 @@
162
68
  img {
163
69
  border:0px;
164
70
  }
71
+
72
+ .select2-container .select2-selection--single {
73
+ height: 25px;
74
+ background: #fbfbfb;
75
+ border-radius: 5px;
76
+ border-color: #dddddd;
77
+ }
78
+
79
+ .select2-container--default .select2-selection--single .select2-selection__rendered {
80
+ line-height: 22px;
81
+ }
82
+
83
+ .select2-container--default .select2-selection--single .select2-selection__arrow b {
84
+ top: 40%;
85
+ }
86
+
87
+ .input-group-addon {
88
+ padding: 4px 10px;
89
+ }
165
90
  }
166
91
 
167
92
  .end {float:right;}
@@ -175,4 +100,376 @@
175
100
  padding-top:2px;
176
101
  }
177
102
 
103
+ .wf_conditions {
104
+ padding:0px;
105
+ margin:0px;
106
+
107
+ .body {
108
+ padding:0px;
109
+
110
+ .no_filter_hint {
111
+ font-style:italic;
112
+ padding:5px;
113
+ color: black;
114
+ }
115
+
116
+ .filter_match_type {
117
+ padding:5px;
118
+ }
119
+ }
120
+ .condition {
121
+ padding-left:5px;
122
+ padding-right:2px;
123
+ padding-bottom:2px;
124
+ width:20%;
125
+ white-space:nowrap;
126
+ vertical-align: top;
127
+ }
128
+ .operator {
129
+ padding-right:2px;
130
+ padding-bottom:0px;
131
+ width:15%;
132
+ white-space:nowrap;
133
+ vertical-align: top;
134
+ }
135
+ .values {
136
+ padding-right:2px;
137
+ width:70%;
138
+ margin:0px;
139
+ vertical-align:top;
140
+ }
141
+ .actions {
142
+ padding-right:5px;
143
+ padding-bottom:2px;
144
+ white-space:nowrap;
145
+ text-align:right;
146
+ width:100px;
147
+ vertical-align: top;
148
+ }
149
+ .table {
150
+ border:0px;
151
+ width:100%;
152
+ margin:0px;
153
+ padding:0px;
154
+ td {
155
+ padding: 2px;
156
+ vertical-align:top;
157
+ white-space:nowrap;
158
+ }
159
+
160
+ td.actions {padding:0; width: 45px;}
161
+ .error {
162
+ padding: 2px 10px;
163
+ margin:2px;
164
+ font-size: 10px;
165
+ background-color: #ffeded;
166
+ font-family: Arial;
167
+ border: 1px #f58a8a solid;
168
+ color:#b60e0e;
169
+ @include rounded-corners(3px);
170
+ }
171
+ }
172
+
173
+ .values {
174
+ border:0px;
175
+ width:100%;
176
+ margin:0px;
177
+ padding:0px;
178
+ td {
179
+ vertical-align:top;
180
+ padding: 0px;
181
+ margin: 0px;
182
+ }
183
+ }
184
+ }
185
+
186
+ .wf_header {
187
+ margin:0px;
188
+ padding:5px;
189
+ padding-bottom:10px;
190
+ height: 30px;
191
+ }
192
+
193
+ .wf_footer {
194
+ padding:5px;
195
+ margin-top:3px;
196
+ .actions {
197
+ float:right;
198
+ }
199
+ small {font-size:9px;}
200
+ }
201
+
202
+
203
+ .wf_actions_bar_yellow {
204
+ margin-top:10px;
205
+ margin-bottom:10px;
206
+ padding:10px;
207
+ background-color: #f9f8f7;
208
+ border-color: #E8E8E8 #BABABA #BABABA #E8E8E8;
209
+ border-style: solid;
210
+ border-width: 1px;
211
+ @include rounded-corners(10px);
212
+ }
213
+
214
+ .wf_actions_bar_blue {
215
+ margin-top:10px;
216
+ margin-bottom:10px;
217
+ padding:10px;
218
+ background-color: #f1f4fa;
219
+ border-color: #E8E8E8 #BABABA #BABABA #E8E8E8;
220
+ border-style: solid;
221
+ border-width: 1px;
222
+ @include rounded-corners(10px);
223
+ }
224
+
225
+
226
+ .wf_calendar_trigger {
227
+ border: 0px;
228
+ padding-left: 2px;
229
+ padding-right: 2px;
230
+ }
231
+
232
+ .wf_calendar {
233
+ background-color: white;
234
+ position: absolute;
235
+ font-size: 10px;
236
+ border: solid 1px #e8e8e8;
237
+ border-color: #e8e8e8 #bababa #bababa #e8e8e8;
238
+ @include rounded-corners(3px);
239
+ @include shadow(1px 2px 2px 1px rgba(0, 0, 0, 0.6));
240
+
241
+ input {
242
+ border: 1px solid #ccc;
243
+ font-size: 12px;
244
+ font-family: Arial;
245
+ @include rounded-corners(3px);
246
+ }
247
+
248
+ select {
249
+ border: 1px solid #ccc;
250
+ font-size: 12px;
251
+ font-family: Arial;
252
+ padding: 2px;
253
+ background-color: #EDEDED;
254
+ @include rounded-corners(10px);
255
+ }
256
+ }
257
+
258
+ .wf_calendar_header {
259
+ font-size: 12px;
260
+ font-weight: bold;
261
+ background: #eee;
262
+ padding: 5px;
263
+ }
264
+
265
+ .wf_calendar_container {
266
+ background-color: white;
267
+ padding: 5px;
268
+ margin: 5px;
269
+ font-size: 10px;
270
+ }
271
+
272
+ .wf_calendar_table {
273
+ width: 100%;
274
+ td {
275
+ padding: 2px;
276
+ margin: 2px;
277
+ text-align: center;
278
+ vertical-align: top;
279
+ }
280
+ img {
281
+ border: 0px;
282
+ }
283
+ }
284
+
285
+ .wf_calendar_cells {
286
+ width: 100%;
287
+ padding: 2px;
288
+ margin: 0px;
289
+ td {
290
+ padding: 4px;
291
+ border: 0px;
292
+ text-align: center;
293
+ vertical-align: middle;
294
+ font-size: 8px;
295
+ color: black;
296
+ background-color: white;
297
+ cursor: pointer;
298
+ }
299
+ }
300
+
301
+ .wf_calendar_title {
302
+ text-align: center;
303
+ background: #eee;
304
+ padding: 3px;
305
+ }
306
+
307
+ .wf_calendar_date_cell {
308
+ border: 1px solid #ccc;
309
+ padding: 4px;
310
+ margin: 1px;
311
+ cursor: pointer;
312
+ vertical-align: middle;
313
+ text-align: center;
314
+ background-color: white;
315
+ }
316
+
317
+ .wf_calendar_date_cell.today {
318
+ background-color: light-blue;
319
+ }
320
+
321
+ .wf_calendar_date_cell.selected {
322
+ background-color: #ccc;
323
+ }
324
+
325
+ .wf_calendar_date_cell:hover {
326
+ background-color: #ccc;
327
+ }
328
+
329
+ /* Exporter */
330
+
331
+ .wf_exporter_header {
332
+ font-size: 12px;
333
+ font-weight: bold;
334
+ margin: 0;
335
+ background: #eee;
336
+ padding: 3px;
337
+ border-bottom: 1px solid #ccc;
338
+
339
+ .close {
340
+ text-decoration: none;
341
+ font-size: 18px;
342
+ color: #888;
343
+ &:hover {
344
+ color: #222;
345
+ }
346
+ }
347
+ }
348
+
349
+ .wf_exporter {
350
+ background-color: white;
351
+ position: absolute;
352
+ width: 230px;
353
+ padding: 0px;
354
+ font-size: 10px;
355
+ border: solid 1px #e8e8e8;
356
+ border-color: #e8e8e8 #bababa #bababa #e8e8e8;
357
+ @include rounded-corners(3px);
358
+ @include shadow(1px 2px 2px 1px rgba(0, 0, 0, 0.6));
359
+
360
+ img {
361
+ border: 0px;
362
+ }
363
+
364
+ input {
365
+ border: 1px solid #ccc;
366
+ font-size: 12px;
367
+ font-family: Arial;
368
+ @include rounded-corners(3px);
369
+ }
370
+
371
+ select {
372
+ border: 1px solid #ccc;
373
+ font-size: 12px;
374
+ font-family: Arial;
375
+ background-color: #EDEDED;
376
+ @include rounded-corners(3px);
377
+ }
378
+
379
+ table {
380
+ width: 100%;
381
+ border-collapse: collapse;
382
+ font-size: 12px;
383
+ padding: 0px;
384
+ margin: 0px;
385
+
386
+ thead tr {
387
+ border-bottom: 1px solid #bababa;
388
+ font-weight: bold;
389
+ }
390
+
391
+ td {
392
+ vertical-align: top;
393
+ padding: 0px;
394
+ margin: 0px;
395
+ }
396
+
397
+ }
398
+
399
+ .center {
400
+ padding-bottom: 5px;
401
+ }
402
+
403
+ }
404
+
405
+ .wf_exporter_container {
406
+ background-color: white;
407
+ padding: 5px;
408
+ margin: 5px;
409
+ font-size: 10px;
410
+ }
411
+
412
+ /* Results Table */
413
+ .wf_paginator { width:100%; margin-bottom: 10px; font-size: 12px; font-family: Arial;}
414
+
415
+ .wf_results_table {
416
+ width: 100%;
417
+ font-size: 12px;
418
+ border: 1px #e5e5e5 solid;
419
+ border-collapse: collapse;
420
+ background-color: white;
421
+ margin-bottom: 10px;
422
+ }
423
+
424
+ .wf_results_table thead th {
425
+ background-color:#F5F5F5;
426
+ border-bottom:1px solid #CCCCCC;
427
+ border-top:1px solid #CCCCCC;
428
+ font-size:12px;
429
+ padding:5px 5px 5px 10px;
430
+ text-align:left;
431
+ white-space:nowrap;
432
+ }
433
+ .wf_results_table th,
434
+ .wf_results_table td {padding-right:10px;padding-left:10px; border-left:1px solid #eee;}
435
+ .wf_results_table td {padding:10px;border-bottom:solid 1px #ddd;vertical-align:top;}
436
+ .wf_results_table th {border-left:1px solid #ccc;padding-right:0px;font-weight:normal}
437
+ .wf_results_table th.first {border-left:none;}
438
+ .wf_results_table th {background: transparent url(sort_bg.gif) repeat-x scroll 0 0;}
439
+
440
+ .wf_results_table th.sortable:hover {background-color:#ddd;}
441
+ .wf_results_table th.sortable:hover .sort_control {display:block;}
442
+ .wf_results_table th.sortable .sort_link {text-decoration:none;;width:100%;display:block;}
443
+
444
+ .wf_results_table th.current_sort {background: transparent url(sort_bg.gif) repeat-x scroll 0 -100px;}
445
+ .wf_results_table th.current_sort .sort_control {display:block;}
446
+ .wf_results_table th.current_sort .sort_link {color:#000}
447
+
448
+ .wf_results_table th.desc .sort_control {display:block;}
449
+ .wf_results_table th.asc .sort_control .up {background: url(sort_arrow_all.gif) -17px 0 no-repeat;}
450
+ .wf_results_table th.desc .sort_control .down {background: url(sort_arrow_all.gif) -17px -13px no-repeat;}
451
+ .wf_results_table td.current_sort {font-weight:bold;border-left:1px solid #ccc;border-right:1px solid #ccc;}
452
+ .wf_results_table tr.data_row:hover {background-color: #eee;}
453
+
454
+ .wf_results_table .sort_title {float:left;}
455
+ .wf_results_table .table_head_container {position:relative;padding-right:20px;}
456
+
457
+ .wf_results_table .edit_location th,
458
+ .wf_results_table .edit_location td {background:none;padding:1px 2px;border:none;font-size:11px;}
459
+ .wf_results_table .edit_location_link {font-size:11px;}
460
+
461
+ .wf_results_table .sort_control {position:absolute;right:21px;margin:-5px -20px -5px 5px;display:none;height:24px;}
462
+ .wf_results_table .sort_control .up {width:17px;height:11px;display:block;background: url(sort_arrow_all.gif) 0 0 no-repeat;}
463
+ .wf_results_table .sort_control .up:hover {width:17px;height:11px;display:block;background: url(sort_arrow_all.gif) -17px 0 no-repeat;}
464
+ .wf_results_table .sort_control .down {width:17px;height:11px;display:block;background: url(sort_arrow_all.gif) 0 -13px no-repeat;}
465
+ .wf_results_table .sort_control .down:hover {width:17px;height:11px;display:block;background: url(sort_arrow_all.gif) -17px -13px no-repeat;}
466
+
467
+ .wf_results_table th .sort_control .up,
468
+ .wf_results_table th .sort_control .down {_height:12px !important;overflow:hidden;}
469
+
470
+ .wf_results_table {width:100%;margin:0}
471
+ .wf_results_table.short {margin-bottom:200px;}
178
472
 
473
+ .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;}
474
+ .wf_results_table th.active {background:url(results_table_th_active.gif) repeat-x;color:#fff;border-left:solid 1px #ccc;border-right:solid 1px #ccc}
475
+ .wf_results_table th.active a {color:#fff;}