Lines 53-61
Link Here
|
53 |
} ); |
53 |
} ); |
54 |
} |
54 |
} |
55 |
}); |
55 |
}); |
|
|
56 |
|
56 |
$("#facet_biblios > table").tableDnD( { |
57 |
$("#facet_biblios > table").tableDnD( { |
57 |
onDragClass: "dragClass", |
58 |
onDragClass: "dragClass", |
58 |
} ); |
59 |
} ); |
|
|
60 |
|
61 |
$('.add-search-field').click(function() { |
62 |
var table = $(this).closest('table'); |
63 |
var line = $(this).closest("tr"); |
64 |
var name = $(line).find('input[data-id="search_field_name"]').val(); |
65 |
var label = $(line).find('input[data-id="search_field_name"]').val(); |
66 |
if ( name.length > 0 && label.length > 0 ) { |
67 |
var new_line = clone_line( line ); |
68 |
new_line.appendTo($('table[data-index_name=search_fields]>tbody')); |
69 |
$('.delete').click(function() { |
70 |
$(this).parents('tr').remove(); |
71 |
}); |
72 |
clean_line(line); |
73 |
|
74 |
$(table).tableDnD( { |
75 |
onDragClass: "dragClass", |
76 |
} ); |
77 |
} |
78 |
}); |
59 |
}); |
79 |
}); |
60 |
</script> |
80 |
</script> |
61 |
<style> |
81 |
<style> |
Lines 154-166
a.add, a.delete {
Link Here
|
154 |
[% END %] |
174 |
[% END %] |
155 |
</ul> |
175 |
</ul> |
156 |
<div id="search_fields"> |
176 |
<div id="search_fields"> |
157 |
<table class="search_fields"> |
177 |
<table class="search_fields" data-index_name="search_fields"> |
158 |
<thead> |
178 |
<thead> |
159 |
<tr> |
179 |
<tr> |
160 |
<th>Name</th> |
180 |
<th>Name</th> |
161 |
<th>Label</th> |
181 |
<th>Label</th> |
162 |
<th>Type</th> |
182 |
<th>Type</th> |
163 |
<th>Weight</th> |
183 |
<th>Weight</th> |
|
|
184 |
<th></th> |
164 |
</tr> |
185 |
</tr> |
165 |
</thead> |
186 |
</thead> |
166 |
<tbody> |
187 |
<tbody> |
Lines 217-225
a.add, a.delete {
Link Here
|
217 |
<input type="hidden" name="search_field_weight" value=""> |
238 |
<input type="hidden" name="search_field_weight" value=""> |
218 |
[% END %] |
239 |
[% END %] |
219 |
</td> |
240 |
</td> |
|
|
241 |
<td> |
242 |
[% IF search_field.is_mapped %] |
243 |
<a class="btn btn-default btn-xs disabled delete" style="cursor: pointer;"><i class="fa fa-trash"></i> Delete</a> |
244 |
[% ELSE %] |
245 |
<a class="btn btn-default btn-xs delete" style="cursor: pointer;"><i class="fa fa-trash"></i> Delete</a> |
246 |
[% END %] |
247 |
</td> |
248 |
</td> |
220 |
</tr> |
249 |
</tr> |
221 |
[% END %] |
250 |
[% END %] |
222 |
</tbody> |
251 |
</tbody> |
|
|
252 |
<tfoot> |
253 |
<tr> |
254 |
<td> |
255 |
<input type="text" data-id="search_field_name"/> |
256 |
</td> |
257 |
<td> |
258 |
<input type="text" data-id="search_field_label"/> |
259 |
</td> |
260 |
<td> |
261 |
<select data-id="search_field_type"> |
262 |
<option value=""></option> |
263 |
<option value="string">String</option> |
264 |
<option value="date">Date</option> |
265 |
<option value="number">Number</option> |
266 |
<option value="boolean">Boolean</option> |
267 |
<option value="sum">Sum</option> |
268 |
</select> |
269 |
</td> |
270 |
<td><input type="hidden" name="search_field_weight" value=""></td> |
271 |
<td><a class="btn btn-default btn-xs add-search-field"><i class="fa fa-plus"></i> Add</a></td> |
272 |
</tr> |
273 |
</tfoot> |
223 |
</table> |
274 |
</table> |
224 |
</div> |
275 |
</div> |
225 |
[% FOREACH index IN indexes %] |
276 |
[% FOREACH index IN indexes %] |