|
Lines 58-66
Link Here
|
| 58 |
} ); |
58 |
} ); |
| 59 |
} |
59 |
} |
| 60 |
}); |
60 |
}); |
|
|
61 |
|
| 61 |
$("#facet_biblios > table").tableDnD( { |
62 |
$("#facet_biblios > table").tableDnD( { |
| 62 |
onDragClass: "dragClass", |
63 |
onDragClass: "dragClass", |
| 63 |
} ); |
64 |
} ); |
|
|
65 |
|
| 66 |
$('.add-search-field').click(function() { |
| 67 |
var table = $(this).closest('table'); |
| 68 |
var line = $(this).closest("tr"); |
| 69 |
var name = $(line).find('input[data-id="search_field_name"]').val(); |
| 70 |
var label = $(line).find('input[data-id="search_field_name"]').val(); |
| 71 |
if ( name.length > 0 && label.length > 0 ) { |
| 72 |
var new_line = clone_line( line ); |
| 73 |
new_line.appendTo($('table[data-index_name=search_fields]>tbody')); |
| 74 |
$('.delete').click(function() { |
| 75 |
$(this).parents('tr').remove(); |
| 76 |
}); |
| 77 |
clean_line(line); |
| 78 |
|
| 79 |
$(table).tableDnD( { |
| 80 |
onDragClass: "dragClass", |
| 81 |
} ); |
| 82 |
} |
| 83 |
}); |
| 64 |
}); |
84 |
}); |
| 65 |
</script> |
85 |
</script> |
| 66 |
<style> |
86 |
<style> |
|
Lines 161-167
a.add, a.delete {
Link Here
|
| 161 |
[% END %] |
181 |
[% END %] |
| 162 |
</ul> |
182 |
</ul> |
| 163 |
<div id="search_fields"> |
183 |
<div id="search_fields"> |
| 164 |
<table class="search_fields"> |
184 |
<table class="search_fields" data-index_name="search_fields"> |
| 165 |
<thead> |
185 |
<thead> |
| 166 |
<tr> |
186 |
<tr> |
| 167 |
<th>Name</th> |
187 |
<th>Name</th> |
|
Lines 169-174
a.add, a.delete {
Link Here
|
| 169 |
<th>Type</th> |
189 |
<th>Type</th> |
| 170 |
<th colspan="2">Searchable</th> |
190 |
<th colspan="2">Searchable</th> |
| 171 |
<th>Weight</th> |
191 |
<th>Weight</th> |
|
|
192 |
<th></th> |
| 172 |
</tr> |
193 |
</tr> |
| 173 |
<tr> |
194 |
<tr> |
| 174 |
<th colspan=3> </th> |
195 |
<th colspan=3> </th> |
|
Lines 264-272
a.add, a.delete {
Link Here
|
| 264 |
<input type="hidden" name="search_field_weight" value=""> |
285 |
<input type="hidden" name="search_field_weight" value=""> |
| 265 |
[% END %] |
286 |
[% END %] |
| 266 |
</td> |
287 |
</td> |
|
|
288 |
<td> |
| 289 |
[% IF search_field.is_mapped %] |
| 290 |
<a class="btn btn-default btn-xs disabled delete" style="cursor: pointer;"><i class="fa fa-trash"></i> Delete</a> |
| 291 |
[% ELSE %] |
| 292 |
<a class="btn btn-default btn-xs delete" style="cursor: pointer;"><i class="fa fa-trash"></i> Delete</a> |
| 293 |
[% END %] |
| 294 |
</td> |
| 295 |
</td> |
| 267 |
</tr> |
296 |
</tr> |
| 268 |
[% END %] |
297 |
[% END %] |
| 269 |
</tbody> |
298 |
</tbody> |
|
|
299 |
<tfoot> |
| 300 |
<tr> |
| 301 |
<td> |
| 302 |
<input type="text" data-id="search_field_name"/> |
| 303 |
</td> |
| 304 |
<td> |
| 305 |
<input type="text" data-id="search_field_label"/> |
| 306 |
</td> |
| 307 |
<td> |
| 308 |
<select data-id="search_field_type"> |
| 309 |
<option value=""></option> |
| 310 |
<option value="string">String</option> |
| 311 |
<option value="date">Date</option> |
| 312 |
<option value="number">Number</option> |
| 313 |
<option value="boolean">Boolean</option> |
| 314 |
<option value="sum">Sum</option> |
| 315 |
</select> |
| 316 |
</td> |
| 317 |
<td><input type="hidden" name="search_field_weight" value=""></td> |
| 318 |
<td><a class="btn btn-default btn-xs add-search-field"><i class="fa fa-plus"></i> Add</a></td> |
| 319 |
</tr> |
| 320 |
</tfoot> |
| 270 |
</table> |
321 |
</table> |
| 271 |
</div> |
322 |
</div> |
| 272 |
[% FOREACH index IN indexes %] |
323 |
[% FOREACH index IN indexes %] |