diff --git a/simpleui/__init__.py b/simpleui/__init__.py index d18acb76..9966da7a 100644 --- a/simpleui/__init__.py +++ b/simpleui/__init__.py @@ -2,4 +2,4 @@ def get_version(): - return '2021.6.1' + return '2021.8.1' diff --git a/simpleui/admin.py b/simpleui/admin.py index c9787264..a545307d 100644 --- a/simpleui/admin.py +++ b/simpleui/admin.py @@ -8,14 +8,18 @@ def callback(self, request): post = request.POST action = post.get('_action') selected = post.get('_selected') + select_across = post.get('select_across') # call admin if hasattr(self, action): func, action, description = self.get_action(action) # 这里的queryset 会有数据过滤,只包含选中的数据 queryset = self.get_queryset(request) - if selected and selected.split(','): - queryset = queryset.filter(pk__in=selected.split(',')) + + # 没有选择全部的时候才过滤数据 + if select_across == '0': + if selected and selected.split(','): + queryset = queryset.filter(pk__in=selected.split(',')) return func(self, request, queryset) diff --git a/simpleui/templates/admin/actions.html b/simpleui/templates/admin/actions.html index 542fbe0d..142f46b5 100644 --- a/simpleui/templates/admin/actions.html +++ b/simpleui/templates/admin/actions.html @@ -70,8 +70,7 @@ {% blocktrans with cl.result_count as total_count %} - Select all {{ total_count }} {{ module_name }}{% endblocktrans %} + title="{% trans "Click here to select the objects across all pages" %}">{% blocktrans with cl.result_count as total_count %}Select all {{ total_count }} {{ module_name }}{% endblocktrans %} {% trans "Clear selection" %} @@ -230,6 +229,7 @@ let selecteds = []; $("#result_list .selected input[name='_selected_action']").each((index, item) => selecteds.push(item.value)); data.append('_selected', selecteds.join(',')); + data.append('select_across',document.querySelector("input[name='select_across']").value) //获取选中的数据 data.append('csrfmiddlewaretoken', document.querySelector('[name="csrfmiddlewaretoken"]').value); diff --git a/simpleui/templates/admin/login.html b/simpleui/templates/admin/login.html index 6e586426..1132a24c 100755 --- a/simpleui/templates/admin/login.html +++ b/simpleui/templates/admin/login.html @@ -95,7 +95,7 @@ {% if password_reset_url %} {% endif %}
@@ -109,8 +109,9 @@
{% endblock %} {% include 'admin/includes/js-part.html' %} - +{% block login_js %} +{% endblock %} {% block particles %} {% if 'SIMPLEUI_LOGIN_PARTICLES'|get_config != False %}