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 | $('#groups_add_button').click(function() { |
---|
24 | return !$('#out_groups option:selected').remove().appendTo('#in_groups'); |
---|
25 | }); |
---|
26 | $('#groups_remove_button').click(function() { |
---|
27 | return !$('#in_groups option:selected').remove().appendTo('#out_groups'); |
---|
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_role_group_user').submit(function() { |
---|
36 | $('#in_groups 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 Role</div> |
---|
52 | <div class="toolFormBody"> |
---|
53 | <form name="associate_role_group_user" id="associate_role_group_user" action="${h.url_for( action='create_role' )}" 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 | <label>Description:</label> |
---|
61 | <input name="description" type="textfield" value="" size=40"/> |
---|
62 | </div> |
---|
63 | <div class="form-row"> |
---|
64 | <div style="float: left; margin-right: 10px;"> |
---|
65 | <label>Groups associated with new role</label> |
---|
66 | ${render_select( "in_groups", in_groups )}<br/> |
---|
67 | <input type="submit" id="groups_remove_button" value=">>"/> |
---|
68 | </div> |
---|
69 | <div> |
---|
70 | <label>Groups not associated with new role</label> |
---|
71 | ${render_select( "out_groups", out_groups )}<br/> |
---|
72 | <input type="submit" id="groups_add_button" value="<<"/> |
---|
73 | </div> |
---|
74 | </div> |
---|
75 | <div class="form-row"> |
---|
76 | <div style="float: left; margin-right: 10px;"> |
---|
77 | <label>Users associated with new role</label> |
---|
78 | ${render_select( "in_users", in_users )}<br/> |
---|
79 | <input type="submit" id="users_remove_button" value=">>"/> |
---|
80 | </div> |
---|
81 | <div> |
---|
82 | <label>Users not associated with new role</label> |
---|
83 | ${render_select( "out_users", out_users )}<br/> |
---|
84 | <input type="submit" id="users_add_button" value="<<"/> |
---|
85 | </div> |
---|
86 | </div> |
---|
87 | <div class="form-row"> |
---|
88 | <input type="checkbox" name="create_group_for_role" value="yes" />Create a new group of the same name for this role |
---|
89 | </div> |
---|
90 | <div class="form-row"> |
---|
91 | <input type="submit" name="create_role_button" value="Save"/> |
---|
92 | </div> |
---|
93 | </form> |
---|
94 | </div> |
---|
95 | </div> |
---|