[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser - FolderAdding.py:1.1 add.pt:1.3 configure.zcml:1.6 contents.pt:1.9 loaded_folder_contents.pt:1.4

Gary Poster garyposter@earthlink.net
Sat, 22 Jun 2002 13:16:42 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv1899/lib/python/Zope/App/OFS/Content/Folder/Views/Browser

Modified Files:
	add.pt configure.zcml contents.pt loaded_folder_contents.pt 
Added Files:
	FolderAdding.py 
Log Message:
Small changes.

Mucking about with the new creation system, in preparation of deleting the old Addable class, registry, service, et al.  ServiceManager now uses new creation system.  Disabled Container adder in favor of Folder adder (see Container/Views/Browser/configure.zcml for short discussion).

There are a number of issues, from small to large (in my book) that are still to be worked out with the new creation system.  I'm not addressing them, just cleaning up.

Hooked the deletion button in the root folder back up via some zcml (adding a browser page for the deletion ability, which may or may not be kosher).

fixed one zcml zmi_menu error; saw others.


=== Added File Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/FolderAdding.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
# 
##############################################################################
"""

$Id: FolderAdding.py,v 1.1 2002/06/22 17:16:11 poster Exp $
"""

from Zope.App.OFS.Container.Views.Browser.Adding import Adding
from Zope.App.OFS.Content.Folder.IFolderAdding import IFolderAdding

class FolderAdding(Adding):
    
    __implements__ = IFolderAdding 

=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/add.pt 1.2 => 1.3 ===
 <head>
 <style metal:fill-slot="headers" type="text/css">
-.TypeListing {
-    width: 100%;
-}
 
 .Selector {
     width: 10px;
@@ -27,10 +24,10 @@
 
 <div metal:fill-slot="body">
 
-<form action="add.html" method="POST">
+<form action="action.html" method="POST">
 <table class="TypeListing">
 
-  <caption>Add Content To Folder</caption>
+  <caption>Add Content</caption>
 
     <tr>
       <td class="Selector"><br /></td>
@@ -41,24 +38,19 @@
       ** listAddableInfo returns a sequence of mappings, containing:
       **   'id'    : the ID of the addable type
       **   'title' : the title of the addable type
-      **   'desc'  : the description of the addable type
-      **   'icon'  : the absolute URL of the icon, for the addable type
-                     (may be None)
+      **   'description'  : the description of the addable type
       -->
-    <tbody tal:repeat="info view/listAddableInfo">
+    <tbody tal:repeat="info view/addingInfo">
 
     <tr>
 
       <td class="Selector">
         <input type="radio" name="type_name"
-               tal:attributes="value info/id; id info/id" />
+               tal:attributes="value info/action; id info/action" />
       </td>
 
       <td class="TypeName">
-        <label tal:attributes="for info/id">
-          <img alt="Folder" src="../../ZMI/www/folder_icon.gif"
-               tal:condition="info/icon"
-               tal:attributes="src info/icon" />
+        <label tal:attributes="for info/action">
           <span tal:replace="info/title">Folder</span>
         </label>
       </td>


=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/configure.zcml 1.5 => 1.6 ===
   <!-- Folder View Directives -->
 
+   <browser:view
+       permission="Zope.ManageContent" 
+       for=".Folder.IFolder"
+       name="create"  
+       factory=".Views.Browser.FolderAdding."
+       >
+       <browser:page name="index.html"
+       template="Views/Browser/add.pt" />
+       <browser:page name="action.html" attribute="action" />
+   </browser:view>
+
   <browser:icon name="zmi_icon" for=".Folder.IFolder."
                 file="Folder_icon.gif" />
 
@@ -15,7 +26,8 @@
              action="@@AllRolePermissions.html"/>
   </browser:menuItems>
 
-  <browser:menuItem menu="add_content" for="Zope.App.OFS.Container.IAdding."
+  <browser:menuItem menu="add_content"
+                    for="Zope.App.OFS.Content.Folder.IFolderAdding."
                     title="Folder" action="Folder"
                     />
 
@@ -34,6 +46,9 @@
     <browser:page name="addServiceManager.html"
                   attribute="addServiceManager"
                   />
+    <browser:page name="removeObjects.html"
+                  attribute="removeObjects"
+                  />
   </browser:view>
 
   <!-- Loaded Folder View Directives -->
@@ -75,13 +90,19 @@
     <browser:menuItem title="Limit" action="@@FolderLimitEditForm.html"/>
   </browser:menuItems>
 
+  <!--
+  we already get these from IFolder above
+  
   <browser:menuItems menu="zmi_views" for=".LoadedFolder.ILoadedFolder.">
     <browser:menuItem title="Contents" action="@@index.html"/>
     <browser:menuItem title="Role Permissions" 
              action="@@AllRolePermissions.html"/>
   </browser:menuItems>
+  
+  -->
 
-  <browser:menuItem menu="add_content" for="Zope.App.OFS.Container.IAdding."
+  <browser:menuItem menu="add_content"
+                    for="Zope.App.OFS.Content.Folder.IFolderAdding."
                     title="Loaded Folder" action="LoadedFolder"
                     description="A Folder having all the goodies."
                     />


=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/contents.pt 1.8 => 1.9 ===
 <div>Folder Contents <a href="@@create"> Add... </a> </div>
 
-  <form name="folderContentsForm" method="get" action="@@index.html" 
+  <form name="folderContentsForm" method="get" action="." 
         tal:define="folder_contents view/listContentInfo">
 
     <metal:block tal:condition="folder_contents">
@@ -67,7 +67,7 @@
       </table>
       <br />
 
-      <input type="submit" name="removeObjects:method" value="Delete"
+      <input type="submit" name="@@removeObjects.html:method" value="Delete"
              tal:attributes="value string:menu_delete_button"
              i18n:attributes="value" /> 
 


=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/loaded_folder_contents.pt 1.3 => 1.4 ===
   
     <caption>Folder Contents 
-             <a href="@@addForm.html"> Add... </a> </caption>
+             <a href="@@create"> Add... </a> </caption>
   
     <tbody>