[Zope3-checkins] CVS: Zope3/src/zope/app/browser/skins/rotterdam - configure.zcml:1.6 folder_contents.pt:1.6

Jim Fulton jim@zope.com
Tue, 31 Dec 2002 13:27:27 -0500


Update of /cvs-repository/Zope3/src/zope/app/browser/skins/rotterdam
In directory cvs.zope.org:/tmp/cvs-serv1916/src/zope/app/browser/skins/rotterdam

Modified Files:
	configure.zcml folder_contents.pt 
Log Message:
Hold on to your butts! :)

In an effort to make zcml view definitions even easier to understand
(see 
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ZCMLBrowserViewDirectiveSimplification
)

I've finished a long-overdue refactoring of the configuration
directives for defining views. The logic is now a good bit less
complicated. 

I also simplified the way security assertions on views were
handled. To make this work right, I had to fix a bug in the
publication machinery. Now, as objects are traversed, the results of
traversal are put in security proxies.  This is really necessary to
treat URLs as "untrusted code", which they are.

I updated the meta-configuration directives for views and ran the zcml
documentation utility, so there is now documentation for the (new)
view directives. See the files 'page', 'pages', and 'view', in 
'doc/zcml/namespaces.zope.org/browser'.

I feel these changes are highly desireable for the alpha, but they are
significant enough that the chance of breakage is a lot higher than
I'd like just before the alpha.  I'd appreciate it if folks would let
me know if I've broken anything.



=== Zope3/src/zope/app/browser/skins/rotterdam/configure.zcml 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/skins/rotterdam/configure.zcml:1.5	Mon Dec 30 18:50:28 2002
+++ Zope3/src/zope/app/browser/skins/rotterdam/configure.zcml	Tue Dec 31 13:26:56 2002
@@ -21,13 +21,13 @@
 <browser:resource 
     name="mi.gif" file="mi.gif" layer="rotterdam" />
 
-<browser:view
+<browser:pages
     for="zope.app.interfaces.container.IReadContainer"
     permission="zope.View"
-    factory=".xmlobject.ReadContainerXmlObjectView">
+    class=".xmlobject.ReadContainerXmlObjectView">
   <browser:page name="children.xml" attribute="children" />
   <browser:page name="singleBranchTree.xml" attribute="singleBranchTree" />
-</browser:view>
+</browser:pages>
 
 <browser:page
     name="singleBranchTree.xml" 


=== Zope3/src/zope/app/browser/skins/rotterdam/folder_contents.pt 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/skins/rotterdam/folder_contents.pt:1.5	Mon Dec 30 16:43:07 2002
+++ Zope3/src/zope/app/browser/skins/rotterdam/folder_contents.pt	Tue Dec 31 13:26:56 2002
@@ -22,7 +22,8 @@
 <div metal:define-macro="contents">
 
       <table id="sortable" class="listing" summary="Content listing"
-             metal:define-macro="contents_table"
+             tal:condition="request/type_name|nothing"
+             tal:define="container_contents view/listContentInfo"
              >
     
         <thead> 
@@ -37,24 +38,86 @@
         </thead>
 
         <tbody>
-  <tr tal:condition="request/type_name|nothing">
-  <td></td>
-  <td>
-  <form name="addForm" action="+/action.html" method="POST">
-  <input type="hidden" name="type_name" tal:attributes="value request/type_name">
-  <input name="id" value="">
-  </form>
-  </td>
-  <td></td>
-  <td></td>
-  <td></td>
-  </tr>
+          <tr>
+          <td></td>
+          <td>
+          <form name="addForm" action="+/action.html" method="POST">
+            <input type="hidden" name="type_name" 
+                   tal:attributes="value request/type_name">
+            <input name="id" value="">
+          </form>
+          </td>
+          <td></td>
+          <td></td>
+          <td></td>
+          </tr>
+
+          <metal:block tal:repeat="item container_contents">
+            <tr tal:define="oddrow repeat/item/odd; url item/url"
+                tal:attributes="class python:oddrow and 'even' or 'odd'" > 
+              <td>
+                <input type="checkbox" class="noborder" name="ids:list" id="#"
+                       value="#"
+                       tal:attributes="value item/id;
+                                       id python: 'cb_'+item['id'];
+                                       checked request/ids_checked|nothing;"/>
+              </td>
+              <td> 
+                <a href="#" 
+                   tal:attributes="href 
+                                   string:${url}/@@SelectedManagementView.html"
+                   tal:content="structure item/icon|default"
+                   >
+                </a> 
+                <a href="#" 
+                   tal:attributes="href 
+                                   string:${url}/@@SelectedManagementView.html"
+                   tal:content="item/id"
+                   >foo</a> 
+              </td>
+              <td><span tal:content="item/title|default">&nbsp;</span></td>
+              <td><span tal:attributes="size item/size/sizeForSorting"
+                        tal:content="item/size/sizeForDisplay">&nbsp;</span></td>
+              <td><span tal:define="created item/created|default"
+                        tal:content="created">&nbsp;</span></td>
+              <td><span tal:define="modified item/modified|default"
+                        tal:content="modified">&nbsp;</span></td>
+            </tr>
+          </metal:block>
+
+        </tbody> 
+      </table>
+
+      <script tal:condition="request/type_name|nothing"><!--
+          prettydump('focus', LG_INFO);
+          document.addForm.id.focus();
+          //-->
+      </script>
+
+
   <form name="containerContentsForm" method="get" action="." 
+        tal:condition="not:request/type_name|nothing"
         tal:define="container_contents view/listContentInfo"
-        tal:condition="container_contents"
         >
 
 
+      <table id="sortable" class="listing" summary="Content listing"
+             metal:define-macro="contents_table"
+             >
+    
+        <thead> 
+          <tr>
+            <th>&nbsp;</th>
+            <th>Name</th>
+            <th>Title</th>
+            <th>Size</th>
+            <th>Created</th>
+            <th>Modified</th>
+          </tr>
+        </thead>
+
+        <tbody>
+
         <metal:block tal:repeat="item container_contents">
           <tr tal:define="oddrow repeat/item/odd; url item/url"
               tal:attributes="class python:oddrow and 'even' or 'odd'" > 
@@ -87,17 +150,13 @@
                       tal:content="modified">&nbsp;</span></td>
           </tr>
         </metal:block>
-  </form>
 
         </tbody> 
       </table>
       <input type="submit" name="@@removeObjects.html:method" value="Delete"/>
 
-      <script tal:condition="request/type_name|nothing"><!--
-          prettydump('focus', LG_INFO);
-          document.addForm.id.focus();
-          //-->
-      </script>
+  </form>
+
 </div>
 
 </div>