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">Group '${group.name}'</div> |
---|
52 | <div class="toolFormBody"> |
---|
53 | <form name="associate_group_role_user" id="associate_group_role_user" action="${h.url_for( action='manage_users_and_roles_for_group', id=trans.security.encode_id( group.id ) )}" method="post" > |
---|
54 | <input name="webapp" type="hidden" value="${webapp}" size=40"/> |
---|
55 | <div class="form-row"> |
---|
56 | <div style="float: left; margin-right: 10px;"> |
---|
57 | <label>Roles associated with '${group.name}'</label> |
---|
58 | ${render_select( "in_roles", in_roles )}<br/> |
---|
59 | <input type="submit" id="roles_remove_button" value=">>"/> |
---|
60 | </div> |
---|
61 | <div> |
---|
62 | <label>Roles not associated with '${group.name}'</label> |
---|
63 | ${render_select( "out_roles", out_roles )}<br/> |
---|
64 | <input type="submit" id="roles_add_button" value="<<"/> |
---|
65 | </div> |
---|
66 | </div> |
---|
67 | <div class="form-row"> |
---|
68 | <div style="float: left; margin-right: 10px;"> |
---|
69 | <label>Users associated with '${group.name}'</label> |
---|
70 | ${render_select( "in_users", in_users )}<br/> |
---|
71 | <input type="submit" id="users_remove_button" value=">>"/> |
---|
72 | </div> |
---|
73 | <div> |
---|
74 | <label>Users not associated with '${group.name}'</label> |
---|
75 | ${render_select( "out_users", out_users )}<br/> |
---|
76 | <input type="submit" id="users_add_button" value="<<"/> |
---|
77 | </div> |
---|
78 | </div> |
---|
79 | <div class="form-row"> |
---|
80 | <input type="submit" name="group_roles_users_edit_button" value="Save"/> |
---|
81 | </div> |
---|
82 | </form> |
---|
83 | </div> |
---|
84 | </div> |
---|