1 | <%inherit file="/base.mako"/> |
---|
2 | <%namespace file="/message.mako" import="render_msg" /> |
---|
3 | |
---|
4 | <%def name="javascripts()"> |
---|
5 | ${parent.javascripts()} |
---|
6 | <script type="text/javascript"> |
---|
7 | $(function(){ |
---|
8 | $("input:text:first").focus(); |
---|
9 | }) |
---|
10 | </script> |
---|
11 | </%def> |
---|
12 | |
---|
13 | <%def name="render_select( name, options )"> |
---|
14 | <select name="${name}" id="${name}" style="min-width: 250px; height: 150px;" multiple> |
---|
15 | %for option in options: |
---|
16 | <option value="${option[0]}">${option[1]}</option> |
---|
17 | %endfor |
---|
18 | </select> |
---|
19 | </%def> |
---|
20 | |
---|
21 | <script type="text/javascript"> |
---|
22 | $().ready(function() { |
---|
23 | $('#roles_add_button').click(function() { |
---|
24 | return !$('#out_roles option:selected').remove().appendTo('#in_roles'); |
---|
25 | }); |
---|
26 | $('#roles_remove_button').click(function() { |
---|
27 | return !$('#in_roles option:selected').remove().appendTo('#out_roles'); |
---|
28 | }); |
---|
29 | $('#users_add_button').click(function() { |
---|
30 | return !$('#out_users option:selected').remove().appendTo('#in_users'); |
---|
31 | }); |
---|
32 | $('#users_remove_button').click(function() { |
---|
33 | return !$('#in_users option:selected').remove().appendTo('#out_users'); |
---|
34 | }); |
---|
35 | $('form#associate_group_role_user').submit(function() { |
---|
36 | $('#in_roles option').each(function(i) { |
---|
37 | $(this).attr("selected", "selected"); |
---|
38 | }); |
---|
39 | $('#in_users option').each(function(i) { |
---|
40 | $(this).attr("selected", "selected"); |
---|
41 | }); |
---|
42 | }); |
---|
43 | }); |
---|
44 | </script> |
---|
45 | |
---|
46 | %if message: |
---|
47 | ${render_msg( message, status )} |
---|
48 | %endif |
---|
49 | |
---|
50 | <div class="toolForm"> |
---|
51 | <div class="toolFormTitle">Create Group</div> |
---|
52 | <div class="toolFormBody"> |
---|
53 | <form name="associate_group_role_user" id="associate_group_role_user" action="${h.url_for( action='create_group' )}" method="post" > |
---|
54 | <div class="form-row"> |
---|
55 | <input name="webapp" type="hidden" value="${webapp}" size=40"/> |
---|
56 | <label>Name:</label> |
---|
57 | <input name="name" type="textfield" value="" size=40"/> |
---|
58 | </div> |
---|
59 | <div class="form-row"> |
---|
60 | <div style="float: left; margin-right: 10px;"> |
---|
61 | <label>Roles associated with new group</label> |
---|
62 | ${render_select( "in_roles", in_roles )}<br/> |
---|
63 | <input type="submit" id="roles_remove_button" value=">>"/> |
---|
64 | </div> |
---|
65 | <div> |
---|
66 | <label>Roles not associated with new group</label> |
---|
67 | ${render_select( "out_roles", out_roles )}<br/> |
---|
68 | <input type="submit" id="roles_add_button" value="<<"/> |
---|
69 | </div> |
---|
70 | </div> |
---|
71 | <div class="form-row"> |
---|
72 | <div style="float: left; margin-right: 10px;"> |
---|
73 | <label>Users associated with new group</label> |
---|
74 | ${render_select( "in_users", in_users )}<br/> |
---|
75 | <input type="submit" id="users_remove_button" value=">>"/> |
---|
76 | </div> |
---|
77 | <div> |
---|
78 | <label>Users not associated with new group</label> |
---|
79 | ${render_select( "out_users", out_users )}<br/> |
---|
80 | <input type="submit" id="users_add_button" value="<<"/> |
---|
81 | </div> |
---|
82 | </div> |
---|
83 | <div class="form-row"> |
---|
84 | <input type="submit" name="create_group_button" value="Save"/> |
---|
85 | </div> |
---|
86 | </form> |
---|
87 | </div> |
---|
88 | </div> |
---|