1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
6 <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
7 <title>Local roles macros</title>
8 <link href="../patch_skins/zpt_stylesheet.css" rel="stylesheet" media="screen" />
9 <link href="../content/plinn_style.css" rel="stylesheet" media="screen" />
12 <body i18n:domain="plinn">
13 <pre>local_roles_summary</pre>
15 <div metal:define-macro="local_roles_summary" tal:omit-tag="">
16 <div tal:repeat="role here/valid_roles">
17 <div tal:define="allMembersInRole python:here.getAllMembersInRole(role)" tal:condition="allMembersInRole" tal:omit-tag="">
18 <div tal:content="role" i18n:translate="">Role</div>
20 <li tal:repeat="member allMembersInRole" tal:content="member/getMemberFullName">member</li>
25 <pre>assign_members</pre>
27 <table metal:define-macro="assign_members"
28 tal:define="candidateRoles python:mtool.getCandidateLocalRoles(here);
29 rRole request/roleToManage | nothing ;
30 currentManagedRole python:here.getOrSetSessionVar('roleToManage', rRole, candidateRoles and candidateRoles[0] or '') ;
31 currentManagedRole python: (currentManagedRole in candidateRoles) and currentManagedRole or candidateRoles[0] ;
32 usersAndGroupsWithLocalRole python:here.users_with_local_role(currentManagedRole) ;
33 prefix here/acl_users/getGroupPrefix ;
34 usersWithLocalRole python:[ u for u in usersAndGroupsWithLocalRole if not u.startswith(prefix) ] ;
35 insideList python:mtool.getMembers(usersWithLocalRole) ;
36 outsideList python:mtool.getOtherMembers(usersWithLocalRole)">
38 <th i18n:translate="">
39 Current Role: "<span i18n:name="current_role" tal:content="currentManagedRole" i18n:translate="">Manager</span>"
42 <form action="." method="get" tal:attributes="action python:'%s/%s' % (here.absolute_url(), template.id)">
43 <select name="roleToManage" size="1" id="roleSelector">
44 <option tal:repeat="role candidateRoles" value="role" tal:content="role" tal:attributes="value role ; selected python:role == currentManagedRole" i18n:translate="">Manager</option>
45 </select> <noscript><input type="submit" value="ok" i18n:attributes="value" /></noscript>
47 <script type="text/javascript">
49 addListener(document.getElementById('roleSelector'), 'change',
51 var selector = getTargetedObject(evt);
52 var fm = new FormManager(selector.form);
62 <form action="." method="post" tal:attributes="action here/absolute_url">
63 <input type="hidden" name="role" value="Manager" tal:attributes="value currentManagedRole" /><input type="hidden" name="redirect" value="." tal:attributes="value template/id" />
66 <th i18n:translate="">
72 <th i18n:translate="">
78 <select name="append_members:list" size="20" multiple="multiple" tal:condition="outsideList">
79 <option value="one" tal:repeat="member outsideList"
80 tal:attributes="value member/getId"
81 tal:content="member/getMemberFullName">NAME Surname or login</option>
83 <div class="info_message" tal:condition="not:outsideList" i18n:translate="">
84 No more member available for the <span tal:content="currentManagedRole" i18n:name="role" i18n:translate="" tal:omit-tag="">Manager</span> role in this folder
87 <td class="twins_list">
88 <input tal:condition="outsideList" type="submit" name="append_users_in_local_role:method" value=">>>" /><br />
90 <input tal:condition="insideList" type="submit" name="remove_users_in_local_role:method" value="<<<" />
93 <select name="remove_members:list" size="20" multiple="multiple" tal:condition="insideList">
94 <option tal:repeat="member insideList" value="one"
95 tal:attributes="value member/getId"
96 tal:content="member/getMemberFullName">NAME Surname or login</option>
98 <div class="info_message" tal:condition="not:insideList" i18n:translate="">
99 Nobody have got the <span tal:content="currentManagedRole" i18n:name="role" i18n:translate="" tal:omit-tag="">Manager</span> role in this folder
108 <pre>assign_groups</pre>
110 <table metal:define-macro="assign_groups"
111 tal:define="candidateRoles python:mtool.getCandidateLocalRoles(here);
112 gtool here/portal_groups ;
113 group_prefix here/acl_users/getGroupPrefix ;
114 prefixLength python:len(group_prefix) ;
115 rRole request/roleToManage | nothing ;
116 currentManagedRole python:here.getOrSetSessionVar('roleToManage', rRole, candidateRoles and candidateRoles[0] or '') ;
117 currentManagedRole python: (currentManagedRole in candidateRoles) and currentManagedRole or candidateRoles[0] ;
118 groupNames python:gtool.getGroupsWithLocalRole(here, currentManagedRole);
119 insideList python:gtool.getGroups(groupNames) ;
120 outsideList python:gtool.getOtherGroups(groupNames)">
122 <th i18n:translate="">Current Role: "<span i18n:name="current_role" tal:content="currentManagedRole" i18n:translate="">Manager</span>"</th>
124 <form action="." method="get" tal:attributes="action python:'%s/%s' % (here.absolute_url(), template.id)" id="local_role_selector">
125 <select name="roleToManage" size="1" id="roleSelector">
126 <option tal:repeat="role candidateRoles" value="role" tal:content="role" tal:attributes="value role ; selected python:role == currentManagedRole" i18n:translate="">Manager</option>
127 </select> <noscript><input type="submit" value="ok" i18n:attributes="value" /></noscript>
129 <script type="text/javascript">
131 addListener(document.getElementById('roleSelector'), 'change',
133 var selector = getTargetedObject(evt);
134 var fm = new FormManager(selector.form);
144 <form action="." method="post" tal:attributes="action here/absolute_url">
145 <input type="hidden" name="role" value="Manager" tal:attributes="value currentManagedRole" /><input type="hidden" name="redirect" value="." tal:attributes="value template/id" />
148 <th i18n:translate="">Haven't role</th>
150 <th i18n:translate="">Have role</th>
154 <select name="append_members:list" size="20" multiple="multiple" tal:condition="outsideList">
155 <option value="one" tal:repeat="member outsideList"
156 tal:attributes="value member/id"
157 tal:content="python:member.title or member.id[prefixLength:]">NAME Surname or login</option>
159 <div class="info_message" tal:condition="not:outsideList" i18n:translate="">
160 No more group available for the <span tal:content="currentManagedRole" i18n:name="role" i18n:translate="" tal:omit-tag="">Manager</span> role in this folder
163 <td class="twins_list">
164 <input tal:condition="outsideList" type="submit" name="append_users_in_local_role:method" value=">>>" /><br /><br />
165 <input tal:condition="insideList" type="submit" name="remove_users_in_local_role:method" value="<<<" />
168 <select name="remove_members:list" size="20" multiple="multiple" tal:condition="insideList">
169 <option tal:repeat="member insideList" value="one"
170 tal:attributes="value member/id"
171 tal:content="python:member.title or member.id[prefixLength:]">NAME Surname or login</option>
173 <div class="info_message" tal:condition="not:insideList" i18n:translate="">
174 No group have got the <span tal:content="currentManagedRole" i18n:name="role" i18n:translate="" tal:omit-tag="">Manager</span> role in this folder
183 <pre>local_roles_settings</pre>
185 <table class="config" metal:define-macro="local_roles_settings">
187 <td tal:define="ai_dicts here/local_roles_actions;
188 useQueryString python:0">
189 <div metal:use-macro="here/widgets/macros/tabs">
196 <div tal:omit-tag="" metal:define-slot="form">