[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Forms/Browser - StandardSubmit.py:1.2 EditView.py:1.2 edit.pt:1.2
Jim Fulton
jim@zope.com
Sat, 30 Nov 2002 13:33:52 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Forms/Browser
In directory cvs.zope.org:/tmp/cvs-serv11417/lib/python/Zope/App/Forms/Browser
Modified Files:
EditView.py edit.pt
Added Files:
StandardSubmit.py
Log Message:
Use a standard submit button name for submitting updates.
=== Zope3/lib/python/Zope/App/Forms/Browser/StandardSubmit.py 1.1 => 1.2 ===
--- /dev/null Sat Nov 30 13:33:52 2002
+++ Zope3/lib/python/Zope/App/Forms/Browser/StandardSubmit.py Sat Nov 30 13:33:52 2002
@@ -0,0 +1,22 @@
+##############################################################################
+#
+# 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$
+"""
+
+Update = "UPDATE_SUBMIT"
=== Zope3/lib/python/Zope/App/Forms/Browser/EditView.py 1.1 => 1.2 ===
--- 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 13:33:52 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.2 ===
--- 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 13:33:52 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>