Ajout de GroupUserFolder extrait de l'état suivant :
[GroupUserFolder.git] / skins / gruf_plone_2_0 / folder_localrole_form.pt
1 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
2 lang="en"
3 metal:use-macro="here/main_template/macros/master"
4 i18n:domain="plone">
5
6 <metal:block fill-slot="top_slot"
7 tal:define="dummy python:request.set('enable_border',1)" />
8
9 <body>
10
11 <div metal:fill-slot="main"
12 tal:define="Batch python:modules['Products.CMFPlone'].Batch;
13 username member/getUserName;
14 group_submit request/group_submit|nothing;
15 b_size python:12;b_start python:0;b_start request/b_start | b_start;
16 search_submitted request/role_submit|nothing;
17 search_results python:search_submitted and mtool.searchForMembers(
18 {request.get('search_param',''):
19 request.get('search_term', '')}) or None;">
20
21 <h1 i18n:translate="heading_currently_assigned_shares">
22 Current sharing permissions for
23 <span tal:content="here/title_or_id" i18n:name="folder">title</span>
24 </h1>
25
26 <p i18n:translate="description_share_folders_items_current_shares">
27 You can share the rights for both folders (including content) and single items.
28 These users have privileges here:
29 </p>
30
31 <fieldset tal:define="iroles python:here.plone_utils.getInheritedLocalRoles(here);"
32 tal:condition="iroles">
33
34 <legend i18n:translate="legend_acquired_roles">
35 Acquired roles
36 </legend>
37
38 <table class="listing" summary="Acquired roles">
39 <thead>
40 <tr>
41 <th i18n:translate="label_user_group_name">User/Group name</th>
42 <th i18n:translate="label_type">Type</th>
43 <th i18n:translate="label_roles">Role(s)</th>
44 </tr>
45 </thead>
46 <tbody>
47 <tr tal:repeat="irole iroles">
48 <td tal:content="python:irole[0]">
49 groupname
50 </td>
51
52 <td tal:condition="python:irole[2]=='group'"
53 i18n:translate="label_group">
54 Group
55 </td>
56 <td tal:condition="python:irole[2]=='user'"
57 i18n:translate="label_user">
58 User
59 </td>
60
61 <td>
62 <tal:block tal:repeat="role python:irole[1]">
63 <span i18n:translate=""
64 tal:content="role"
65 tal:omit-tag="">Role</span>
66 <span tal:condition="not: repeat/role/end"
67 tal:omit-tag="">, </span>
68 </tal:block>
69 </td>
70 </tr>
71 </tbody>
72 </table>
73
74 </fieldset>
75
76 <form method="post"
77 name="deleterole"
78 action="folder_localrole_edit"
79 tal:attributes="action string:$here_url/folder_localrole_edit">
80
81 <fieldset>
82
83 <legend i18n:translate="legend_assigned_roles">
84 Assigned Roles
85 <span tal:content="here/title_or_id" i18n:name="folder">title</span>
86 </legend>
87
88 <input type="hidden" name="change_type" value="delete" />
89 <input type="hidden" name="member_role" value="" />
90
91 <table class="listing" summary="Currently assigned local roles">
92 <thead>
93 <tr>
94 <th>
95 <input type="checkbox"
96 onclick="javascript:toggleSelect(this, 'member_ids:list', false, 'deleterole');"
97 name="alr_toggle"
98 value="#"
99 id="alr_toggle"
100 class="noborder"
101 />
102 </th>
103 <th i18n:translate="label_user_group_name">User/Group name</th>
104 <th i18n:translate="label_type">Type</th>
105 <th i18n:translate="label_roles">Role(s)</th>
106 </tr>
107 </thead>
108 <tbody>
109 <tr tal:repeat="lrole python:here.acl_users.getLocalRolesForDisplay(here)">
110 <td class="field">
111 <label class="hiddenLabel" for="member_ids:list"
112 i18n:translate="label_select_usergroup">
113 select user/group <span tal:content="python:lrole[3]" i18n:name="role"/>
114 </label>
115 <input class="formSelection"
116 type="checkbox"
117 name="member_ids:list"
118 id="#"
119 value=""
120 tal:condition="python:lrole[0]!=username"
121 tal:attributes="value python:lrole[3];"
122 />
123 </td>
124
125 <td tal:content="python:lrole[0]">
126 groupname
127 </td>
128
129 <td tal:condition="python:lrole[2]=='group'"
130 i18n:translate="label_group">
131 Group
132 </td>
133 <td tal:condition="python:lrole[2]=='user'"
134 i18n:translate="label_user">
135 User
136 </td>
137
138 <td>
139 <tal:block tal:repeat="role python:lrole[1]">
140 <span i18n:translate=""
141 tal:content="role"
142 tal:omit-tag="">Role</span>
143 <span tal:condition="not: repeat/role/end"
144 tal:omit-tag="">, </span>
145 </tal:block>
146 </td>
147 </tr>
148 </tbody>
149 </table>
150
151 <div class="submit">
152 <input class="context"
153 type="submit"
154 value="Delete Selected Role(s)"
155 i18n:attributes="value"
156 />
157 </div>
158
159 </fieldset>
160
161 </form>
162
163 <metal:block tal:condition="python:test(search_submitted and not search_results, 1, 0)">
164 <h1 i18n:translate="heading_search_results">Search results</h1>
165 <p i18n:translate="no_members_found">
166 No members were found using your <strong>Search Criteria</strong>
167 </p>
168 <hr />
169 </metal:block>
170
171 <metal:block tal:condition="python:test(search_submitted and search_results, 1, 0)">
172
173 <h1 i18n:translate="heading_search_results">Search results</h1>
174
175 <p i18n:translate="description_localrole_select_member">
176 Select one or more people, and a role to assign.
177 </p>
178
179 <metal:block tal:define="batch python:Batch(search_results, b_size, int(b_start), orphan=3);
180 nResults python:len(search_results);">
181
182 <form method="post"
183 name="change_type"
184 action="folder_localrole_edit"
185 tal:attributes="action string:$here_url/folder_localrole_edit">
186
187 <fieldset>
188
189 <legend i18n:translate="legend_available_members">Available Members</legend>
190
191 <input type="hidden" name="change_type" value="add" />
192
193 <!-- batch navigation -->
194 <div metal:use-macro="here/batch_macros/macros/navigation" />
195
196 <table class="listing" summary="Search results">
197 <thead>
198 <tr>
199 <th>
200 <input type="checkbox"
201 onclick="javascript:toggleSelect(this, 'member_ids:list', false, 'change_type');"
202 name="alr_toggle"
203 value="#"
204 id="alr_toggle"
205 class="noborder"
206 />
207 </th>
208 <th i18n:translate="label_user_name">User Name</th>
209 <th i18n:translate="label_email_address">Email Address</th>
210 </tr>
211 </thead>
212 <tbody>
213 <tr tal:repeat="member batch">
214 <td class="field" tal:define="global member_username member/getUserName">
215 <label class="hiddenLabel" for="member_ids:list"
216 i18n:translate="label_select_user">
217 select user <span tal:content="member_username" i18n:name="user" />
218 </label>
219 <input class="formSelection"
220 type="checkbox"
221 name="member_ids:list"
222 id="#"
223 value=""
224 tal:attributes="value member_username;
225 checked python:nResults==1;"
226 />
227 </td>
228
229 <td tal:content="python:member_username">username</td>
230 <td tal:content="member/email">email</td>
231 </tr>
232 </tbody>
233 </table>
234
235 <!-- batch navigation -->
236 <div metal:use-macro="here/batch_macros/macros/navigation" />
237
238 <div class="field">
239
240 <label for="user_member_role" i18n:translate="label_localrole_to_assign">
241 Role to assign
242 </label>
243
244 <select name="member_role:list"
245 id="user_member_role"
246 multiple="multiple">
247 <option tal:repeat="lroles python:mtool.getCandidateLocalRoles(here)"
248 tal:attributes="value lroles"
249 tal:content="lroles"
250 i18n:translate="">
251 Role name
252 </option>
253 </select>
254
255 </div>
256
257 <div class="submit">
258 <input class="context"
259 type="submit"
260 value="Assign Local Role to Selected User(s)"
261 i18n:attributes="value"
262 />
263 </div>
264
265 </fieldset>
266
267 </form>
268
269 </metal:block>
270 </metal:block>
271
272 <div>
273 <tal:block tal:condition="python: (not search_submitted or
274 (search_submitted and not search_results))">
275
276 <h1 i18n:translate="heading_add_sharing_permissions">
277 Add sharing permissions for
278 <tal:block tal:content="here/title_or_id" i18n:name="item">title</tal:block>
279 </h1>
280
281
282 <p i18n:translate="description_sharing_item">
283 Sharing is an easy way to allow others access to collaborate with you
284 on your content.
285
286 To share this item, search for the person's
287 name or email address in the form below, and assign them an appropriate role.
288 The most common use is to give people Manager permissions, which means they
289 have full control of this item and its contents (if any).
290 </p>
291
292 <form method="post"
293 name="localrole"
294 action="folder_localrole_form"
295 tal:attributes="action string:$here_url/${template/getId}" >
296
297 <fieldset>
298
299 <legend i18n:translate="legend_search_terms">Search Terms</legend>
300
301 <input type="hidden" name="role_submit" value="role_submit" />
302
303 <div class="field">
304 <label for="search_param" i18n:translate="label_search_by">
305 Search by
306 </label>
307
308 <select name="search_param"
309 id="search_param">
310 <option value="name" i18n:translate="label_user_name">
311 User Name
312 </option>
313 <option value="email" i18n:translate="label_email_address">
314 Email Address
315 </option>
316 </select>
317
318 </div>
319
320 <div class="field">
321 <label for="search_term" i18n:translate="label_search_term">
322 Search Term
323 </label>
324
325 <input type="text"
326 id="search_term"
327 name="search_term"
328 size="30"
329 />
330 </div>
331
332 <div class="submit">
333 <input class="context"
334 type="submit"
335 value="Perform Search"
336 i18n:attributes="value"
337 />
338 </div>
339
340 </fieldset>
341
342 </form>
343 </tal:block>
344
345 <tal:groupshares define="grouplist gtool/listGroups"
346 condition="grouplist">
347
348 <h1 i18n:translate="heading_group_shares">Add sharing permissions to groups</h1>
349
350 <p i18n:translate="description_group_shares">
351 Groups are a convenient way to share items to a common set of
352 users. Select one or more groups, and a role to assign.
353 </p>
354
355 <form method="post"
356 name="change_type_group"
357 action="folder_localrole_edit"
358 tal:attributes="action string:$here_url/folder_localrole_edit">
359
360 <fieldset>
361
362 <legend i18n:translate="legend_available_groups">
363 Available Groups
364 </legend>
365
366 <input type="hidden" name="change_type" value="add" />
367
368 <table class="listing" summary="Available groups">
369 <thead>
370 <tr>
371 <th>
372 <input type="checkbox"
373 onclick="javascript:toggleSelect(this, 'member_ids:list', false, 'change_type_group');"
374 name="alr_toggle"
375 value="#"
376 id="alr_toggle"
377 class="noborder"
378 />
379 </th>
380 <th i18n:translate="listingheader_name">Name</th>
381 </tr>
382 </thead>
383 <tbody>
384 <tr tal:repeat="group grouplist">
385 <td tal:define="global group_name group/getUserId">
386 <label class="hiddenLabel" for="member_ids:list"
387 i18n:translate="label_select_group">
388 select group <span tal:content="group_name" i18n:name="name"/>
389 </label>
390 <input class="formSelection"
391 type="checkbox"
392 name="member_ids:list"
393 id="#"
394 value=""
395 tal:attributes="value group_name;" />
396 </td>
397 <td tal:content="group/getUserNameWithoutGroupPrefix">
398 groupname
399 </td>
400 </tr>
401 </tbody>
402 </table>
403
404 <div class="field">
405
406 <label for="group_member_role" i18n:translate="label_localrole_to_assign">
407 Role to assign
408 </label>
409
410 <select name="member_role:list"
411 id="group_member_role"
412 multiple="multiple">
413 <option tal:repeat="lroles python:mtool.getCandidateLocalRoles(here)"
414 tal:attributes="value lroles"
415 tal:content="lroles"
416 i18n:translate="">
417 Role name
418 </option>
419 </select>
420 </div>
421
422 <div class="submit">
423 <input class="context"
424 type="submit"
425 value="Assign Local Role to Selected Group(s)"
426 i18n:attributes="value"
427 />
428 </div>
429
430 </fieldset>
431
432 </form>
433
434 </tal:groupshares>
435
436 <div metal:use-macro="here/document_byline/macros/byline">
437 Get the byline - contains details about author and modification date.
438 </div>
439
440 </div>
441
442 </div>
443
444 </body>
445 </html>