blob: 4b19aca2e05806213bbc402057ba85a094e5fa3b [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001[define title]User Group: [groupname][end]
2[define category_css]css/ph_list.css[end]
3[include "../framework/header.ezt" "showusergrouptabs"]
4[include "../framework/js-placeholders.ezt"]
5
6<form method="POST" action="edit.do">
7<input type="hidden" name="token" value="[form_token]">
8<div id="colcontrol">
9 <div class="list">
10 [if-any pagination.visible]
11 <div class="pagination">
12 [if-any pagination.prev_url]<a href="[pagination.prev_url]"><b>&lsaquo;</b> Prev</a>[end]
13 Members [pagination.start] - [pagination.last] of [pagination.total_count]
14 [if-any pagination.next_url]<a href="[pagination.next_url]">Next <b>&rsaquo;</b></a>[end]
15 </div>
16 [end]
17 <b>User Group: [groupname]</b>
18 [if-any offer_membership_editing]
19 <input type="button" value="Add members" style="font-size:80%; margin-left:1em"
20 id="add_members_button">
21 <input type="submit" value="Remove members" style="font-size:80%; margin-left:1em"
22 id="removebtn" name="removebtn" disabled="disabled">
23 [# TODO(jrobbins): extra confirmation when removing yourself as group owner.]
24 [end]
25 </div>
26
27 <p>Group type: [group_type]</p>
28
29 <table cellspacing="0" cellpadding="2" border="0" class="results striped vt" id="resultstable" width="100%">
30 <tbody>
31 <tr id="headingrow">
32 [if-any offer_membership_editing]
33 <th style="border-right:0; padding-right:2px">&nbsp;</th>
34 [end]
35 <th style="white-space:nowrap">Member</th>
36 <th style="white-space:nowrap">Role</th>
37 </tr>
38
39 [if-any pagination.visible_results]
40 [for pagination.visible_results]
41 <tr>
42 [if-any offer_membership_editing]
43 <td style="padding-right:2px">
44 <input type="checkbox" name="remove"
45 value="[pagination.visible_results.email]">
46 </td>
47 [end]
48 <td class="id" style="text-align:left">
49 [include "../framework/user-link.ezt" pagination.visible_results]
50 </td>
51 <td style="text-align:left" width="90%">
52 <a href="[pagination.visible_results.profile_url]">[pagination.visible_results.role]</a>
53 </td>
54 </tr>
55 [end]
56 [else]
57 <tr><td colspan="40">
58 This user group has no members.
59 </td></tr>
60 [end]
61
62
63 </tbody>
64 </table>
65</div>
66
67[include "../project/people-add-members-form.ezt" "group"]
68
69</form>
70
71
72[if-any offer_membership_editing]
73 <script type="text/javascript" nonce="[nonce]">
74runOnLoad(function() {
75 function _countChecked(opt_className) {
76 var numChecked = 0;
77 var inputs = document.getElementsByTagName('input');
78 for (var i = 0; i < inputs.length; i++) {
79 var el = inputs[[]i];
80 if (el.type == 'checkbox' && el.name == 'remove' && el.checked &&
81 (!opt_className || opt_className == el.className)) {
82 numChecked++;
83 }
84 }
85 return numChecked;
86 }
87
88 function _enableRemoveButton() {
89 var removeButton = document.getElementById('removebtn');
90 if (_countChecked() > 0) {
91 removeButton.disabled = false;
92 } else {
93 removeButton.disabled = true;
94 }
95 }
96
97 setInterval(_enableRemoveButton, 700);
98
99 $("add_members_button").addEventListener("click", _openAddMembersForm);
100});
101 </script>
102[end]
103
104
105[include "../framework/footer.ezt"]