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 | $('#users_add_button').click(function() { |
---|
24 | return !$('#out_users option:selected').remove().appendTo('#in_users'); |
---|
25 | }); |
---|
26 | $('#users_remove_button').click(function() { |
---|
27 | return !$('#in_users option:selected').remove().appendTo('#out_users'); |
---|
28 | }); |
---|
29 | $('#groups_add_button').click(function() { |
---|
30 | return !$('#out_groups option:selected').remove().appendTo('#in_groups'); |
---|
31 | }); |
---|
32 | $('#groups_remove_button').click(function() { |
---|
33 | return !$('#in_groups option:selected').remove().appendTo('#out_groups'); |
---|
34 | }); |
---|
35 | $('form#associate_role_user_group').submit(function() { |
---|
36 | $('#in_users option').each(function(i) { |
---|
37 | $(this).attr("selected", "selected"); |
---|
38 | }); |
---|
39 | $('#in_groups 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">Role '${role.name}'</div> |
---|
52 | <div class="toolFormBody"> |
---|
53 | <form name="associate_role_user_group" id="associate_role_user_group" action="${h.url_for( action='manage_users_and_groups_for_role', id=trans.security.encode_id( role.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>Users associated with '${role.name}'</label> |
---|
58 | ${render_select( "in_users", in_users )}<br/> |
---|
59 | <input type="submit" id="users_remove_button" value=">>"/> |
---|
60 | </div> |
---|
61 | <div> |
---|
62 | <label>Users not associated with '${role.name}'</label> |
---|
63 | ${render_select( "out_users", out_users )}<br/> |
---|
64 | <input type="submit" id="users_add_button" value="<<"/> |
---|
65 | </div> |
---|
66 | </div> |
---|
67 | <div class="form-row"> |
---|
68 | <div style="float: left; margin-right: 10px;"> |
---|
69 | <label>Groups associated with '${role.name}'</label> |
---|
70 | ${render_select( "in_groups", in_groups )}<br/> |
---|
71 | <input type="submit" id="groups_remove_button" value=">>"/> |
---|
72 | </div> |
---|
73 | <div> |
---|
74 | <label>Groups not associated with '${role.name}'</label> |
---|
75 | ${render_select( "out_groups", out_groups )}<br/> |
---|
76 | <input type="submit" id="groups_add_button" value="<<"/> |
---|
77 | </div> |
---|
78 | </div> |
---|
79 | <div class="form-row"> |
---|
80 | <input type="submit" name="role_members_edit_button" value="Save"/> |
---|
81 | </div> |
---|
82 | </form> |
---|
83 | </div> |
---|
84 | </div> |
---|
85 | <br clear="left"/> |
---|
86 | <br/> |
---|
87 | %if len( library_dataset_actions ) > 0: |
---|
88 | <h3>Data library datasets associated with role '${role.name}'</h3> |
---|
89 | <table class="manage-table colored" border="0" cellspacing="0" cellpadding="0" width="100%"> |
---|
90 | <tr> |
---|
91 | <td> |
---|
92 | <ul> |
---|
93 | %for ctr, library, in enumerate( library_dataset_actions.keys() ): |
---|
94 | <li> |
---|
95 | <img src="${h.url_for( '/static/images/silk/book_open.png' )}" class="rowIcon"/> |
---|
96 | ${library.name} |
---|
97 | <ul> |
---|
98 | %for folder_path, permissions in library_dataset_actions[ library ].items(): |
---|
99 | <li> |
---|
100 | <img src="/static/images/silk/folder_page.png" class="rowIcon"/> |
---|
101 | ${folder_path} |
---|
102 | <ul> |
---|
103 | % for permission in permissions: |
---|
104 | <ul> |
---|
105 | <li>${permission}</li> |
---|
106 | </ul> |
---|
107 | %endfor |
---|
108 | </ul> |
---|
109 | </li> |
---|
110 | %endfor |
---|
111 | </ul> |
---|
112 | </li> |
---|
113 | %endfor |
---|
114 | </ul> |
---|
115 | </td> |
---|
116 | </tr> |
---|
117 | </table> |
---|
118 | %endif |
---|