[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container - add.pt:1.13 adding.py:1.21

Garrett Smith garrett at mojave-corp.com
Tue Sep 23 21:10:35 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/browser/container
In directory cvs.zope.org:/tmp/cvs-serv11181/src/zope/app/browser/container

Modified Files:
	add.pt adding.py 
Log Message:
Moved a couple items into the view class to help with reusability:

- Subclasses can specify the Add button label by setting addValue

- Subclasses can specify the form action by setting actionName

Setting the actionName is needed for any add forms that are named
something other than 'action.html'.

=== Zope3/src/zope/app/browser/container/add.pt 1.12 => 1.13 ===
--- Zope3/src/zope/app/browser/container/add.pt:1.12	Fri Aug 15 12:38:30 2003
+++ Zope3/src/zope/app/browser/container/add.pt	Tue Sep 23 21:10:35 2003
@@ -2,7 +2,8 @@
 <body>
 <div metal:fill-slot="body">
 
-  <form action="action.html" method="post">
+  <form action="action.html" method="post"
+    tal:attributes="action view/actionName">
     <table class="TypeListing" cellpadding="3">
 
       <caption tal:content="view/title">Add Content</caption>
@@ -36,8 +37,8 @@
             <input type="text" name="id"
                    tal:condition="view/namesAccepted"
                    tal:attributes="value request/id | nothing" />
-            <input type="submit" value=" Add " 
-                   i18n:attributes="value add-button" />
+            <input type="submit" name="add" value=" Add " 
+                   tal:attributes="value view/addValue" />
         </td>
       </tr>
 


=== Zope3/src/zope/app/browser/container/adding.py 1.20 => 1.21 ===
--- Zope3/src/zope/app/browser/container/adding.py:1.20	Sun Sep 21 13:30:24 2003
+++ Zope3/src/zope/app/browser/container/adding.py	Tue Sep 23 21:10:35 2003
@@ -46,7 +46,11 @@
 
     implements(IAdding, IPublishTraverse)
 
+    actionName = 'action.html'
+
     title = _(u"Add Content")
+
+    addValue = _(u" Add ")
 
     def add(self, content):
         """See zope.app.interfaces.container.IAdding"""




More information about the Zope3-Checkins mailing list