Skip to content

Commit d894f52

Browse files
committed
suitable table
1 parent 6133e1c commit d894f52

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

adminlteui/templates/admin/change_list.html

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
{% endif %}
1919
{% endblock %}
2020

21+
{% block custom_style %}
22+
<link rel="stylesheet" href="{% static "admin/plugins/datatables/dataTables.bootstrap.css" %}">
23+
{% endblock %}
24+
2125
{% block extrahead %}
2226
{{ block.super }}
2327
{{ media.js }}
@@ -39,13 +43,6 @@
3943

4044
{% block content %}
4145
<div id="content-main">
42-
{% block object-tools %}
43-
<ul class="object-tools">
44-
{% block object-tools-items %}
45-
{% change_list_object_tools %}
46-
{% endblock %}
47-
</ul>
48-
{% endblock %}
4946
{% if cl.formset and cl.formset.errors %}
5047
<p class="errornote">
5148
{% if cl.formset.total_error_count == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
@@ -54,11 +51,19 @@
5451
{% endif %}
5552
<div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
5653
<div class="row">
57-
{% block date_hierarchy %}{% if cl.date_hierarchy %}{% date_hierarchy cl %}{% endif %}{% endblock %}
54+
{% block date_hierarchy %}{% if cl.date_hierarchy %}{% date_hierarchy cl %}{% endif %}{% endblock %}
55+
56+
{% block search %}{% search_form cl %}{% endblock %}
5857

59-
{% block search %}{% search_form cl %}{% endblock %}
58+
</div>
6059

60+
{% block object-tools %}
61+
<div class="row">
62+
{% block object-tools-items %}
63+
{% change_list_object_tools %}
64+
{% endblock %}
6165
</div>
66+
{% endblock %}
6267

6368
<form id="changelist-form" method="post"{% if cl.formset and cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %} novalidate>{% csrf_token %}
6469
{% if cl.formset %}
@@ -77,6 +82,8 @@
7782
{% endblock %}
7883

7984
{% block custom_js %}
85+
<script src="{% static "admin/plugins/datatables/jquery.dataTables.min.js" %}"></script>
86+
<script src="{% static "admin/plugins/datatables/dataTables.bootstrap.min.js" %}"></script>
8087

8188
<script>
8289
var selectors = document.querySelector('#changelist-search').querySelectorAll('select');
@@ -85,7 +92,6 @@
8592
var $field = $(this);
8693
var $option = $field.find('option:selected');
8794
var select_name = $option.data('name');
88-
console.log(select_name);
8995
if (select_name) {
9096
$field.attr('name', select_name);
9197
} else {
@@ -105,7 +111,7 @@
105111
// }
106112

107113
// remove the hidden input of select_name
108-
var input = document.querySelector('#search_group').querySelector('input[name="' + select_name + '"]');
114+
var input = document.querySelector('#search_group').querySelector('input[name="' + $field.data('name') + '"]');
109115
input.parentNode.removeChild(input)
110116
}
111117
}

0 commit comments

Comments
 (0)