Skip to content

Commit 6e0d914

Browse files
authored
Merge branch 'master' into gforcada-patch-1
2 parents 8470273 + 1a19527 commit 6e0d914

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

Products/CMFPlone/controlpanel/browser/usergroups_groupmembership.pt

+14-23
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@
4444
Batch python:modules['Products.CMFPlone'].Batch;
4545
resultcount python:len(view.searchResults);
4646
b_size python:resultcount if showAll else 20;
47-
b_start python:0 if showAll or view.newSearch else view.atoi(request.get('b_start',0));
48-
b_start python:b_start if b_start <= resultcount else resultcount - resultcount % b_size;
49-
b_start python:b_start if b_start < resultcount else max(b_start - b_size, 0);
47+
b_start request/b_start|python:0;
48+
b_start python:0 if showAll or view.newSearch else b_start;
5049
portal_url context/portal_url;
5150
groupquery python:view.makeQuery(groupname=view.groupname);
5251
groupkeyquery python:view.makeQuery(key=view.groupname);">
@@ -93,16 +92,12 @@
9392
<thead>
9493
<tr>
9594
<th>
96-
<input class="noborder"
95+
<span class="form-check"><input class="form-check-input toggle-all"
9796
type="checkbox"
98-
src="select_all_icon.png"
9997
name="selectButton"
10098
title="Select all items"
101-
onClick="toggleSelect(this, 'delete:list');"
102-
tal:attributes="src string:$portal_url/select_all_icon.png"
10399
alt="Select all items"
104-
i18n:attributes="title label_select_all_items; alt label_select_all_items;"/>
105-
<!--Remove user from this group-->
100+
i18n:attributes="title label_select_all_items; alt label_select_all_items;"/></span>
106101
</th>
107102
<th i18n:translate="listingheader_user_name">User name</th>
108103
<th i18n:translate="listingheader_email_address">E-mail Address</th>
@@ -113,13 +108,13 @@
113108
<tr tal:condition="python:this_user is not None"
114109
tal:define="oddrow repeat/this_user/odd"
115110
tal:attributes="class python:oddrow and 'odd' or 'even'">
116-
<td class="listingCheckbox">
117-
<input
111+
<td>
112+
<span class="form-check"><input
118113
type="checkbox"
119-
class="noborder notify"
114+
class="noborder notify form-check-input"
120115
name="delete:list"
121116
tal:attributes="value this_user/getId;
122-
disabled python:this_user.canRemoveFromGroup(view.groupname) and default or 'disabled'" />
117+
disabled python:this_user.canRemoveFromGroup(view.groupname) and default or 'disabled'" /></span>
123118
</td>
124119

125120
<tal:block tal:condition="python: view.isGroup(this_user)">
@@ -211,16 +206,12 @@
211206
</thead>
212207
<tbody>
213208
<tr tal:condition="batch">
214-
<th>
215-
<input class="noborder"
209+
<th><span class="form-check"><input class="noborder form-check-input toggle-all"
216210
type="checkbox"
217-
src="select_all_icon.png"
218211
name="selectButton"
219212
title="Select all items"
220-
onClick="toggleSelect(this, 'add:list');"
221-
tal:attributes="src string:$portal_url/select_all_icon.png"
222213
alt="Select all items"
223-
i18n:attributes="title label_select_all_items; alt label_select_all_items;"/>
214+
i18n:attributes="title label_select_all_items; alt label_select_all_items;"/></span>
224215
</th>
225216

226217
<th i18n:translate="listingheader_group_user_name">Group/User name</th>
@@ -232,13 +223,13 @@
232223
tal:condition="python:this_user is not None"
233224
tal:attributes="class python:oddrow and 'odd' or 'even'">
234225

235-
<td class="listingCheckbox">
236-
<input type="checkbox"
237-
class="noborder"
226+
<td>
227+
<span class="form-check"><input type="checkbox"
228+
class="noborder form-check-input"
238229
name="add:list"
239230
value="value"
240231
tal:attributes="value this_user/getId;
241-
disabled python:this_user.canAddToGroup(view.groupname) and default or 'disabled'" />
232+
disabled python:this_user.canAddToGroup(view.groupname) and default or 'disabled'" /></span>
242233
</td>
243234

244235
<td>

Products/CMFPlone/controlpanel/browser/usergroups_groupmembership.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,21 @@ def update(self):
5757
search = form.get('form.button.Search', None) is not None
5858
edit = form.get('form.button.Edit', None) is not None and toDelete
5959
add = form.get('form.button.Add', None) is not None and toAdd
60-
findAll = form.get('form.button.FindAll', None) is not None and \
61-
not self.many_users
60+
isBatched = form.get("b_start", None) is not None
61+
findAll = (
62+
form.get('form.button.FindAll', None) is not None
63+
and not self.many_users
64+
)
65+
unbatchedAll = (
66+
form.get("showAll", "") == "y"
67+
and not self.many_users
68+
)
6269
# The search string should be cleared when one of the
6370
# non-search buttons has been clicked.
64-
if findAll or edit or add:
71+
if findAll or unbatchedAll or edit or add:
6572
form['searchstring'] = ''
6673
self.searchString = form.get('searchstring', '')
67-
if findAll or bool(self.searchString):
74+
if findAll or isBatched or unbatchedAll or bool(self.searchString):
6875
self.searchResults = self.getPotentialMembers(
6976
self.searchString)
7077

news/3738.bugfix

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix userlisting batch/showAll in group membership template.
2+
[petschki]

0 commit comments

Comments
 (0)