Lines 51-56
Link Here
|
51 |
} ); |
51 |
} ); |
52 |
} |
52 |
} |
53 |
}); |
53 |
}); |
|
|
54 |
$('.add-search-field').click(function() { |
55 |
var table = $(this).closest('table'); |
56 |
var line = $(this).closest("tr"); |
57 |
var name = $(line).find('input[data-id="search_field_name"]').val(); |
58 |
var label = $(line).find('input[data-id="search_field_name"]').val(); |
59 |
if ( name.length > 0 && label.length > 0 ) { |
60 |
var new_line = clone_line( line ); |
61 |
new_line.appendTo($('table[data-index_name=search_fields]>tbody')); |
62 |
$('.delete').click(function() { |
63 |
$(this).parents('tr').remove(); |
64 |
}); |
65 |
clean_line(line); |
66 |
|
67 |
$(table).tableDnD( { |
68 |
onDragClass: "dragClass", |
69 |
} ); |
70 |
} |
71 |
}); |
54 |
}); |
72 |
}); |
55 |
</script> |
73 |
</script> |
56 |
<style type="text/css"> |
74 |
<style type="text/css"> |
Lines 128-140
a.add, a.delete {
Link Here
|
128 |
[% END %] |
146 |
[% END %] |
129 |
</ul> |
147 |
</ul> |
130 |
<div id="search_fields"> |
148 |
<div id="search_fields"> |
131 |
<table class="search_fields"> |
149 |
<table class="search_fields" data-index_name="search_fields"> |
132 |
<thead> |
150 |
<thead> |
133 |
<tr> |
151 |
<tr> |
134 |
<th>Name</th> |
152 |
<th>Name</th> |
135 |
<th>Label</th> |
153 |
<th>Label</th> |
136 |
<th>Type</th> |
154 |
<th>Type</th> |
137 |
<th>Weight</th> |
155 |
<th>Weight</th> |
|
|
156 |
<th></th> |
138 |
</tr> |
157 |
</tr> |
139 |
</thead> |
158 |
</thead> |
140 |
<tbody> |
159 |
<tbody> |
Lines 185-193
a.add, a.delete {
Link Here
|
185 |
[% ELSE %] |
204 |
[% ELSE %] |
186 |
<td><input type="hidden" name="search_field_weight" value=""></td> |
205 |
<td><input type="hidden" name="search_field_weight" value=""></td> |
187 |
[% END %] |
206 |
[% END %] |
|
|
207 |
<td> |
208 |
[% IF search_field.is_mapped %] |
209 |
<a class="btn btn-default btn-xs disabled delete" style="cursor: pointer;"><i class="fa fa-trash"></i> Delete</a> |
210 |
[% ELSE %] |
211 |
<a class="btn btn-default btn-xs delete" style="cursor: pointer;"><i class="fa fa-trash"></i> Delete</a> |
212 |
[% END %] |
213 |
</td> |
188 |
</tr> |
214 |
</tr> |
189 |
[% END %] |
215 |
[% END %] |
190 |
</tbody> |
216 |
</tbody> |
|
|
217 |
<tfoot> |
218 |
<tr> |
219 |
<td> |
220 |
<input type="text" data-id="search_field_name"/> |
221 |
</td> |
222 |
<td> |
223 |
<input type="text" data-id="search_field_label"/> |
224 |
</td> |
225 |
<td> |
226 |
<select data-id="search_field_type"> |
227 |
<option value=""></option> |
228 |
<option value="string">String</option> |
229 |
<option value="date">Date</option> |
230 |
<option value="number">Number</option> |
231 |
<option value="boolean">Boolean</option> |
232 |
<option value="sum">Sum</option> |
233 |
</select> |
234 |
</td> |
235 |
<td><input type="hidden" name="search_field_weight" value=""></td> |
236 |
<td><a class="btn btn-default btn-xs add-search-field"><i class="fa fa-plus"></i> Add</a></td> |
237 |
</tr> |
238 |
</tfoot> |
191 |
</table> |
239 |
</table> |
192 |
</div> |
240 |
</div> |
193 |
[% FOREACH index IN indexes %] |
241 |
[% FOREACH index IN indexes %] |