[CMF-checkins] CVS: Products/CMFDecor/skins/zpt_generic - folder_localrole_form.pt:1.1
Tres Seaver
tseaver@zope.com
Sat, 22 Sep 2001 12:04:33 -0400
Update of /cvs-repository/Products/CMFDecor/skins/zpt_generic
In directory cvs.zope.org:/tmp/cvs-serv1162/CMFDecor/skins/zpt_generic
Added Files:
folder_localrole_form.pt
Log Message:
- Skin 'folder_localrole_form' as ZPT.
=== Added File Products/CMFDecor/skins/zpt_generic/folder_localrole_form.pt ===
<html metal:use-macro="here/main_template/macros/master">
<body>
<div class="Desktop"
metal:fill-slot="main"
tal:define="searching python: request.get('role_submit', None );
mtool here/portal_membership;
"
>
<div tal:condition="python: not searching">
<!-- Search -->
<h2>Assign local roles: Search Members</h2>
<form method="post" action="folder_localrole_form">
<table class="FormLayout">
<tr>
<th>Search by</th>
<td>
<select name="search_param">
<option value="username">User Name</option>
<option value="email">Email Address</option>
</select>
</td>
</tr>
<tr>
<th>Search Term</th>
<td><input type="text" name="search_term" size="30"></td>
</tr>
<tr>
<td><br /></td>
<td><input type="submit" name="role_submit" value=" Search "></td>
</tr>
</table>
</form>
<!-- End search -->
</div>
<div tal:condition="searching"
tal:define="search_param python: request.get( 'search_param', '' );
search_term python: request.get( 'search_term', '' );
found python:mtool.searchMembers( search_param=search_param
, search_term=search_term
);
"
>
<!-- Assignment -->
<h2>Assign local roles: Search Results</h2>
<div tal:condition="found">
<p>Select Member(s) and a role to assign:</p>
<form method="post" action="folder_localrole_edit">
<input type="hidden" name="change_type" value="add">
<table class="FormLayout">
<tr>
<td width="16"><br></td>
<th style="text-align:left;">User</th>
<th style="text-align:left;">Email address</th>
</tr>
<tr tal:repeat="member found">
<td width="16">
<input type="checkbox" name="member_ids:list"
value=""
tal:attributes="value member/username">
</td>
<td tal:content="member/username"> Username 1 </td>
<td tal:content="member/email"> Email 1 </td>
</tr>
<tr tal:condition="nothing">
<td width="16">
<input type="checkbox" name="member_ids:list" value="">
</td>
<td> Username 2 </td>
<td> Email 2 </td>
</tr>
<tr>
<td colspan="3"><br></td>
</tr>
<tr>
<th colspan="2">Role to assign:</th>
<td>
<select name="member_role"
tal:define="roles python: mtool.getCandidateLocalRoles( here )">
<option tal:repeat="role roles"
tal:content="role"> Role1 </option>
<option tal:condition="nothing"> Role2 </option>
<option tal:condition="nothing"> Role3 </option>
</select>
</td>
</tr>
<tr>
<td colspan="3"><br></td>
</tr>
<tr>
<td width="16"><br></td>
<td colspan="2"><input type="submit" value=" Assign Roles "></td>
</tr>
</table>
</form>
</div>
<div tal:condition="python: not found">
<p> Sorry, no members matched your search. </p>
</div>
<!-- End assignment -->
</div>
<hr>
<h2>Currently assigned local roles</h2>
<p>These users currently have local roles assigned in this folder:</p>
<form method="post" action="folder_localrole_edit">
<input type="hidden" name="change_type" value="delete">
<input type="hidden" name="member_role" value="">
<table class="FormLayout" tal:define="lroles here/get_local_roles">
<tr>
<td width="16"><br></td>
<th style="text-align:left;">User</th>
<th style="text-align:left;">Role(s)</th>
</tr>
<tbody tal:repeat="role_tuple lroles">
<tr tal:define="user_name python: role_tuple[0];
roles python: role_tuple[1];
auth mtool/getAuthenticatedMember;
auth_name auth/getUserName;
"
>
<td width="16">
<input type="checkbox" name="member_ids:list"
value="id"
tal:attributes="value user_name"
tal:condition="python: user_name != auth_name"
>
<br tal:condition="python: user_name == auth_name">
</td>
<td tal:content="user_name"> Username 1 </td>
<td tal:content="python: modules['string'].join( roles, ', ' )">
Role1, Role2
</td>
</tr>
</tbody>
<tr tal:condition="nothing">
<td width="16">
<input type="checkbox" name="member_ids:list" value="id">
</td>
<td> Username 2 </td>
<td> Role3 </td>
</tr>
<tr tal:condition="nothing">
<td width="16">
<br>
</td>
<td> Auth username </td>
<td> Role1, Role2, Role3 </td>
</tr>
<tr>
<td colspan="3"><br></td>
</tr>
<tr>
<td><br></td>
<td colspan="2"><input type="submit" value=" Delete "></td>
</tr>
</table>
</form>
</div>
</body>
</html>