--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
+ lang="en-US"
+ metal:use-macro="here/main_template/macros/master"
+ i18n:domain="plone">
+
+<body>
+
+ <div metal:fill-slot="main"
+ tal:define="Iterator python:modules['Products.CMFPlone'].IndexIterator;
+ Batch python:modules['Products.CMFPlone'].Batch;
+ group_submit request/group_submit|nothing;
+ b_size python:12;b_start python:0;b_start request/b_start | b_start;
+ search_submitted request/role_submit|nothing;
+ search_results python:test(search_submitted, here.portal_membership.searchMembers(
+ search_param=request.get('search_param',''),
+ search_term=request.get('search_term', '') ), None);">
+
+ <h1 i18n:translate="heading_currently_assigned_localroles">
+ Currently assigned local roles in folder
+ <span tal:content="here/title_or_id" i18n:name="folder">title</span>
+ </h1>
+
+ <p i18n:translate="description_current_localroles">
+ These users currently have local roles assigned in this folder:
+ </p>
+
+ <form class="group"
+ method="post"
+ name="deleterole"
+ action="folder_localrole_edit"
+ tal:attributes="action string:${here/absolute_url}/folder_localrole_edit">
+
+ <span class="legend" i18n:translate="legend_assigned_roles">
+ Assigned Roles
+ <span tal:content="here/title_or_id" i18n:name="folder">title</span>
+ </span>
+
+ <input type="hidden" name="change_type" value="delete" />
+ <input type="hidden" name="member_role" value="" />
+
+ <table class="listing" summary="Currently assigned local roles"
+ tal:define="username python:here.portal_membership.getAuthenticatedMember().getUserName();">
+ <thead>
+ <tr>
+ <th> </th>
+ <th i18n:translate="label_user_group_name">User/Group name</th>
+ <th i18n:translate="label_type">Type</th>
+ <th i18n:translate="label_roles">Role(s)</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr tal:repeat="lrole python:here.acl_users.getLocalRolesForDisplay(here)">
+ <td>
+ <input class="noborder"
+ type="checkbox"
+ name="member_ids:list"
+ id="#"
+ value=""
+ tal:condition="python:lrole[0]!=username"
+ tal:attributes="value python:lrole[3];"
+ />
+ </td>
+
+ <td tal:content="python:lrole[0]">
+ groupname
+ </td>
+
+ <td tal:condition="python:lrole[2]=='group'"
+ i18n:translate="label_group">
+ Group
+ </td>
+ <td tal:condition="python:lrole[2]=='user'"
+ i18n:translate="label_user">
+ User
+ </td>
+
+ <td>
+ <tal:block tal:repeat="role python:lrole[1]">
+ <span i18n:translate=""
+ tal:content="role"
+ tal:omit-tag="">Role</span>
+ <span tal:condition="not: repeat/role/end"
+ tal:omit-tag="">, </span>
+ </tal:block>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <input class="context"
+ type="submit"
+ value="Delete Selected Role(s)"
+ i18n:attributes="value"
+ />
+ </form>
+
+ <metal:block tal:condition="python:test(search_submitted and not search_results, 1, 0)">
+ <h1 i18n:translate="heading_search_results">Search results</h1>
+ <p i18n:translate="no_members_found">
+ No members were found using your <strong>Search Criteria</strong>
+ </p>
+ <hr />
+ </metal:block>
+
+ <metal:block tal:condition="python:test(search_submitted and search_results, 1, 0)">
+
+ <h1 i18n:translate="heading_search_results">Search results</h1>
+
+ <p i18n:translate="description_localrole_select_member">
+ Select one or more Members, and a role to assign.
+ </p>
+
+ <metal:block tal:define="batch python:Batch(search_results, b_size, int(b_start), orphan=3)">
+
+ <form class="group"
+ method="post"
+ name="change_type"
+ action="folder_localrole_edit"
+ tal:attributes="action string:${here/absolute_url}/folder_localrole_edit">
+
+ <span class="legend" i18n:translate="legend_available_members">
+ Available Members
+ </span>
+
+ <input type="hidden" name="change_type" value="add" />
+
+ <!-- batch navigation -->
+ <div metal:use-macro="here/batch_macros/macros/navigation" />
+
+ <table class="listing" summary="Search results">
+ <thead>
+ <tr>
+ <th> </th>
+ <th i18n:translate="label_user_name">User Name</th>
+ <th i18n:translate="label_email_address">Email Address</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr tal:repeat="member batch">
+ <td>
+ <input class="noborder"
+ type="checkbox"
+ name="member_ids:list"
+ id="#"
+ value=""
+ tal:attributes="value member/username;"
+ />
+ </td>
+
+ <td tal:content="member/username">username</td>
+ <td tal:content="member/email">email</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <!-- batch navigation -->
+ <div metal:use-macro="here/batch_macros/macros/navigation" />
+
+ <div class="row">
+
+ <div class="label" i18n:translate="label_localrole_to_assign">
+ Role to assign
+ </div>
+
+ <div class="field">
+ <select name="member_role">
+ <option tal:repeat="lroles python:container.portal_membership.getCandidateLocalRoles(here)"
+ tal:attributes="value lroles"
+ tal:content="lroles"
+ i18n:translate="">
+ Role name
+ </option>
+ </select>
+ </div>
+
+ </div>
+
+ <div class="row">
+ <div class="label"> </div>
+ <div class="field">
+ <input class="context"
+ type="submit"
+ value="Assign Local Role to Selected User(s)"
+ i18n:attributes="value"
+ />
+ </div>
+ </div>
+
+ </form>
+
+ </metal:block>
+ </metal:block>
+
+ <div>
+ <tal:block tal:condition="python: (not search_submitted or
+ (search_submitted and not search_results))">
+
+ <h1 i18n:translate="heading_assign_localrole">
+ Assign local roles to folder
+ <tal:block tal:content="here/title_or_id" i18n:name="folder">title</tal:block>
+ </h1>
+
+ <p i18n:translate="description_assign_localrole">
+ A local role is a way of allowing other users into some or
+ all of your folders. These users can edit items, publish
+ them - et cetera, depending on what permissions you give
+ them.
+ <br />
+
+ Local roles are ideal in cooperation projects, and as every
+ item has a history and an undo option, it's easy to keep
+ track of the changes.
+
+ <br />
+
+ To give a person a local role in this folder, just search
+ for the person's name or email address in the form below,
+ and you will be presented with a page that will show you the
+ options available.
+ </p>
+
+ <form class="group"
+ method="post"
+ name="localrole"
+ action="folder_localrole_form"
+ tal:attributes="action string:${here/absolute_url}/${template/getId}" >
+
+ <span class="legend" i18n:translate="legend_search_terms">
+ Search Terms
+ </span>
+
+ <input type="hidden" name="role_submit" value="role_submit" />
+
+ <div class="row">
+ <div class="label" i18n:translate="label_search_by">
+ Search by
+ </div>
+
+ <div class="field">
+ <select name="search_param">
+ <option value="username" i18n:translate="label_user_name">
+ User Name
+ </option>
+ <option value="email" i18n:translate="label_email_address">
+ Email Address
+ </option>
+ </select>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="label"
+ i18n:translate="label_search_term">
+ Search Term
+ </div>
+
+ <div class="field">
+ <input type="text"
+ name="search_term"
+ size="30"
+ />
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="label"> </div>
+ <div class="field">
+ <input class="context"
+ type="submit"
+ value="Perform Search"
+ i18n:attributes="value"
+ />
+ </div>
+ </div>
+
+ </form>
+ </tal:block>
+
+ <h1 i18n:translate="heading_available_groups">Available groups</h1>
+
+ <p i18n:translate="description_available_groups">
+ Groups are a convenient way to assign roles to a common set of
+ users. Select one or more Groups, and a role to assign.
+ </p>
+
+ <form class="group"
+ method="post"
+ name="change_type"
+ action="folder_localrole_edit"
+ tal:attributes="action string:${here/absolute_url}/folder_localrole_edit">
+
+ <span class="legend" i18n:translate="legend_available_groups">
+ Available Groups
+ </span>
+
+ <input type="hidden" name="change_type" value="add" />
+
+ <table class="listing" summary="Available groups">
+ <thead>
+ <tr>
+ <th> </th>
+ <th i18n:translate="">Name</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr tal:repeat="member here/acl_users/getGroups">
+ <td>
+ <input class="noborder"
+ type="checkbox"
+ name="member_ids:list"
+ id="#"
+ value=""
+ tal:attributes="value member/getUserName;" />
+ </td>
+ <td tal:content="python:member.getUserNameWithoutGroupPrefix()">
+ groupname
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <div class="row">
+ <div class="label" i18n:translate="label_localrole_to_assign">
+ Role to assign
+ </div>
+
+ <div class="field">
+ <select name="member_role">
+ <option tal:repeat="lroles python:container.portal_membership.getCandidateLocalRoles(here)"
+ tal:attributes="value lroles"
+ tal:content="lroles"
+ i18n:translate="">
+ Role name
+ </option>
+ </select>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="label"> </div>
+ <div class="field">
+ <input class="context"
+ type="submit"
+ value="Assign Local Role to Selected Group(s)"
+ i18n:attributes="value"
+ />
+ </div>
+ </div>
+
+ </form>
+
+ </div>
+
+ </div> <!-- fill-slot -->
+
+</body>
+</html>