blob: 14bdf5732713d06f8e7c216f752a3efbd50c2379 [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001[define title]User Groups[end]
2[define category_css]css/ph_list.css[end]
3[include "../framework/header.ezt" "hidetabs"]
4[include "../framework/js-placeholders.ezt"]
5
6<form method="POST" action='/hosting/deleteGroup.do'>
7<input type="hidden" name="token" value="[form_token]">
8<div id="colcontrol">
9 <div class="list">
10 <b>User Groups</b>
11 [if-any offer_group_deletion]
12 <input type="submit" value="Delete Groups" style="margin-left:1em"
13 id="removebtn" name="removebtn" disabled="disabled">
14 [end]
15 [if-any offer_group_creation]
16 <a href="/hosting/createGroup" class="buttonify" style="margin-left:1em">Create Group</a>
17 [end]
18 </div>
19
20 <table cellspacing="0" cellpadding="2" border="0" class="results striped" id="resultstable" width="100%">
21 <tbody>
22 [if-any groups]
23
24 <tr id="headingrow">
25 [if-any offer_group_deletion]
26 <th style="border-right:0; padding-right:2px" width="2%">&nbsp;</th>
27 [end]
28 <th style="white-space:nowrap">Name</th>
29 <th style="white-space:nowrap">Size</th>
30 <th style="white-space:nowrap">Member list visibility</th>
31 </tr>
32
33 [for groups]
34 <tr>
35 [if-any offer_group_deletion]
36 <td style="padding-right:2px" width="2%">
37 <input type="checkbox" name="remove"
38 value="[groups.group_id]">
39 </td>
40 [end]
41 <td class="id" style="text-align:left"><a href="[groups.detail_url]">[groups.name]</a></td>
42 <td><a href="[groups.detail_url]">[groups.num_members]</a></td>
43 <td><a href="[groups.detail_url]">[groups.who_can_view_members]</a></td>
44 </tr>
45 [end]
46
47 [else]
48 <tr>
49 <td colspan="40" class="id">
50 <div style="padding: 3em; text-align: center">
51 No user groups have been defined.
52 </div>
53 </td>
54 </tr>
55 [end]
56
57
58 </tbody>
59 </table>
60</div>
61
62</form>
63
64[if-any offer_group_deletion]
65 <script type="text/javascript" nonce="[nonce]">
66runOnLoad(function() {
67 function _countChecked(opt_className) {
68 var numChecked = 0;
69 var inputs = document.getElementsByTagName('input');
70 for (var i = 0; i < inputs.length; i++) {
71 var el = inputs[[]i];
72 if (el.type == 'checkbox' && el.name == 'remove' && el.checked &&
73 (!opt_className || opt_className == el.className)) {
74 numChecked++;
75 }
76 }
77 return numChecked;
78 }
79
80 function _enableRemoveButton() {
81 var removeButton = document.getElementById('removebtn');
82 if (_countChecked() > 0) {
83 removeButton.disabled = false;
84 } else {
85 removeButton.disabled = true;
86 }
87 }
88
89 setInterval(_enableRemoveButton, 700);
90
91});
92 </script>
93[end]
94
95[include "../framework/footer.ezt"]