Quelques améliorations / simplifications / nettoyages dans le style.
[Plinn.git] / skins / generic / local_roles_macros.pt
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
3 <html xmlns="http://www.w3.org/1999/xhtml">
4
5 <head>
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" />
10 </head>
11
12 <body i18n:domain="plinn">
13 <pre>local_roles_summary</pre>
14 <hr />
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>
19 <ul>
20 <li tal:repeat="member allMembersInRole" tal:content="member/getMemberFullName">member</li>
21 </ul>
22 </div>
23 </div>
24 </div>
25 <pre>assign_members</pre>
26 <hr />
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)">
37 <tr>
38 <th i18n:translate="">
39 Current Role: "<span i18n:name="current_role" tal:content="currentManagedRole" i18n:translate="">Manager</span>"
40 </th>
41 <th>
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>&nbsp;<noscript><input type="submit" value="ok" i18n:attributes="value" /></noscript>
46 </form>
47 <script type="text/javascript">
48 // <!--
49 addListener(document.getElementById('roleSelector'), 'change',
50 function(evt){
51 var selector = getTargetedObject(evt);
52 var fm = new FormManager(selector.form);
53 fm.submit();
54 }
55 );
56 // -->
57 </script>
58 </th>
59 </tr>
60 <tr>
61 <td colspan="2">
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" />
64 <table>
65 <tr>
66 <th i18n:translate="">
67 Haven't role
68 </th>
69 <td>
70 <br />
71 </td>
72 <th i18n:translate="">
73 Have role
74 </th>
75 </tr>
76 <tr>
77 <td>
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>
82 </select>
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
85 </div>
86 </td>
87 <td class="twins_list">
88 <input tal:condition="outsideList" type="submit" name="append_users_in_local_role:method" value="&gt;&gt;&gt;" /><br />
89 <br />
90 <input tal:condition="insideList" type="submit" name="remove_users_in_local_role:method" value="&lt;&lt;&lt;" />
91 </td>
92 <td>
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>
97 </select>
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
100 </div>
101 </td>
102 </tr>
103 </table>
104 </form>
105 </td>
106 </tr>
107 </table>
108 <pre>assign_groups</pre>
109 <hr />
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)">
121 <tr>
122 <th i18n:translate="">Current Role: "<span i18n:name="current_role" tal:content="currentManagedRole" i18n:translate="">Manager</span>"</th>
123 <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>&nbsp;<noscript><input type="submit" value="ok" i18n:attributes="value" /></noscript>
128 </form>
129 <script type="text/javascript">
130 // <!--
131 addListener(document.getElementById('roleSelector'), 'change',
132 function(evt){
133 var selector = getTargetedObject(evt);
134 var fm = new FormManager(selector.form);
135 fm.submit();
136 }
137 );
138 // -->
139 </script>
140 </th>
141 </tr>
142 <tr>
143 <td colspan="2">
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" />
146 <table>
147 <tr>
148 <th i18n:translate="">Haven't role</th>
149 <td><br /></td>
150 <th i18n:translate="">Have role</th>
151 </tr>
152 <tr>
153 <td>
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>
158 </select>
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
161 </div>
162 </td>
163 <td class="twins_list">
164 <input tal:condition="outsideList" type="submit" name="append_users_in_local_role:method" value="&gt;&gt;&gt;" /><br /><br />
165 <input tal:condition="insideList" type="submit" name="remove_users_in_local_role:method" value="&lt;&lt;&lt;" />
166 </td>
167 <td>
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>
172 </select>
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
175 </div>
176 </td>
177 </tr>
178 </table>
179 </form>
180 </td>
181 </tr>
182 </table>
183 <pre>local_roles_settings</pre>
184 <hr />
185 <table class="config" metal:define-macro="local_roles_settings">
186 <tr>
187 <td tal:define="ai_dicts here/local_roles_actions;
188 useQueryString python:0">
189 <div metal:use-macro="here/widgets/macros/tabs">
190 GRUF tabs
191 </div>
192 </td>
193 </tr>
194 <tr>
195 <td>
196 <div tal:omit-tag="" metal:define-slot="form">
197 slot form here
198 </div>
199 </td>
200 </tr>
201 </table>
202 </body>
203
204 </html>