[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Forms/Browser - StandardSubmit.py:1.1.2.1 EditView.py:1.1.4.1 edit.pt:1.1.4.1
Jim Fulton
jim@zope.com
Sat, 30 Nov 2002 07:44:55 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Forms/Browser
In directory cvs.zope.org:/tmp/cvs-serv30047/lib/python/Zope/App/Forms/Browser
Modified Files:
Tag: Zope3-Bangalore-TTW-Branch
EditView.py edit.pt
Added Files:
Tag: Zope3-Bangalore-TTW-Branch
StandardSubmit.py
Log Message:
Refactored the way TTW component registration is done. There are now
separate registry objects that abstract the machinery for registering
multiple conflicting configurations and deciding which, if any are
active. Also provided a new field and widget for the status
information.
Along the way, cleaned up and streamlined placeful testing
infrastructure a bit.
Now checking into branch. Will give file-by-file (or at least more
specific logs) when the changes are merged into the head.
=== Added File Zope3/lib/python/Zope/App/Forms/Browser/StandardSubmit.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.
#
##############################################################################
"""Standard submit button names
Update -- Name of the standard update submit button
$Id: StandardSubmit.py,v 1.1.2.1 2002/11/30 12:44:24 jim Exp $
"""
Update = "UPDATE_SUBMIT"
=== Zope3/lib/python/Zope/App/Forms/Browser/EditView.py 1.1 => 1.1.4.1 ===
--- Zope3/lib/python/Zope/App/Forms/Browser/EditView.py:1.1 Mon Nov 11 15:29:58 2002
+++ Zope3/lib/python/Zope/App/Forms/Browser/EditView.py Sat Nov 30 07:44:24 2002
@@ -27,6 +27,7 @@
from Zope.ComponentArchitecture.GlobalViewService import provideView
from Zope.Publisher.Browser.IBrowserPresentation import IBrowserPresentation
from Zope.App.PageTemplate.SimpleViewClass import SimpleViewClass
+from Zope.App.Forms.Browser.StandardSubmit import Update
class EditView(BrowserView):
@@ -101,7 +102,7 @@
return unchanged
def update(self):
- if "save_submit" in self.request:
+ if Update in self.request:
unchanged = True
try:
data = getWidgetsData(self, self.schema, required=0)
=== Zope3/lib/python/Zope/App/Forms/Browser/edit.pt 1.1 => 1.1.4.1 ===
--- Zope3/lib/python/Zope/App/Forms/Browser/edit.pt:1.1 Mon Nov 11 15:29:58 2002
+++ Zope3/lib/python/Zope/App/Forms/Browser/edit.pt Sat Nov 30 07:44:24 2002
@@ -4,43 +4,52 @@
<div metal:define-macro="body">
- <h1 tal:condition="view/label"
- tal:content="view/label">Edit something</h1>
-
- <p tal:define="status view/update"
- tal:condition="status"
- tal:content="status" />
-
- <div tal:condition="view/errors">
- <ul>
- <li tal:repeat="error view/errors">
- <strong tal:content="error/__class__">
- Error Type</strong>:
- <span tal:content="error">Error text</span>
- </li>
- </ul>
- </div>
-
<form action="." tal:attributes="action request/URL" method="POST"
enctype="multipart/form-data"
>
- <table width="100%" border="0">
- <tr metal:define-slot="extra_top" tal:replace="nothing">
- <td>Extra top</td>
- <td><input type="text" style="width:100%" /></td>
- </tr>
- <tr metal:define-macro="widget_rows" tal:repeat="widget view/widgets"
- tal:content="structure widget/row">
- <td>Name</td>
- <td><input type="text" style="width:100%" /></td>
- </tr>
- <tr metal:define-slot="extra_bottom" tal:replace="nothing">
- <td>Extra bottom</td>
- <td><input type="text" style="width:100%" /></td>
- </tr>
- </table>
+
+ <div metal:define-macro="formbody">
+
+ <h2 tal:condition="view/label"
+ tal:content="view/label">Edit something</h2>
+
+ <p tal:define="status view/update"
+ tal:condition="status"
+ tal:content="status" />
+
+ <div tal:condition="view/errors">
+ <ul>
+ <li tal:repeat="error view/errors">
+ <strong tal:content="error/__class__">
+ Error Type</strong>:
+ <span tal:content="error">Error text</span>
+ </li>
+ </ul>
+ </div>
+
+ <div metal:define-slot="extra_info" tal:replace="nothing">
+ </div>
+
+ <table width="100%" border="0">
+ <tr metal:define-slot="extra_top" tal:replace="nothing">
+ <td>Extra top</td>
+ <td><input type="text" style="width:100%" /></td>
+ </tr>
+ <tr metal:define-macro="widget_rows" tal:repeat="widget view/widgets"
+ tal:content="structure widget/row">
+ <td>Name</td>
+ <td><input type="text" style="width:100%" /></td>
+ </tr>
+ <tr metal:define-slot="extra_bottom" tal:replace="nothing">
+ <td>Extra bottom</td>
+ <td><input type="text" style="width:100%" /></td>
+ </tr>
+ </table>
+
+ </div>
+
<input type="submit" value="Refresh" />
- <input type="submit" name="save_submit" value="Save Changes" />
+ <input type="submit" name="UPDATE_SUBMIT" value="Save Changes" />
</form>