NDOJ/templates/widgets/select_all.html

34 lines
943 B
HTML
Raw Normal View History

2020-01-21 06:35:58 +00:00
<div style="border:none" id="{{ select_all_name }}">
2023-01-27 23:11:10 +00:00
<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 %}
2020-01-21 06:35:58 +00:00
</div>
<style>
2023-01-27 23:11:10 +00:00
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
}
2020-01-21 06:35:58 +00:00
2023-01-27 23:11:10 +00:00
div.original-checkboxes ul li {
list-style-type: none;
}
2020-01-21 06:35:58 +00:00
</style>
<script type="text/javascript">
2023-01-27 23:11:10 +00:00
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);
2020-01-21 06:35:58 +00:00
});
2023-01-27 23:11:10 +00:00
});
2020-01-21 06:35:58 +00:00
</script>