[Checkins] SVN: z3c.securitytool/trunk/src/z3c/securitytool/browser/ - Changed the layout of the viewprincipalmatrix.pt file

Daniel Blackburn blackburnd at gmail.com
Wed Jan 16 19:39:45 EST 2008


Log message for revision 82928:
  
    - Changed the layout of the viewprincipalmatrix.pt file
       - views are now orgainized by permission  instead of 
         just listed with the permission in italics.
  
       - change the css to accomidate the new changes
  
  
  

Changed:
  U   z3c.securitytool/trunk/src/z3c/securitytool/browser/securitytool.css
  U   z3c.securitytool/trunk/src/z3c/securitytool/browser/viewprincipalmatrix.pt
  U   z3c.securitytool/trunk/src/z3c/securitytool/browser/views.py

-=-
Modified: z3c.securitytool/trunk/src/z3c/securitytool/browser/securitytool.css
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/browser/securitytool.css	2008-01-16 21:04:15 UTC (rev 82927)
+++ z3c.securitytool/trunk/src/z3c/securitytool/browser/securitytool.css	2008-01-17 00:39:44 UTC (rev 82928)
@@ -5,6 +5,7 @@
   padding : 0;
   font-size: 100%;
   font-weight: normal;
+
 }
 
 /* remove borders from tables */
@@ -20,13 +21,15 @@
     padding: 5px;
     font-family:Arial,sans-serif;
     font-size:small;
+    margin: 20px;
+
 }
 
 h1 {
     font-size: 130%;
     font-weight: bold;
     padding: 10px 20px;
-    width: 100%;
+    width: 60%;
     border-bottom: 1px solid #ccc;
 }
 
@@ -50,6 +53,7 @@
 
 table {
     border: 1px solid #999;
+    width: 60%;
 }
 
 table td {
@@ -80,9 +84,13 @@
 }
 
 .viewname {
-    font-weight: bold;
+    font-weight : bold;
 }
 
+.view{
+    text-align : left;
+}
+
 .permission {
     font-style:italic;
 }

Modified: z3c.securitytool/trunk/src/z3c/securitytool/browser/viewprincipalmatrix.pt
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/browser/viewprincipalmatrix.pt	2008-01-16 21:04:15 UTC (rev 82927)
+++ z3c.securitytool/trunk/src/z3c/securitytool/browser/viewprincipalmatrix.pt	2008-01-17 00:39:44 UTC (rev 82928)
@@ -2,65 +2,63 @@
     <head>
         <link type="text/css" rel="stylesheet" media="all" href=""
               tal:attributes="href context/++resource++securitytool.css"/>
-    </head>
-<body>
-   <h1>Security Checking Tool</h1>
-   <h2>View User Matrix</h2>
-   <form action="." method="POST"
-             tal:attributes="action request/URL">
-      <p>Select a skin:
-         <select name="selectedSkin">
-            <option value="SkinType"
-               tal:repeat="skinName view/skinTypes"
-               tal:attributes="value skinName; 
-               selected python:request.form.has_key('selectedSkin') and request.form['selectedSkin']==skinName"
-               tal:content="skinName">SkinName</option>
-         </select>
-      </p>
-      <p>Filter by permission:   
-         <select name="selectedPermission">
-            <option value="None">---</option>
-            <option value="Permission"
-               tal:repeat="permission view/getPermissionList"
-               tal:attributes="value permission; 
-               selected python:request.form.has_key('selectedPermission') and request.form['selectedPermission']==permission"
-               tal:content="permission">permission</option>
-         </select>
-         
-      <input type="submit" name="FILTER" value="Filter"/>
-      </p>
-   </form>
-   <br />
-   <table tal:define="urlViewName view/urlEncodedViewName">
-      <tr>
-         <th></th>
-         <th></th>
-         <th tal:repeat="principal view/viewMatrix">
-             <a tal:content="principal"
-                tal:attributes="href string:ud.html?principal=${principal}">Principal</a>
-         </th>
-      </tr>
-      <tr tal:repeat="viewName view/views"
-          tal:attributes="class view/cssclass">
-         <td>
-            <span tal:content="structure viewName"
-                  class="viewname"/>
-         </td>
-         <td>
-            <span class="permission">
-            (<span tal:replace="python: view.views[viewName]"
-                   tal:omit-tag="">Read Permission</span>)
-            </span>
-         </td>
-         <td tal:repeat="principal view/viewMatrix"
-             tal:define="enc python:urlViewName[viewName]">
-            <a tal:attributes="href string:pd.html?principal=${principal}&amp;view=${enc}"
-               tal:omit-tag="python: view.getPermissionSetting(viewName,principal)=='--'">
-                <span tal:content="python: view.getPermissionSetting(viewName,principal)"
-                      tal:omit-tag="">Allow</span>
-             </a>
-         </td>
-      </tr>
-   </table>
-</body>
-</html>
+    </head>
+<body>
+   <h1>Security Checking Tool</h1>
+   <h2>View User Matrix</h2>
+   <form action="." method="POST"
+             tal:attributes="action request/URL">
+      <p>Select a skin:
+         <select name="selectedSkin">
+            <option value="SkinType"
+               tal:repeat="skinName view/skinTypes"
+               tal:attributes="value skinName; 
+               selected python:request.form.has_key('selectedSkin') and request.form['selectedSkin']==skinName"
+               tal:content="skinName">SkinName</option>
+         </select>
+      </p>
+      <p>Filter by permission:   
+         <select name="selectedPermission">
+            <option value="None">---</option>
+            <option value="Permission"
+               tal:repeat="permission view/getPermissionList"
+               tal:attributes="value permission; 
+               selected python:request.form.has_key('selectedPermission') and request.form['selectedPermission']==permission"
+               tal:content="permission">permission</option>
+         </select>
+         
+      <input type="submit" name="FILTER" value="Filter"/>
+      </p>
+   </form>
+   <br />
+   <table tal:define="urlViewName view/urlEncodedViewName" >
+       <metal:block tal:repeat="viewObj view/viewList"
+                    tal:attributes="class view/cssclass">
+          <tr>
+            <th align="left">
+               <h2 tal:content="python: viewObj"/>
+            </th>
+            <th tal:repeat="principal view/viewMatrix">
+                <a tal:content="principal"
+                   tal:attributes="href string:ud.html?principal=${principal}">Principal</a>
+            </th>
+          </tr>
+
+          <tr tal:repeat="viewItem python: view.viewList[viewObj]"
+               tal:attributes="class view/cssclass">
+               <td tal:content="viewItem" style="text-align: left"/>
+                <td tal:repeat="principal view/viewMatrix"
+                   tal:define="enc python:urlViewName[viewItem]">
+                  <a tal:attributes="href string:pd.html?principal=${principal}&amp;view=${enc}"
+                     tal:omit-tag="python: view.getPermissionSetting(viewItem,principal)=='--'">
+                      <span tal:content="python: view.getPermissionSetting(viewItem,principal)"
+                            tal:omit-tag="">Allow</span>
+                  </a>
+              </td>
+           </tr>
+
+       </metal:block>
+
+   </table>
+</body>
+</html>

Modified: z3c.securitytool/trunk/src/z3c/securitytool/browser/views.py
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/browser/views.py	2008-01-16 21:04:15 UTC (rev 82927)
+++ z3c.securitytool/trunk/src/z3c/securitytool/browser/views.py	2008-01-17 00:39:44 UTC (rev 82928)
@@ -21,9 +21,9 @@
     
     evenOddClasses = ('even','odd')
     evenodd = 0
-    viewList = {}
     
     def update(self):
+        self.viewList = {}
         selectedPermission = None
         if 'FILTER' in self.request.form:
             selectedSkin = self.request.form['selectedSkin']
@@ -53,7 +53,6 @@
             else:
                 self.viewList[item[0]] = [item[1]]
                             
-        self.viewList
         
     def cssclass(self):
         if self.evenodd != 1:



More information about the Checkins mailing list