|
1 {assign var="title" value="Groups"} |
|
2 {include file="header.tpl"} |
|
3 |
|
4 <script type="text/javascript"> |
|
5 //<![CDATA[ |
|
6 var users = {$users_json}; |
|
7 //]]> |
|
8 </script> |
|
9 |
|
10 <script type="text/javascript" src="/res/grep.js"></script> |
|
11 <script type="text/javascript" src="/res/group-create-form.js"></script> |
|
12 |
|
13 <h1>Groups</h1> |
|
14 |
|
15 <p>This page allows you to view all the groups in the system, and create, remove, or manage membership of groups as necessary.</p> |
|
16 |
|
17 <div class="pull-right"> |
|
18 <form class="form-search form-inline" onsubmit="return false;"> |
|
19 <input class="search-query grep-filter" type="text" placeholder="Filter groups..." /> |
|
20 </form> |
|
21 </div> |
|
22 <div class="pull-left"> |
|
23 <a href="#groupCreateForm" onclick="return false;" data-toggle="modal" class="btn btn-success"> |
|
24 <i class="icon icon-white icon-plus"></i> |
|
25 Create group |
|
26 </a> |
|
27 </div> |
|
28 <table class="table table-bordered table-striped"> |
|
29 <thead> |
|
30 <tr> |
|
31 <th>UNIX name</th> |
|
32 <th>Description</th> |
|
33 <th>UNIX GID</th> |
|
34 <th>Member count</th> |
|
35 <th class="actions"><i class="icon icon-cog"></i></th> |
|
36 </th> |
|
37 </thead> |
|
38 <tbody class="grep-me"> |
|
39 {foreach $groups as $this_group} |
|
40 <tr> |
|
41 <td class="grep-col">{$this_group['cn']|escape:'html'}</td> |
|
42 <td class="grep-col">{$this_group['description']|escape:'html'}</td> |
|
43 <td>{$this_group['gidNumber']}</td> |
|
44 <td>{if isset($this_group['memberUid'])}{count($this_group['memberUid'])}{else}0{/if}</td> |
|
45 <td class="actions"> |
|
46 <a href="#" onclick="viewGroup('{$this_group['cn']|escape:'html'}'); return false;" class="btn btn-primary btn-mini show-tooltip" title="View group members"> |
|
47 <i class="icon icon-white icon-search"></i> |
|
48 </a> |
|
49 <a href="/groups/delete/{$this_group['cn']|escape:'html'}" class="btn btn-danger btn-mini show-tooltip" title="Delete group"> |
|
50 <i class="icon icon-white icon-trash"></i> |
|
51 </a> |
|
52 </td> |
|
53 </tr> |
|
54 {/foreach} |
|
55 </tbody> |
|
56 </table> |
|
57 |
|
58 <form method="post" action="/groups/create" class="form-horizontal" name="groupCreateForm"> |
|
59 <div class="modal hide fade" id="groupCreateForm"> |
|
60 <div class="modal-header"> |
|
61 <h3>Create new group</h3> |
|
62 </div> |
|
63 <div class="modal-body"> |
|
64 |
|
65 <div class="control-group error"> |
|
66 <label class="control-label">UNIX name:</label> |
|
67 <div class="controls"> |
|
68 <input type="text" name="cn" value="" placeholder="users" /> |
|
69 <p class="help-block">3-32 characters, all lowercase letters and numbers.</p> |
|
70 </div> |
|
71 </div> |
|
72 |
|
73 <div class="control-group"> |
|
74 <label class="control-label">Description:</label> |
|
75 <div class="controls"> |
|
76 <input type="text" name="description" value="" placeholder="" /> |
|
77 <p class="help-block">A brief description of the group.</p> |
|
78 </div> |
|
79 </div> |
|
80 |
|
81 <div class="control-group"> |
|
82 <label class="control-label">UNIX group ID:</label> |
|
83 <div class="controls"> |
|
84 <input type="text" name="gidNumber" value="{$next_gid}" readonly="readonly" /> |
|
85 <p class="help-block">Automatically determined based on available group IDs.</p> |
|
86 </div> |
|
87 </div> |
|
88 |
|
89 </div> |
|
90 <div class="modal-footer"> |
|
91 <input type="submit" class="btn btn-primary" value="Create group" /> |
|
92 <a class="btn" data-dismiss="modal">Cancel</a> |
|
93 </div> |
|
94 </div> |
|
95 </form> |
|
96 |
|
97 <div class="modal hide fade" id="groupViewModal"> |
|
98 <div class="modal-header"> |
|
99 <h3>View group</h3> |
|
100 </div> |
|
101 <div class="modal-body"> |
|
102 <div class="pull-right"> |
|
103 <input data-provide="typeahead" id="groupMemberAdder" type="text" placeholder="Add another member..." /> |
|
104 </div> |
|
105 <h4>Members</h4> |
|
106 <table class="table table-bordered table-striped"> |
|
107 <thead> |
|
108 <tr> |
|
109 <th>Username</th> |
|
110 <th>Name</th> |
|
111 <th class="actions"><i class="icon icon-cog"></i></th> |
|
112 </tr> |
|
113 </thead> |
|
114 <tbody class="put-members-here"> |
|
115 </tbody> |
|
116 </table> |
|
117 </div> |
|
118 <div class="modal-footer"> |
|
119 <a class="btn" data-dismiss="modal">Close</a> |
|
120 </div> |
|
121 </div> |
|
122 |
|
123 {include file="footer.tpl"} |