[Zope3-checkins] CVS: Zope3/src/zope/app/browser/security/grants -
principal_role_association.pt:1.8 principalroleview.py:1.9
Sidnei da Silva
sidnei at x3ng.com.br
Tue Oct 7 12:53:26 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/browser/security/grants
In directory cvs.zope.org:/tmp/cvs-serv12977/src/zope/app/browser/security/grants
Modified Files:
principal_role_association.pt principalroleview.py
Log Message:
Make the PrincipalRole template reusable
=== Zope3/src/zope/app/browser/security/grants/principal_role_association.pt 1.7 => 1.8 ===
--- Zope3/src/zope/app/browser/security/grants/principal_role_association.pt:1.7 Wed Aug 20 14:21:06 2003
+++ Zope3/src/zope/app/browser/security/grants/principal_role_association.pt Tue Oct 7 12:53:26 2003
@@ -1,68 +1,74 @@
<html metal:use-macro="views/standard_macros/dialog">
<body>
-<div metal:fill-slot="body"
- tal:define="hasFilter python:request.get('Filter', None)">
+<div metal:fill-slot="body">
<p tal:define="status view/update"
tal:condition="status"
tal:content="status" />
+ <metal:block define-macro="formbody"
+ tal:define="hasFilter python:request.get('Filter', None)">
+
<div tal:condition="not: hasFilter">
<span class="message" i18n:translate="">Apply filter</span>
- <form action="@@PrincipalRoles.html" method="POST">
+ <form action="@@PrincipalRoles.html"
+ method="POST"
+ tal:attributes="action request/URL">
<span i18n:translate="">Principal(s)</span>:
<select name="principals:list" multiple="multiple">
<option tal:repeat="principal view/getAllPrincipals"
tal:attributes="value principal/getId"
tal:content="principal/getTitle">my title</option>
</select>
-
+
<span i18n:translate="">Role(s)</span>:
<select name="roles:list" multiple="multiple">
<option tal:repeat="role view/getAllRoles"
tal:attributes="value role/getId"
tal:content="role/getTitle">my title</option>
</select>
-
- <input type="submit" name="Filter" value="Filter"
+
+ <input type="submit" name="Filter" value="Filter"
i18n:attributes="value filter-button"/>
</form>
-
+
</div>
<div tal:condition="hasFilter">
<div class="principalRolesGrid"
tal:define="principalRoleGrid view/createGrid">
-
+
<span tal:define="
global listPrincipals principalRoleGrid/principals;
global listRoles principalRoleGrid/roles;
global listValues principalRoleGrid/listAvailableValues" />
-
- <form action="@@PrincipalRoles.html" method="POST">
+
+ <form action="@@PrincipalRoles.html"
+ method="POST"
+ tal:attributes="action request/URL">
<table>
<tr class="roleHeading">
<td class="principal">
</td>
- <td class="role" tal:repeat="role listRoles"
+ <td class="role" tal:repeat="role listRoles"
tal:content="role/getTitle">
Role Id
</td>
</tr>
-
+
<tr class="principalRoleRow" tal:repeat="principal listPrincipals">
<td class="principalLabel" tal:content="principal/getTitle">
Principal Id
</td>
-
+
<td class="principalRole" tal:repeat="role listRoles">
<select name="grid.role.principal:records"
tal:attributes="
name string:grid.${role/getId}.${principal/getId}"
- tal:define="selectedValue
+ tal:define="selectedValue
python:principalRoleGrid.getValue(
- principal.getId(),
+ principal.getId(),
role.getId()
)" >
<option value="" tal:repeat="defaultValue listValues"
@@ -76,7 +82,7 @@
</select>
</td>
</tr>
-
+
</table>
<input type="hidden" name="principals:list"
@@ -86,14 +92,20 @@
<input type="hidden" name="roles:list"
tal:repeat="role listRoles"
tal:attributes="value role/getId" />
-
- <input type="submit" name="APPLY" value="Apply"
+
+ <metal:block define-slot="buttons">
+
+ <input type="submit" name="APPLY" value="Apply"
i18n:attributes="value apply-button"/>
-
+
+ </metal:block>
+
</form>
-
+
</div>
</div>
+
+ </metal:block>
</div>
</body>
=== Zope3/src/zope/app/browser/security/grants/principalroleview.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/browser/security/grants/principalroleview.py:1.8 Thu Aug 7 13:40:56 2003
+++ Zope3/src/zope/app/browser/security/grants/principalroleview.py Tue Oct 7 12:53:26 2003
@@ -25,7 +25,6 @@
from zope.app.services.servicenames import Authentication, Roles
from zope.component import getService, getAdapter
-
class PrincipalRoleView:
def getAllPrincipals(self):
@@ -92,7 +91,6 @@
status.mapping = {'date_time': formatter.format(datetime.utcnow())}
return status
-
class PrincipalRoleGrid:
More information about the Zope3-Checkins
mailing list