will_filter 3.1.2 → 3.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +12 -1
- data/.rspec +2 -1
- data/Gemfile.lock +1 -1
- data/app/assets/stylesheets/will_filter/buttons.css.scss +1 -1
- data/app/assets/stylesheets/will_filter/calendar.css.scss +54 -7
- data/app/assets/stylesheets/will_filter/exporter.css.scss +40 -17
- data/app/assets/stylesheets/will_filter/filter.css.scss +169 -144
- data/app/controllers/will_filter/exporter_controller.rb +3 -10
- data/app/views/will_filter/filter/_condition.html.erb +8 -10
- data/app/views/will_filter/filter/_conditions.html.erb +41 -37
- data/app/views/will_filter/filter/_container.html.erb +28 -22
- data/app/views/will_filter/filter/containers/_boolean.html.erb +1 -1
- data/config/will_filter/config.yml +1 -1
- data/lib/generators/will_filter/templates/config.yml +1 -1
- data/lib/will_filter/version.rb +1 -1
- data/spec/config/config_spec.rb +14 -0
- data/spec/extensions/active_record_extension_spec.rb +40 -0
- data/spec/fake_app.rb +57 -0
- data/spec/spec_helper.rb +24 -23
- data/test/.DS_Store +0 -0
- data/test/dummy/.DS_Store +0 -0
- data/test/dummy/config/will_filter/config.yml +1 -1
- data/test/dummy/db/migrate/20110924023807_create_will_filter_filters.rb +19 -0
- metadata +38 -60
- data/test/dummy/.sass-cache/f9cb1ef521115be73f1c61d3d5d64f66c947af63/buttons.css.scssc +0 -0
- data/test/dummy/.sass-cache/f9cb1ef521115be73f1c61d3d5d64f66c947af63/calendar.css.scssc +0 -0
- data/test/dummy/.sass-cache/f9cb1ef521115be73f1c61d3d5d64f66c947af63/exporter.css.scssc +0 -0
- data/test/dummy/.sass-cache/f9cb1ef521115be73f1c61d3d5d64f66c947af63/filter.css.scssc +0 -0
- data/test/dummy/test/functional/welcome_controller_test.rb +0 -9
- data/test/dummy/test/unit/helpers/welcome_helper_test.rb +0 -4
- data/test/fixtures/will_filter/filters.yml +0 -11
- data/test/functional/will_filter/calendar_controller_test.rb +0 -9
- data/test/functional/will_filter/exporter_controller_test.rb +0 -9
- data/test/functional/will_filter/filter_controller_test.rb +0 -9
- data/test/integration/navigation_test.rb +0 -10
- data/test/unit/helpers/will_filter/calendar_helper_test.rb +0 -6
- data/test/unit/helpers/will_filter/exporter_helper_test.rb +0 -6
- data/test/unit/helpers/will_filter/filter_helper_test.rb +0 -6
- data/test/unit/will_filter/filter_test.rb +0 -9
data/.gitignore
CHANGED
data/.rspec
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
--
|
1
|
+
--color
|
2
|
+
--format=d
|
data/Gemfile.lock
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
* html div#frame .wf_pcb {color: #333; padding-top: 0px; padding-bottom: 0px; text-decoration: none; }
|
12
12
|
|
13
13
|
/* ie 7 hack */
|
14
|
-
*:first-child+html .wf_pcb {color: #333; padding-top: 0px; padding-bottom: 0px; text-decoration: none; }
|
14
|
+
*:first-child + html .wf_pcb {color: #333; padding-top: 0px; padding-bottom: 0px; text-decoration: none; }
|
15
15
|
|
16
16
|
.wf_pcb span {background-position: right -326px; padding-right: 14px; }
|
17
17
|
a.wf_grey_button {background-position: left -219px; padding-top: 3px; }
|
@@ -4,6 +4,12 @@
|
|
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_calendar_trigger {border:0px; padding-left:2px; padding-right:2px;}
|
8
14
|
|
9
15
|
.wf_calendar {
|
@@ -14,6 +20,7 @@
|
|
14
20
|
border-color:#e8e8e8 #bababa #bababa #e8e8e8;
|
15
21
|
padding: 5px;
|
16
22
|
@include rounded-corners(10px);
|
23
|
+
@include shadow(2px 3px 3px 2px rgba(0,0,0,0.6));
|
17
24
|
|
18
25
|
input {
|
19
26
|
border: 1px solid #ccc;
|
@@ -42,14 +49,54 @@
|
|
42
49
|
@include rounded-corners(10px);
|
43
50
|
}
|
44
51
|
|
45
|
-
.wf_calendar_table
|
46
|
-
|
47
|
-
|
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
|
+
}
|
48
99
|
|
49
|
-
.wf_calendar_cells {border:1px dotted #ccc; width:100%; padding:2px; margin:0px; }
|
50
|
-
.wf_calendar_cells td {padding:2px; border: 0px; text-align:center; vertical-align:middle; font-size:8px; color:black; background-color:white;cursor:pointer;}
|
51
|
-
.wf_calendar_title {text-align:center; border-top:1px solid #ccc; border-bottom:1px solid #ccc; background: #eee;}
|
52
|
-
.wf_calendar_date_cell {width:11px; border: 1px solid #ccc; padding:2px; margin:1px; cursor:pointer; vertical-align:middle; text-align:center; background-color:white;}
|
53
100
|
.wf_calendar_date_cell.today {background-color:light-blue; }
|
54
101
|
.wf_calendar_date_cell.selected {background-color:#ccc; }
|
55
102
|
.wf_calendar_date_cell:hover {background-color:#ccc; }
|
@@ -4,6 +4,12 @@
|
|
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_exporter {
|
8
14
|
background-color:#eee;
|
9
15
|
position:absolute;
|
@@ -13,6 +19,40 @@
|
|
13
19
|
border:solid 1px #e8e8e8;
|
14
20
|
border-color:#e8e8e8 #bababa #bababa #e8e8e8;
|
15
21
|
@include rounded-corners(10px);
|
22
|
+
@include shadow(2px 3px 3px 2px rgba(0,0,0,0.6));
|
23
|
+
|
24
|
+
img {
|
25
|
+
border: 0px;
|
26
|
+
}
|
27
|
+
|
28
|
+
input {
|
29
|
+
border: 1px solid #ccc;
|
30
|
+
font-size: 12px;
|
31
|
+
font-family: Arial;
|
32
|
+
@include rounded-corners(10px);
|
33
|
+
}
|
34
|
+
|
35
|
+
select {
|
36
|
+
border: 1px solid #ccc;
|
37
|
+
font-size: 12px;
|
38
|
+
font-family: Arial;
|
39
|
+
background-color:#EDEDED;
|
40
|
+
@include rounded-corners(10px);
|
41
|
+
}
|
42
|
+
|
43
|
+
table {
|
44
|
+
width:100%;
|
45
|
+
border-collapse: collapse;
|
46
|
+
font-size:12px;
|
47
|
+
padding:0px;
|
48
|
+
margin:0px;
|
49
|
+
}
|
50
|
+
|
51
|
+
td {
|
52
|
+
vertical-align:top;
|
53
|
+
padding: 0px;
|
54
|
+
margin: 0px;
|
55
|
+
}
|
16
56
|
}
|
17
57
|
|
18
58
|
.wf_exporter_container {
|
@@ -24,20 +64,3 @@
|
|
24
64
|
border-color:#bababa #e8e8e8 #e8e8e8 #bababa;
|
25
65
|
@include rounded-corners(10px);
|
26
66
|
}
|
27
|
-
|
28
|
-
.wf_exporter img {border: 0px;}
|
29
|
-
.wf_exporter input {
|
30
|
-
border: 1px solid #ccc;
|
31
|
-
font-size: 12px;
|
32
|
-
font-family: Arial;
|
33
|
-
@include rounded-corners(10px);
|
34
|
-
}
|
35
|
-
.wf_exporter select {
|
36
|
-
border: 1px solid #ccc;
|
37
|
-
font-size: 12px;
|
38
|
-
font-family: Arial;
|
39
|
-
background-color:#EDEDED;
|
40
|
-
@include rounded-corners(10px);
|
41
|
-
}
|
42
|
-
.wf_exporter table {width:100%;border-collapse: collapse; font-size:12px; padding:0px; margin:0px;}
|
43
|
-
.wf_exporter td {vertical-align:top; padding: 0px; margin: 0px; }
|
@@ -5,148 +5,173 @@
|
|
5
5
|
}
|
6
6
|
|
7
7
|
.wf_container {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
8
|
+
padding:0px;
|
9
|
+
background:#f1f4f9;
|
10
|
+
margin:0px;
|
11
|
+
margin-bottom:10px;
|
12
|
+
font-size: 12px;
|
13
|
+
font-family: Arial;
|
14
|
+
width: 100%;
|
15
|
+
border:solid 1px #e8e8e8;
|
16
|
+
border-color:#e8e8e8 #bababa #bababa #e8e8e8;
|
17
|
+
@include rounded-corners(10px);
|
18
|
+
|
19
|
+
.spinner {
|
20
|
+
font-size: 10px;
|
21
|
+
|
22
|
+
img {vertical-align:middle;}
|
23
|
+
}
|
24
|
+
|
25
|
+
.debugger {
|
26
|
+
padding:5px;
|
27
|
+
margin:2px;
|
28
|
+
background:white;
|
29
|
+
border:solid 1px #bababa;
|
30
|
+
border-color:#bababa #e8e8e8 #e8e8e8 #bababa;
|
31
|
+
font-size:10px;
|
32
|
+
color: #777;
|
33
|
+
@include rounded-corners(10px);
|
34
|
+
}
|
35
|
+
|
36
|
+
.footer {
|
37
|
+
padding:5px;
|
38
|
+
margin-top:3px;
|
39
|
+
.actions {
|
40
|
+
float:right;
|
41
|
+
}
|
42
|
+
small {font-size:9px;}
|
43
|
+
}
|
44
|
+
|
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
|
+
|
136
|
+
input {
|
137
|
+
border: 1px solid #ccc;
|
138
|
+
font-size: 12px;
|
139
|
+
font-family: Arial;
|
140
|
+
margin:0px;
|
141
|
+
padding: 2px !important;
|
142
|
+
@include rounded-corners(10px);
|
143
|
+
}
|
144
|
+
|
145
|
+
select {
|
146
|
+
border: 1px solid #ccc;
|
147
|
+
font-size: 12px;
|
148
|
+
font-family: Arial;
|
149
|
+
margin:0px;
|
150
|
+
padding: 1px !important;
|
151
|
+
background-color:#EDEDED;
|
152
|
+
@include rounded-corners(10px);
|
153
|
+
}
|
154
|
+
|
155
|
+
a {
|
156
|
+
text-decoration:none;
|
157
|
+
color:#16b;
|
158
|
+
outline:none;
|
159
|
+
border:0px;
|
160
|
+
}
|
161
|
+
|
162
|
+
img {
|
163
|
+
border:0px;
|
164
|
+
}
|
152
165
|
}
|
166
|
+
|
167
|
+
.end {float:right;}
|
168
|
+
.begin {float:left;}
|
169
|
+
.full_width {width:100%;}
|
170
|
+
|
171
|
+
.boolean_container {
|
172
|
+
vertical-align:middle;
|
173
|
+
text-align:left;
|
174
|
+
padding-top:2px;
|
175
|
+
}
|
176
|
+
|
177
|
+
|
@@ -97,15 +97,7 @@ module WillFilter
|
|
97
97
|
end
|
98
98
|
|
99
99
|
def send_csv_data(wf_filter)
|
100
|
-
|
101
|
-
|
102
|
-
# CSV.open(result) do |csv|
|
103
|
-
# csv << ["row", "of", "CSV", "data"]
|
104
|
-
# csv << ["another", "row"]
|
105
|
-
# # ...
|
106
|
-
# end
|
107
|
-
|
108
|
-
CSV::Writer.generate(result) do |csv|
|
100
|
+
csv_string = CSV.generate do |csv|
|
109
101
|
csv << wf_filter.fields
|
110
102
|
wf_filter.results.each do |obj|
|
111
103
|
row = []
|
@@ -116,7 +108,8 @@ module WillFilter
|
|
116
108
|
end
|
117
109
|
end
|
118
110
|
|
119
|
-
send_data
|
111
|
+
send_data csv_string, :type => 'text/csv; charset=utf-8; header=present', :charset => 'utf-8',
|
112
|
+
:disposition => "attachment; filename=results.csv"
|
120
113
|
end
|
121
114
|
end
|
122
115
|
end
|
@@ -1,28 +1,26 @@
|
|
1
1
|
<% if wf_filter.errors[index] %>
|
2
2
|
<tr>
|
3
|
-
<td colspan="2">
|
4
|
-
</td>
|
3
|
+
<td colspan="2"></td>
|
5
4
|
<td>
|
6
5
|
<div class="error">
|
7
6
|
<%= wf_filter.errors[index] %>
|
8
7
|
</div>
|
9
8
|
</td>
|
10
|
-
<td>
|
11
|
-
</td>
|
9
|
+
<td></td>
|
12
10
|
</tr>
|
13
11
|
<% end %>
|
14
12
|
|
15
13
|
<tr>
|
16
|
-
<td class="condition"
|
17
|
-
<%= select_tag "wf_c#{index}", options_for_select(wf_filter.condition_options, condition.key.to_s), {:class=>"wf_input
|
14
|
+
<td class="condition">
|
15
|
+
<%= select_tag "wf_c#{index}", options_for_select(wf_filter.condition_options, condition.key.to_s), {:class=>"wf_input full_width", :onChange=>"wfFilter.updateConditionAt('#{index}')"} %>
|
18
16
|
</td>
|
19
|
-
<td class="operator"
|
20
|
-
<%= select_tag "wf_o#{index}", options_for_select(wf_filter.operator_options_for(condition.key), condition.operator.to_s), {:class=>"wf_input
|
17
|
+
<td class="operator">
|
18
|
+
<%= select_tag "wf_o#{index}", options_for_select(wf_filter.operator_options_for(condition.key), condition.operator.to_s), {:class=>"wf_input full_width", :onChange=>"wfFilter.updateConditionAt('#{index}')"} %>
|
21
19
|
</td>
|
22
|
-
<td class="values"
|
20
|
+
<td class="values">
|
23
21
|
<%= render :partial => "/will_filter/filter/containers/#{condition.container.template_name}", :locals => {:container => condition.container, :index => index} %>
|
24
22
|
</td>
|
25
|
-
<td class="actions"
|
23
|
+
<td class="actions">
|
26
24
|
<%=link_to_function("<span>-</span>".html_safe, "wfFilter.removeConditionAt('#{index}')", :class => "wf_grey_button wf_pcb") %>
|
27
25
|
<%=link_to_function("<span>+</span>".html_safe, "wfFilter.addConditionAfter('#{index}')", :class => "wf_grey_button wf_pcb") %>
|
28
26
|
</td>
|