34 lines
1 KiB
HTML
34 lines
1 KiB
HTML
|
<div style="border:none" id="{{ select_all_name }}">
|
||
|
<div class="original-checkboxes">{{ original_widget }}</div>
|
||
|
{% if empty %}
|
||
|
{{ _('Nothing here.') }}
|
||
|
{% else %}
|
||
|
<label>
|
||
|
<input id="{{ select_all_id }}" name="{{ select_all_name }}"{% if all_selected %} checked{% endif %}
|
||
|
type="checkbox" class="checkall"> {{ _('Check all') }}
|
||
|
</label>
|
||
|
{% endif %}
|
||
|
</div>
|
||
|
<style>
|
||
|
div.original-checkboxes ul {
|
||
|
margin: 0 0 0 2em;
|
||
|
padding: 0;
|
||
|
list-style-type: none;
|
||
|
-moz-columns: 15em 5;
|
||
|
-webkit-columns: 15em 5;
|
||
|
columns: 15em 5
|
||
|
}
|
||
|
|
||
|
div.original-checkboxes ul li {
|
||
|
list-style-type: none;
|
||
|
}
|
||
|
</style>
|
||
|
<script type="text/javascript">
|
||
|
django.jQuery(function ($) {
|
||
|
var box = $('div#' + '{{ select_all_name }}');
|
||
|
var original = box.find('.original-checkboxes');
|
||
|
$('.checkall').click(function () {
|
||
|
original.find(':checkbox').prop('checked', this.checked);
|
||
|
});
|
||
|
});
|
||
|
</script>
|