Skip to content

Commit 14c3641

Browse files
authored
Merge pull request #389 from newpanjing/dev
Dev
2 parents 545fb0c + 14f55c9 commit 14c3641

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

simpleui/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
def get_version():
5-
return '2021.6.1'
5+
return '2021.8.1'

simpleui/admin.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@ def callback(self, request):
88
post = request.POST
99
action = post.get('_action')
1010
selected = post.get('_selected')
11+
select_across = post.get('select_across')
1112

1213
# call admin
1314
if hasattr(self, action):
1415
func, action, description = self.get_action(action)
1516
# 这里的queryset 会有数据过滤,只包含选中的数据
1617
queryset = self.get_queryset(request)
17-
if selected and selected.split(','):
18-
queryset = queryset.filter(pk__in=selected.split(','))
18+
19+
# 没有选择全部的时候才过滤数据
20+
if select_across == '0':
21+
if selected and selected.split(','):
22+
queryset = queryset.filter(pk__in=selected.split(','))
1923

2024
return func(self, request, queryset)
2125

simpleui/templates/admin/actions.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@
7070
<span class="question">
7171
<a href="#"
7272
onclick="selectAll()"
73-
title="{% trans "Click here to select the objects across all pages" %}">{% blocktrans with cl.result_count as total_count %}
74-
Select all {{ total_count }} {{ module_name }}{% endblocktrans %}</a>
73+
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 %}</a>
7574
</span>
7675
<span class="clear">
7776
<a href="#" onclick="unSelect()">{% trans "Clear selection" %}</a>
@@ -230,6 +229,7 @@
230229
let selecteds = [];
231230
$("#result_list .selected input[name='_selected_action']").each((index, item) => selecteds.push(item.value));
232231
data.append('_selected', selecteds.join(','));
232+
data.append('select_across',document.querySelector("input[name='select_across']").value)
233233
//获取选中的数据
234234

235235
data.append('csrfmiddlewaretoken', document.querySelector('[name="csrfmiddlewaretoken"]').value);

simpleui/templates/admin/login.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
{% if password_reset_url %}
9696

9797
<div class="password-reset-link">
98-
<a class="forgot-password" href="{{ password_reset_url }}">{% translate 'Forgotten your password or username?' %}</a>
98+
<a class="forgot-password" href="{{ password_reset_url }}">{% trans 'Forgotten your password or username?' %}</a>
9999
</div>
100100
{% endif %}
101101
<div class="simpleui-input-inline login-btn">
@@ -109,8 +109,9 @@
109109
</div>
110110
{% endblock %}
111111
{% include 'admin/includes/js-part.html' %}
112-
112+
{% block login_js %}
113113
<script type="text/javascript" src="{% static 'admin/simpleui-x/js/login.js' %}?_=3.3"></script>
114+
{% endblock %}
114115

115116
{% block particles %}
116117
{% if 'SIMPLEUI_LOGIN_PARTICLES'|get_config != False %}

0 commit comments

Comments
 (0)