[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security/pt - principal_role_association.pt:1.1.2.1

alan runyan runyaga@runyaga.com
Fri, 8 Feb 2002 14:55:27 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Security/pt
In directory cvs.zope.org:/tmp/cvs-serv27090

Added Files:
      Tag: Zope-3x-branch
	principal_role_association.pt 
Log Message:
crude role/permissions mapping presentation



=== Added File Zope3/lib/python/Zope/App/Security/pt/principal_role_association.pt ===
<html metal:use-macro="views/standard_macros/page">
  <head>
    <style metal:fill-slot="headers" type="text/css"> </style>
  </head>
  <body metal:fill-slot="main" tal:define="hasFilter python:request.get('Filter', None)">
      <div tal:condition="not: hasFilter">
        <span class="message"> Apply filter </span>       
        <form method="POST" action="" tal:attributes="action template/getId">
           <span tal:define="principals container/getAllPrincipals"> 
           Principal(s): 
            <select name="principals:list" multiple>
             <option tal:repeat="principal principals" tal:attributes="value principal/getId" tal:content="principal/getTitle">my title</option>
            </select>
           </span>
            
           <span tal:define="roles container/getAllRoles">
           Role(s): 
            <select name="roles:list" multiple>
             <option tal:repeat="role roles" tal:attributes="value role/getId" tal:content="role/getTitle">my title</option>
            </select>
           </span>
            
           <input type="submit" name="Filter" value="Filter" />
        </form>
        
      </div>      
      <!-- WANRING!! SELF POSTING FORM!! -->
      
      <div tal:condition="hasFilter">
        <div class="principalRolesGrid"
             tal:define="principalRoleGrid python:container.createGrid( request.get('roles', None), request.get('principals', None)); " >

          <span tal:define="global listPrincipals principalRoleGrid/principals;       
                            global listRoles principalRoleGrid/roles;
                            global listValues principalRoleGrid/listAvailabaleValues" />

          <form method="POST" action="apply">
          <table>
            <tr class="roleHeading">
              <td class="principal">
                &nbsp;
              </td>
              <td class="role" tal:repeat="role listRoles" tal:content="role/getId">
                role id
              </td>
            </tr>
            
            <tr class="principalRoleRow" tal:repeat="principal listPrincipals">
              <td class="principalLabel" tal:content="principal/getId">
							  Principal Id
              </td>
							
              <td class="principalRole" tal:repeat="role listRoles">
                <select name="mapping.principal.row" 
                        tal:attributes="name string:grid.${principal/getId}.${role/getId}:records"
                        tal:define="selectedValue python:1 or principalRoleGrid.grid(principal, role)" >
                  <option value="" tal:repeat="defaultValue listValues" 
                   tal:attributes="selected python:test(defaultValue==selectedValue, 'selected', '');
									                 value defaultValue;"
                   tal:content="defaultValue">
                  &nbsp;
                  </option>
                </select>
              </td>
            </tr>  
            
          </table>
					<input type="submit" name="apply" value="apply" />        
          </form>
          
        </div> 
      </div>
       
  </body>
</html>