[Zope3-checkins] CVS: Zope3/src/zope/app/browser/content - configure.zcml:1.33 dtmlpageeval.py:1.4 file.py:1.4 folder.py:1.4 fromFS.pt:1.3 fssync.py:1.22 i18n.py:1.4 i18n_edit.pt:1.7 i18nimage.py:1.5 i18nimageedit.pt:1.8 image.py:1.5 imageedit.pt:1.6 preview.pt:1.3 sql.py:1.10 sqltest.pt:1.5 sqltestresults.pt:1.4 xmldocument.py:1.2 zpt.py:1.4

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Aug 6 11:42:25 EDT 2003


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

Modified Files:
	configure.zcml dtmlpageeval.py file.py folder.py fromFS.pt 
	fssync.py i18n.py i18n_edit.pt i18nimage.py i18nimageedit.pt 
	image.py imageedit.pt preview.pt sql.py sqltest.pt 
	sqltestresults.pt xmldocument.py zpt.py 
Log Message:
Internationalized a whole bunch templates and screens. I also took the 
oppurtunity to clean some old code up. 

I noticed that particularly the basic Content Objects are in bad shape.

There is still a lot left to do!


=== Zope3/src/zope/app/browser/content/configure.zcml 1.32 => 1.33 ===
--- Zope3/src/zope/app/browser/content/configure.zcml:1.32	Sun Aug  3 13:48:54 2003
+++ Zope3/src/zope/app/browser/content/configure.zcml	Wed Aug  6 10:41:41 2003
@@ -1,64 +1,55 @@
 <configure
-   xmlns="http://namespaces.zope.org/zope"
-   xmlns:browser="http://namespaces.zope.org/browser"
-   xmlns:help="http://namespaces.zope.org/help"
-   i18n_domain='zope'
-   >
+   xmlns="http://namespaces.zope.org/browser"
+   xmlns:help="http://namespaces.zope.org/help">
 
 <!-- File View Directives -->
 
-  <browser:editform
+  <editform
       name="edit.html"
       schema="zope.app.interfaces.content.file.IFile"
       label="Change a file"
-      permission="zope.ManageContent"
-      />
+      permission="zope.ManageContent" />
 
-  <browser:menuItem
+  <menuItem
       menu="zmi_views" title="Edit"
       for="zope.app.interfaces.content.file.IFile"
       action="edit.html"
       filter="python:context.contentType.startswith('text/')"
-      permission="zope.ManageContent"
-      />
+      permission="zope.ManageContent" />
 
-  <browser:editform
+  <editform
       name="upload.html"
       menu="zmi_views" title="Upload"
       schema="zope.app.interfaces.content.file.IFile"
       label="Upload a file"
       permission="zope.ManageContent"
-      class=".file.FileUpload"
-      />
+      class=".file.FileUpload" />
 
-  <browser:page
+  <page
       for="zope.app.interfaces.content.file.IFile"
       name="preview.html"
       menu="zmi_views" title="Preview"
       template="preview.pt"
-      permission="zope.ManageContent"
-      />
+      permission="zope.ManageContent" />
 
-  <browser:page
+  <page
       for="zope.app.interfaces.content.file.IFile"
       name="index.html"
       permission="zope.View"
       class="zope.app.browser.content.file.FileView"
-      attribute="show"
-      />
+      attribute="show" />
 
-  <browser:menuItem menu="add_content"
+  <menuItem 
+      menu="add_content"
       for="zope.app.interfaces.container.IAdding"
       title="File"
       action="File"
-      description="A file object, suitable for large data."
-      />
+      description="A file object, suitable for large data." />
 
-  <browser:icon
+  <icon
       name="zmi_icon"
       for="zope.app.interfaces.content.file.IFile"
-      file="file_icon.gif"
-      />
+      file="file_icon.gif" />
 
   <help:register
       id="file_upload"
@@ -66,48 +57,39 @@
       parent="ui"
       for="zope.app.interfaces.content.file.IFile"
       view="upload.html"
-      doc_path="./file_upload.hlp"
-      />
+      doc_path="./file_upload.hlp" />
 
 <!-- I18n File View Directives -->
 
-  <browser:page
+  <page
       name="index.html"
       for="zope.app.interfaces.content.i18nfile.II18nFile"
       permission="zope.View"
-      class="zope.app.browser.content.i18n.I18nFileView"
-      />
+      class="zope.app.browser.content.i18n.I18nFileView" />
 
-  <browser:pages
+  <pages
       for="zope.app.interfaces.content.i18nfile.II18nFile"
       permission="zope.View"
       class="zope.app.browser.content.i18n.I18nFileEdit">
 
-      <browser:page
-          name="editForm.html"
-          template="i18n_edit.pt"
-          />
-      <browser:page
-          name="edit.html"
-          attribute="action"
-          />
+    <page name="editForm.html" template="i18n_edit.pt" />
+    <page name="edit.html" attribute="action" />
 
-  </browser:pages>
+  </pages>
 
-  <browser:menuItems menu="zmi_views"
+  <menuItems menu="zmi_views"
       for="zope.app.interfaces.content.i18nfile.II18nFile">
 
       <!-- Keep original edit view, for now -->
-      <browser:menuItem title="Edit" action="editForm.html" />
+      <menuItem title="Edit" action="editForm.html" />
 
       <!-- Supress the upload view from file -->
-      <browser:menuItem title="Upload" action="editForm.html"
-                        filter="python: 0"
-                        />
+      <menuItem title="Upload" action="editForm.html"
+                        filter="python: 0" />
 
-  </browser:menuItems>
+  </menuItems>
 
-  <browser:menuItem menu="add_content"
+  <menuItem menu="add_content"
       for="zope.app.interfaces.container.IAdding"
       title="I18n File"
       action="zope.app.content.I18nFile"
@@ -116,7 +98,7 @@
 
 <!-- Image -->
 
-  <browser:editform
+  <editform
       schema="zope.app.content.image.IImage"
       name="upload.html"
       menu="zmi_views" title="Upload"
@@ -126,7 +108,7 @@
       template="imageedit.pt"
       />
 
-  <browser:page
+  <page
       name="index.html"
       for="zope.app.content.image.IImage"
       permission="zope.View"
@@ -134,7 +116,7 @@
       class="zope.app.browser.content.image.ImageData"
       />
 
-  <browser:page
+  <page
       for="zope.app.interfaces.content.image.IImage"
       name="preview.html"
       menu="zmi_views" title="Preview"
@@ -142,13 +124,13 @@
       permission="zope.ManageContent"
       />
 
-  <browser:icon
+  <icon
       name="zmi_icon"
       for="zope.app.content.image.IImage"
       file="image_icon.gif"
       />
 
-  <browser:menuItem
+  <menuItem
       menu="add_content"
       for="zope.app.interfaces.container.IAdding"
       title="Image"
@@ -158,7 +140,7 @@
 
 <!-- I18n Image -->
 
-  <browser:page
+  <page
       name="index.html"
       for="zope.app.interfaces.content.i18nimage.II18nImage"
       permission="zope.View"
@@ -166,164 +148,143 @@
       class="zope.app.browser.content.i18nimage.I18nImageData"
       />
 
-  <browser:pages
+  <pages
       for="zope.app.content.i18nimage.II18nImage"
       permission="zope.ManageContent"
       class="zope.app.browser.content.i18nimage.I18nImageEdit">
 
-      <browser:page name="upload.html" template="i18nimageedit.pt" />
-      <browser:page name="uploadAction.html" attribute="action" />
+      <page name="upload.html" template="i18nimageedit.pt" />
+      <page name="uploadAction.html" attribute="action" />
 
-      </browser:pages>
+      </pages>
 
-  <browser:menuItems
+  <menuItems
       menu="zmi_views"
       for="zope.app.content.i18nimage.II18nImage"
       >
 
       <!-- Keep the old "edit" form -->
-      <browser:menuItem title="Edit" action="upload.html"/>
+      <menuItem title="Edit" action="upload.html"/>
 
       <!-- Suppress upload form (from IFile) -->
-      <browser:menuItem title="Uload" action="upload.html"
+      <menuItem title="Uload" action="upload.html"
                         filter="python: 0" />
 
-  </browser:menuItems>
+  </menuItems>
 
-  <browser:menuItem
+  <menuItem
       menu="add_content"
       for="zope.app.interfaces.container.IAdding"
       title="I18n Image"
       action="I18nImage"
-      description="A multi-locale version of an Image."
-      />
+      description="A multi-locale version of an Image." />
 
 <!-- ZPT Page View Directives -->
 
-  <browser:page
+  <page
       name="index.html"
       for="zope.app.content.zpt.IZPTPage"
       class="zope.app.browser.content.zpt.ZPTPageEval"
       attribute="index"
-      permission="zope.View"
-      />
+      permission="zope.View" />
 
-  <browser:page
+  <page
       name="source.html"
       for="zope.app.content.zpt.IZPTPage"
       class="zope.app.content.zpt.ZPTSourceView"
       attribute="__call__"
-      permission="zope.ManageContent"
-      />
+      permission="zope.ManageContent" />
 
-  <browser:editform
+  <editform
       schema="zope.app.content.zpt.IZPTPage"
       name="edit.html"
       menu="zmi_views"
       label="Edit a ZPT page"
-      permission="zope.ManageContent"
-      />
+      permission="zope.ManageContent" />
 
-  <browser:page
+  <page
       for="zope.app.content.zpt.IZPTPage"
       name="preview.html"
       menu="zmi_views" title="Preview"
       template="preview.pt"
-      permission="zope.ManageContent"
-      />
+      permission="zope.ManageContent" />
 
-  <browser:icon name="zmi_icon"
-           for="zope.app.content.zpt.IZPTPage" file="zpt.gif" />
+  <icon 
+      name="zmi_icon"
+      for="zope.app.content.zpt.IZPTPage" 
+      file="zpt.gif" />
 
-  <browser:menuItem
+  <menuItem
       menu="add_content"
       for="zope.app.interfaces.container.IAdding"
-      title="Templated Page" action="ZPTPage"
-      description="An object for dynamic content based on Page Templates."
-      />
+      action="ZPTPage"
+      title="Templated Page"
+      description="An object for dynamic content based on Page Templates." />
 
 <!-- Folder View Directives -->
-  <browser:icon
+  <icon
       name="zmi_icon"
       for="zope.app.interfaces.content.folder.IFolder"
-      file="folder_icon.gif"
-      />
+      file="folder_icon.gif" />
 
-  <browser:menuItem menu="add_content"
+  <menuItem 
+      menu="add_content"
       for="zope.app.interfaces.container.IAdding"
-      title="Folder" action="Folder"
-      description="A simple Folder."
-      />
+      action="Folder"
+      title="Folder" 
+      description="A simple Folder." />
 
-  <browser:page
+  <page
       name="contents.html"
       menu="zmi_views" title="Contents"
       for="zope.app.interfaces.content.folder.IFolder"
       permission="zope.ManageContent"
       class="zope.app.browser.container.contents.Contents"
-      attribute="contents"
-      />
+      attribute="contents" />
 
-  <browser:page
+  <page
       name="index.html"
       for="zope.app.interfaces.content.folder.IFolder"
       permission="zope.View"
       class="zope.app.browser.container.contents.Contents"
-      attribute="index"
-      />
+      attribute="index" />
 
-  <browser:page
+  <page
       for="zope.app.interfaces.content.folder.IFolder"
       name="preview.html"
       menu="zmi_views" title="Preview"
       template="preview.pt"
-      permission="zope.ManageContent"
-      />
+      permission="zope.ManageContent" />
 
   <!-- ApplicationController navigation -->
 
-  <browser:menuItems menu="zmi_actions"
-    for="zope.app.interfaces.content.folder.IRootFolder">
-
-    <browser:menuItem title="Manage Process"
-              action="++etc++process/index.html"
-              />
+  <menuItem 
+      menu="zmi_actions"
+      for="zope.app.interfaces.content.folder.IRootFolder"
+      title="Manage Process" 
+      action="++etc++process/index.html" />
 
-  </browser:menuItems>
+  <!-- SQL Script View Directives -->
 
-<!-- SQL Script View Directives -->
-
-  <browser:editform
+  <editform
       schema="zope.app.interfaces.content.sql.ISQLScript"
       name="edit.html"
       menu="zmi_views"
       label="Edit an SQL script"
-      permission="zope.ManageContent"
-      />
+      permission="zope.ManageContent" />
 
-  <browser:pages
+  <pages
       for="zope.app.interfaces.content.sql.ISQLScript"
       permission="zope.View"
       class="zope.app.browser.content.sql.SQLScriptTest" >
 
-    <browser:page
-        name="test.html"
-        template="sqltest.pt"
-        />
-    <browser:page
-        name="testResults.html"
-        template="sqltestresults.pt" />
+    <page name="test.html" template="sqltest.pt" 
+          menu="zmi_views" title="Test" />
+    <page name="testResults.html" template="sqltestresults.pt" />
 
-  </browser:pages>
+  </pages>
 
-  <browser:menuItem
-      menu="zmi_views"
-      for="zope.app.interfaces.content.sql.ISQLScript"
-      title="Test"
-      action="test.html"
-      />
-
-  <browser:menuItem
+  <menuItem
       menu="add_content"
       for="zope.app.interfaces.container.IAdding"
       title="SQLScript"
@@ -333,101 +294,92 @@
 
 <!-- DTML Page View Directives -->
 
-  <browser:page
+  <page
       name="index.html"
       for="zope.app.content.dtmlpage.IDTMLPage"
       permission="zope.View"
       class="zope.app.browser.content.dtmlpageeval.DTMLPageEval"
-      attribute="index"
-      />
+      attribute="index" />
 
-  <browser:editform
+  <editform
       schema="zope.app.content.dtmlpage.IDTMLPage"
       name="edit.html"
       menu="zmi_views"
       label="Edit a DTML page"
-      permission="zope.ManageContent"
-      />
+      permission="zope.ManageContent" />
 
-  <browser:page
+  <page
       for="zope.app.content.dtmlpage.IDTMLPage"
       name="preview.html"
       menu="zmi_views" title="Preview"
       template="preview.pt"
-      permission="zope.ManageContent"
-      />
+      permission="zope.ManageContent" />
 
-  <browser:icon
+  <icon
       name="zmi_icon"
       for="zope.app.content.dtmlpage.IDTMLPage"
-      file="dtml.gif"
-      />
+      file="dtml.gif" />
 
-  <browser:menuItem
+  <menuItem
       menu="add_content"
       for="zope.app.interfaces.container.IAdding"
-      title="DTML Page" action="DTMLPage"
+      action="DTMLPage"
+      title="DTML Page"
       description="An object for dynamic content based on Document Templates."
       />
 
 
 <!-- XML Document View Directives -->
 
-  <browser:page
+  <page
       name="index.html"
       for="zope.app.content.xmldocument.IXMLDocument"
       class="zope.app.browser.content.xmldocument.XMLDocumentView"
       attribute="show"
-      permission="zope.View"
-      />
+      permission="zope.View" />
 
-  <browser:editform
+  <editform
       schema="zope.app.content.xmldocument.IXMLDocument"
       name="edit.html"
       menu="zmi_views"
       label="Edit an XML document"
-      permission="zope.ManageContent"
-      />
+      permission="zope.ManageContent" />
 
   <!-- XXX we don't have an icon for this yet
-  <browser:icon name="zmi_icon"
+  <icon name="zmi_icon"
            for="zope.app.content.xmldocument.IXMLDocument" file="xml.gif" />
   -->
 
-  <browser:menuItem
+  <menuItem
       menu="add_content"
       for="zope.app.interfaces.container.IAdding"
       title="XML Document" action="XMLDocument"
-      description="An object storing XML text."
-      />
+      description="An object storing XML text." />
 
   <!-- toFS.snarf and fromFS.snarf views, for new fssync tools -->
 
   <!-- fssync checkout, update -->
-  <browser:page
+  <page
       for="zope.interface.Interface"
       name="toFS.snarf"
       permission="zope.ManageServices"
       class="zope.app.browser.content.fssync.SnarfFile"
-      attribute="show"
-      />
+      attribute="show" />
 
   <!-- fssync commit -->
-  <browser:page
+  <page
       for="zope.interface.Interface"
       name="fromFS.snarf"
       permission="zope.ManageServices"
       class="zope.app.browser.content.fssync.SnarfCommit"
-      attribute="commit"
-      />
+      attribute="commit" />
 
   <!-- fssync checkin -->
-  <browser:page
+  <page
       for="zope.interface.Interface"
       name="checkin.snarf"
       permission="zope.ManageServices"
       class="zope.app.browser.content.fssync.SnarfCommit"
-      attribute="checkin"
-      />
+      attribute="checkin" />
 
 </configure>


=== Zope3/src/zope/app/browser/content/dtmlpageeval.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/content/dtmlpageeval.py:1.3	Wed Apr 30 19:37:51 2003
+++ Zope3/src/zope/app/browser/content/dtmlpageeval.py	Wed Aug  6 10:41:41 2003
@@ -15,10 +15,9 @@
 
 $Id$
 """
+__metaclass__ = type
 
-from zope.publisher.browser import BrowserView
-
-class DTMLPageEval(BrowserView):
+class DTMLPageEval:
 
     def index(self, REQUEST=None, **kw):
         """Call a Page Template"""


=== Zope3/src/zope/app/browser/content/file.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/content/file.py:1.3	Thu Jun  5 16:13:07 2003
+++ Zope3/src/zope/app/browser/content/file.py	Wed Aug  6 10:41:41 2003
@@ -11,15 +11,16 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""File views.
 
 $Id$
 """
+from zope.app.browser.form.widget import FileWidget
+from zope.app.form.widget import CustomWidget
 
-from zope.publisher.browser import BrowserView
-
+__metaclass__ = type
 
-class FileView(BrowserView):
+class FileView:
 
     def show(self):
         """Call the File"""
@@ -33,21 +34,7 @@
         return self.context.getData()
 
 
-"""
-$Id$
-"""
-
-__metaclass__ = type
-
-from zope.app.browser.form.widget import FileWidget
-from zope.app.form.widget import CustomWidget
-
 class FileUpload:
-    """File editing mix-in that uses a file-upload widget.
-    """
+    """File editing mix-in that uses a file-upload widget."""
 
     data_widget = CustomWidget(FileWidget)
-
-
-
-__doc__ = FileUpload.__doc__ + __doc__


=== Zope3/src/zope/app/browser/content/folder.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/content/folder.py:1.3	Fri Jun  6 17:35:16 2003
+++ Zope3/src/zope/app/browser/content/folder.py	Wed Aug  6 10:41:41 2003
@@ -11,7 +11,7 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""Felder-spcific view classes
 
 $Id$
 """
@@ -20,5 +20,4 @@
 from zope.app.interfaces.content.folder import IFolderAdding
 
 class FolderAdding(Adding):
-
     implements(IFolderAdding)


=== Zope3/src/zope/app/browser/content/fromFS.pt 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/content/fromFS.pt:1.2	Wed Jun 25 14:43:03 2003
+++ Zope3/src/zope/app/browser/content/fromFS.pt	Wed Aug  6 10:41:41 2003
@@ -2,24 +2,24 @@
 <body>
 <div metal:fill-slot="body">
 
-<h1>Commit Action</h1>
+  <h1 i18n:translate="">Commit Action</h1>
 
-<div tal:define="status view/update"
-     tal:condition="status">
-Commit results:
-<pre tal:content="status">
-Status from update method goes here.
-</pre>
-</div>
+  <div tal:define="status view/update"
+       tal:condition="status"
+       i18n:translate="">
+  Commit results:
+  <pre tal:content="status" i18n:name="results">
+    Status from update method goes here.
+  </pre>
+  </div>
 
-<p>Upload a zipfile in the following form</p>
+  <p i18n:translate="">Upload a zipfile in the following form</p>
 
-<form method="post" action="@@fromFS.html" enctype="multipart/form-data">
-
-  <input type="file" name="zipfile" size="40" />
-  <input type="submit" />
-
-</form>
+  <form method="post" action="@@fromFS.html" enctype="multipart/form-data">
+    <input type="file" name="zipfile" size="40" />
+    <input type="submit" value="Upload"
+           i18n:attributes="value upload-button"/>
+  </form>
 
 </div>
 </body>


=== Zope3/src/zope/app/browser/content/fssync.py 1.21 => 1.22 ===
--- Zope3/src/zope/app/browser/content/fssync.py:1.21	Fri Jun 13 13:41:12 2003
+++ Zope3/src/zope/app/browser/content/fssync.py	Wed Aug  6 10:41:41 2003
@@ -11,12 +11,10 @@
 # FOR A PARTICULAR PURPOSE.
 # 
 ##############################################################################
-
 """Code for the toFS.snarf view and its inverse, fromFS.snarf.
 
 $Id$
 """
-
 import os
 import cgi
 import shutil
@@ -32,6 +30,8 @@
 from zope.app.fssync.committer import Committer, Checker
 from zope.fssync.metadata import Metadata
 
+from zope.app.i18n import ZopeMessageIDFactory as _
+
 def snarf_dir(response, dirname):
     """Helper to snarf a directory to the response."""
     response.setStatus(200)
@@ -41,7 +41,6 @@
     return ""
 
 class SnarfFile(BrowserView):
-
     """View returning a snarfed representation of an object tree.
 
     This applies to any object (for="zope.interface.Interface").
@@ -68,7 +67,6 @@
         return entry
 
 class SnarfCommit(BrowserView):
-
     """View for committing and checking in changes.
 
     The input to commit() should be a POST request whose data is a
@@ -119,7 +117,7 @@
 
     def check_content_type(self):
         if not self.request.getHeader("Content-Type") == "application/x-snarf":
-            raise ValueError("Content-Type is not application/x-snarf")
+            raise ValueError(_("Content-Type is not application/x-snarf"))
 
     def set_transaction(self):
         self.txn = get_transaction()
@@ -161,7 +159,7 @@
         # Compute self.{name, container, fspath} for checkin()
         name = self.get_arg("name")
         if not name:
-            raise ValueError("required argument 'name' missing")
+            raise ValueError(_("required argument 'name' missing"))
         src = self.get_arg("src")
         if not src:
             src = name
@@ -201,7 +199,7 @@
 
     def send_errors(self):
         self.txn.abort()
-        lines = ["Up-to-date check failed:"]
+        lines = [_("Up-to-date check failed:")]
         tempdir_sep = os.path.join(self.tempdir, "") # E.g. foo -> foo/
         for e in self.errors:
             lines.append(e.replace(tempdir_sep, ""))


=== Zope3/src/zope/app/browser/content/i18n.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/content/i18n.py:1.3	Fri Jun  6 17:35:16 2003
+++ Zope3/src/zope/app/browser/content/i18n.py	Wed Aug  6 10:41:41 2003
@@ -11,17 +11,14 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""I18n versions of several content objects.
 
 $Id$
 """
-
-from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
 from zope.i18n.negotiator import negotiator
-from zope.publisher.browser import BrowserView
 
 
-class I18nFileView(BrowserView):
+class I18nFileView:
 
     def __call__(self):
         """Call the File"""
@@ -39,15 +36,13 @@
         return self.context.getData(language)
 
 
-class I18nFileEdit(BrowserView):
+class I18nFileEdit:
 
     name = 'editForm'
     title = 'Edit Form'
     description = ('This edit form allows you to make changes to the ' +
                    'properties of this file.')
 
-    template = ViewPageTemplateFile('i18n_edit.pt')
-
     def action(self, contentType, data, language, defaultLanguage,
                selectLanguage=None, removeLanguage=None,
                addLanguage=None, newLanguage=None):
@@ -62,4 +57,4 @@
             self.context.setDefaultLanguage(defaultLanguage)
             self.context.edit(data, contentType, language)
         return self.request.response.redirect(self.request.URL[-1] +
-                      "/editForm.html?language=%s" % language)  # XXX url_quote
+                      "/editForm.html?language=%s" %language)  # XXX url_quote


=== Zope3/src/zope/app/browser/content/i18n_edit.pt 1.6 => 1.7 ===
--- Zope3/src/zope/app/browser/content/i18n_edit.pt:1.6	Mon Jun 30 13:04:42 2003
+++ Zope3/src/zope/app/browser/content/i18n_edit.pt	Wed Aug  6 10:41:41 2003
@@ -1,100 +1,98 @@
 <html metal:use-macro="views/standard_macros/page">
-  <head>
-    <style metal:fill-slot="headers" type="text/css">
-      <!--
-      .ContentIcon {
-          width: 20px;
-      }
-
-      .ContentTitle {
-          text-align: left;
-      }
-      -->
-    </style>
-  </head>
-
-  <body>
-    <div metal:fill-slot="body">
-
-      <p tal:content="context/msg"
-         tal:condition="python: hasattr(context, 'msg')">
-        Message will go here.
-      </p>
-
-      <p tal:content="view/description">
-        Description of the Form.
-      </p>
-
-      <form action="edit.html" method="post">
-
-        <table class="EditTable">
-          <tbody>
-
-            <tr>
-              <th class="EditAttributeName">Content Type</th>
-              <td class="EditAttributeValue">
-                <input name="contentType" type="text" size="20"
-                       tal:attributes="value context/getContentType" />
-              </td>
-            </tr>
-            <tr>
-              <th class="EditAttributeName">Default Language</th>
-              <td class="EditAttributeValue">
-                <select name="defaultLanguage">
-                  <span tal:repeat="lang context/getAvailableLanguages"
-                        tal:omit-tag="">
-                  <option tal:attributes="value lang;
-                                          selected python:context.getDefaultLanguage() == lang"
-                          tal:content="lang" />
-                 </span>
-                </select>
-              </td>
-            </tr>
-            <tr>
-              <td colspan="2">
-                <hr />
-              </td>
-            </tr>
-            <tr>
-              <th class="EditAttributeName">Language</th>
-              <td class="EditAttributeValue">
-                <select name="language">
-                  <span tal:repeat="lang context/getAvailableLanguages"
-                        tal:omit-tag="">
-                  <option tal:attributes="value    lang;
-                                          selected python:request.get('language',
-                                                   context.getDefaultLanguage()) == lang"
-                          tal:content="lang" />
-                 </span>
-                </select>
-                <input type="submit" name="selectLanguage"
-                       value="Show" />
-                <input type="submit" name="removeLanguage"
-                       value="Remove" />
-                &nbsp;&nbsp;
-                <input type="submit" name="addLanguage"
-                       value="Add new language" />
-                <input type="text" name="newLanguage" size="10" />
-              </td>
-            </tr>
-            <tr>
-              <th class="EditAttributeName">Data</th>
-              <td class="EditAttributeValue">
-                <textarea name="data" cols="70" rows="10"
-                 tal:content="python:context.getData(request.get('language'))">
-                </textarea>
-              </td>
-            </tr>
-
-          </tbody>
-      </table>
+<head>
+  <style metal:fill-slot="headers" type="text/css">
+    <!--
+    .ContentIcon {
+        width: 20px;
+    }
+
+    .ContentTitle {
+        text-align: left;
+    }
+    -->
+  </style>
+</head>
+
+<body>
+<div metal:fill-slot="body">
+
+  <p tal:content="context/msg"
+     tal:condition="python: hasattr(context, 'msg')">
+    Message will go here.
+  </p>
+
+  <p tal:content="view/description">
+    Description of the Form.
+  </p>
+
+  <form action="edit.html" method="post">
+
+    <div class="row">
+      <div class="label" i18n:translate="">Content Type</div>
+      <div class="field">
+        <input name="contentType" type="text" size="20"
+               tal:attributes="value context/getContentType" />
+      </div>
+    </div>
+    
+    <div class="row">
+      <div class="label" i18n:translate="">Default Language</div>
+      <div class="field">
+        <select name="defaultLanguage">
+          <span tal:repeat="lang context/getAvailableLanguages"
+                tal:omit-tag="">
+          <option tal:attributes="
+                      value lang;
+                      selected python:context.getDefaultLanguage() == lang"
+                  tal:content="lang" />
+         </span>
+        </select>
+      </div>
+    </div>
+    <hr />
+    <div class="row">
+      <div class="label" i18n:translate="">Language</div>
+      <div class="field">
+        <select name="language">
+          <span tal:repeat="lang context/getAvailableLanguages"
+                tal:omit-tag="">
+          <option tal:attributes="
+                      value lang;
+                      selected python:request.get('language',
+                                      context.getDefaultLanguage()) == lang"
+                  tal:content="lang" />
+         </span>
+        </select>
+        <input type="submit" name="selectLanguage" value="Show" 
+               i18n:attributes="value show-button"/>
+        <input type="submit" name="removeLanguage"
+               i18n:attributes="value remove-button"/>
+        &nbsp;&nbsp;
+        <input type="submit" name="addLanguage"
+               value="Add new language"
+               i18n:attributes="value" />
+        <input type="text" name="newLanguage" size="10" />
+      </div>
+    </div>
+    <div class="row">
+      <div class="label" i18n:translate="">Data</div>
+      <div class="field">
+        <textarea name="data" cols="70" rows="10"
+             tal:content="python:context.getData(request.get('language'))" />
+      </div>
+    </div>
 
-      <input type="submit" name="edit" value="Save Changes" />
+    <div class="row">
+      <div class="controls">
+        <input type="submit" name="edit" value="Save Changes" 
+               i18n:attributes="value save-changes-button"/>
+      </div>
+    </div>
 
-      </form>
+  </form>
 
-    </div>
-  </body>
+</div>
+</body>
 </html>
 
 


=== Zope3/src/zope/app/browser/content/i18nimage.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/content/i18nimage.py:1.4	Fri Jun  6 17:35:16 2003
+++ Zope3/src/zope/app/browser/content/i18nimage.py	Wed Aug  6 10:41:41 2003
@@ -11,26 +11,23 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
-Define view component for image editing.
+"""Define view component for image editing.
 
-Revision Information:
 $Id$
 """
-
 from zope.app.browser.content.image import ImageData
 from zope.i18n.negotiator import negotiator
-from zope.publisher.browser import BrowserView
-
+from zope.app.i18n import ZopeMessageIDFactory as _
 
-class I18nImageEdit(BrowserView):
+class I18nImageEdit:
 
     name = 'editForm'
-    title = 'Edit Form'
-    description = ('This edit form allows you to make changes to the ' +
+    title = _('Edit Form')
+    description = _('This edit form allows you to make changes to the ' +
                    'properties of this image.')
 
     def getImageSize(self, language=None):
+        # XXX Change to ISizeable adapter
         size = self.context.getImageSize(language)
         return "%d x %d" % (size[0], size[1])
 


=== Zope3/src/zope/app/browser/content/i18nimageedit.pt 1.7 => 1.8 ===
--- Zope3/src/zope/app/browser/content/i18nimageedit.pt:1.7	Mon Jun 30 13:04:42 2003
+++ Zope3/src/zope/app/browser/content/i18nimageedit.pt	Wed Aug  6 10:41:41 2003
@@ -1,119 +1,110 @@
 <html metal:use-macro="views/standard_macros/page">
-  <head>
-    <style metal:fill-slot="headers" type="text/css">
-      <!--
-      .ContentIcon {
-          width: 20px;
-      }
-
-      .ContentTitle {
-          text-align: left;
-      }
-      -->
-    </style>
-  </head>
-
-  <body>
-    <div metal:fill-slot="body">
-
-
-      <p tal:content="options/msg | nothing">
-        Message will go here.
-      </p>
-
-      <p tal:content="view/description">
-        Description of the Form.
-      </p>
-
-
-      <form action="uploadAction.html" method="post" 
-            enctype="multipart/form-data">
-
-        <table class="EditTable">
-          <tbody>
-
-            <tr>
-              <th class="EditAttributeName">Content Type</th>
-              <td class="EditAttributeValue">
-                <input name="contentType" type="text" size="20"
-                       tal:attributes="value context/getContentType" />
-              </td>
-            </tr>
-            <tr>
-              <th class="EditAttributeName">Default Language</th>
-              <td class="EditAttributeValue">
-                <select name="defaultLanguage">
-                  <span tal:repeat="lang context/getAvailableLanguages"
-                        tal:omit-tag="">
-                  <option tal:attributes="value    lang;
-                                          selected python:context.getDefaultLanguage() == lang"
-                          tal:content="lang" />
-                 </span>
-                </select>
-              </td>
-            </tr>
-            <tr>
-              <td colspan="2">
-                <hr />
-              </td>
-            </tr>
-            <tr>
-              <th class="EditAttributeName">Language</th>
-              <td class="EditAttributeValue">
-                <select name="language">
-                  <span tal:repeat="lang context/getAvailableLanguages"
-                        tal:omit-tag="">
-                  <option selected
-                          tal:attributes="value lang"
-                          tal:condition="python:request.get('language',
-                                context.getDefaultLanguage()) == lang"
-                          tal:content="lang" />
-                  <option
-                          tal:attributes="value lang"
-                          tal:condition="python:request.get('language',
-                                context.getDefaultLanguage()) != lang"
-                          tal:content="lang" />
-                 </span>
-                </select>
-                <input type="submit" name="selectLanguage"
-                       value="Show" />
-                <input type="submit" name="removeLanguage"
-                       value="Remove" />
-                &nbsp;&nbsp;
-                <input type="submit" name="addLanguage"
-                       value="Add new language" />
-                <input type="text" name="newLanguage" size="10" />
-              </td>
-            </tr>
-            <tr>
-              <th class="EditAttributeName">Data</th>
-              <td class="EditAttributeValue">
-                <input type="file" name="data" size="20" />
-              </td>
-            </tr>
-
-            <tr>
-              <th class="EditAttributeName">Dimensions</th>
-              <td class="EditAttributeValue"
-                  tal:content="python:view.getImageSize(
-                                        request.get('language'))">
-              </td>
-            </tr>
-            <tr>
-              <th class="EditAttributeName">Size</th>
-              <td class="EditAttributeValue"
-                  tal:content="python:context.getSize(
-                                        request.get('language'))">
-              </td>
-            </tr>
-
-          </tbody>
-      </table>
+<head>
+  <style metal:fill-slot="headers" type="text/css">
+    <!--
+    .ContentIcon {
+        width: 20px;
+    }
+
+    .ContentTitle {
+        text-align: left;
+    }
+    -->
+  </style>
+</head>
+
+<body>
+<div metal:fill-slot="body">
+
+
+  <p tal:content="options/msg | nothing">
+    Message will go here.
+  </p>
+
+  <p tal:content="view/description">
+    Description of the Form.
+  </p>
+
+  <form action="uploadAction.html" method="post" 
+        enctype="multipart/form-data">
+
+    <div class="row">
+      <div class="label" i18n:translate="">Content Type</div>
+      <div class="field">
+        <input name="contentType" type="text" size="20"
+               tal:attributes="value context/getContentType" />
+      </div>
+    </div>
+    
+    <div class="row">
+      <div class="label" i18n:translate="">Default Language</div>
+      <div class="field">
+        <select name="defaultLanguage">
+          <span tal:repeat="lang context/getAvailableLanguages"
+                tal:omit-tag="">
+          <option tal:attributes="
+                      value lang;
+                      selected python:context.getDefaultLanguage() == lang"
+                  tal:content="lang" />
+         </span>
+        </select>
+      </div>
+    </div>
+    <hr />
+    <div class="row">
+      <div class="label" i18n:translate="">Language</div>
+      <div class="field">
+        <select name="language">
+          <span tal:repeat="lang context/getAvailableLanguages"
+                tal:omit-tag="">
+          <option tal:attributes="
+                      value lang;
+                      selected python:request.get('language',
+                                      context.getDefaultLanguage()) == lang"
+                  tal:content="lang" />
+         </span>
+        </select>
+        <input type="submit" name="selectLanguage" value="Show" 
+               i18n:attributes="value show-button"/>
+        <input type="submit" name="removeLanguage"
+               i18n:attributes="value remove-button"/>
+        &nbsp;&nbsp;
+        <input type="submit" name="addLanguage"
+               value="Add new language"
+               i18n:attributes="value" />
+        <input type="text" name="newLanguage" size="10" />
+      </div>
+    </div>
+    <div class="row">
+      <div class="label" i18n:translate="">Data</div>
+      <div class="field">
+        <input type="file" name="data" size="20" />
+      </div>
+    </div>
+    <div class="row">
+      <div class="label" i18n:translate="">Dimensions</div>
+      <div class="field"
+          tal:content="python:view.getImageSize(request.get('language'))">
+        40 x 40
+      </div>
+    </div>
+    <div class="row">
+      <div class="label" i18n:translate="">Dimensions</div>
+      <div class="field"
+          tal:content="python:view.getSize(request.get('language'))">
+        40 kB
+      </div>
+    </div>
 
-      <input type="submit" name="edit" value="Save Changes" />
+    <div class="row">
+      <div class="controls">
+        <input type="submit" name="edit" value="Save Changes" 
+               i18n:attributes="value save-changes-button"/>
+      </div>
+    </div>
 
-      </form>
+  </form>
 
-    </div>
-  </body>
+</div>
+</body>
 </html>


=== Zope3/src/zope/app/browser/content/image.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/content/image.py:1.4	Wed Apr 30 19:37:51 2003
+++ Zope3/src/zope/app/browser/content/image.py	Wed Aug  6 10:41:41 2003
@@ -11,11 +11,10 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-""" Define view component for naive file editing.
+"""Define view component for naive file editing.
 
 $Id$
 """
-
 from zope.app.browser.content.file import FileUpload
 from zope.app.size import byteDisplay
 from zope.app.event.objectevent import ObjectModifiedEvent


=== Zope3/src/zope/app/browser/content/imageedit.pt 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/content/imageedit.pt:1.5	Mon Jun 30 13:04:42 2003
+++ Zope3/src/zope/app/browser/content/imageedit.pt	Wed Aug  6 10:41:41 2003
@@ -1,25 +1,26 @@
 <html metal:use-macro="views/standard_macros/page">
-  <body>
-  <div metal:fill-slot="body">
+<body>
+<div metal:fill-slot="body">
 
-    <div metal:use-macro="view/generated_form/macros/body">
+  <div metal:use-macro="view/generated_form/macros/body">
 
-    <form action=".">   
+  <form action=".">   
 
-      <table metal:fill-slot="extra_top">
-        <tr>
-          <td>Size</td>
-          <td tal:content="view/size"
-             >103 x 45 pixels, 43KB</td>            
-        </tr>
-      </table>
- 
-      <input type="submit" name="save" value="Save Changes" />
+    <table metal:fill-slot="extra_top">
+      <tr>
+        <td i18n:translate="">Size</td>
+        <td tal:content="view/size" i18n:translate=""
+           >103 x 45 pixels, 43KB</td>            
+      </tr>
+    </table>
 
-    </form>
+    <input type="submit" name="save" value="Save Changes" 
+        i18n:attributes="value save-changes-button"/>
+
+  </form>
 
-    </div>
   </div>
-  </body>
+</div>
+</body>
 
 </html>


=== Zope3/src/zope/app/browser/content/preview.pt 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/content/preview.pt:1.2	Tue Dec 31 04:54:08 2002
+++ Zope3/src/zope/app/browser/content/preview.pt	Wed Aug  6 10:41:41 2003
@@ -1,7 +1,9 @@
 <html metal:use-macro="views/standard_macros/page">
 <body>
 <div metal:fill-slot="body">
-<iframe src="." height="98%" width="98%"></iframe>
+
+  <iframe src="." height="98%" width="98%"></iframe>
+
 </div>
 </body>
 </html>


=== Zope3/src/zope/app/browser/content/sql.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/browser/content/sql.py:1.9	Wed Jun 11 09:47:57 2003
+++ Zope3/src/zope/app/browser/content/sql.py	Wed Aug  6 10:41:41 2003
@@ -11,16 +11,16 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""SQL Script Views
+
 $Id$
 """
-from zope.publisher.browser import BrowserView
 from zope.app.interfaces.content.sql import ISQLScript
 from zope.app.interfaces.rdb import DatabaseException
 from zope.context import ContextMethod
 
-class SQLScriptTest(BrowserView):
-    """Edit View for SQL Scripts"""
+class SQLScriptTest:
+    """Test the SQL inside the SQL Script"""
 
     __used_for__ = ISQLScript
 


=== Zope3/src/zope/app/browser/content/sqltest.pt 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/content/sqltest.pt:1.4	Mon Jun 30 13:04:42 2003
+++ Zope3/src/zope/app/browser/content/sqltest.pt	Wed Aug  6 10:41:41 2003
@@ -1,40 +1,38 @@
 <html metal:use-macro="views/standard_macros/page">
-<head>
-  <title>Test SQL Script</title>
-</head>
 <body>
 
-  <div metal:fill-slot="body">
-  <form action="." method="post">
+<div metal:fill-slot="body">
+<form action="." method="post">
 
-    <pre tal:content="context/source" />
+  <pre tal:content="context/source" />
 
-    <table border="1"
-        tal:define="args context/getArguments"
-        tal:condition="args">
-      <tbody>
-        <tr>
-          <th>Argument Name</th>
-          <th>Type</th>
-          <th>Value</th>
-        </tr>
-
-        <tr tal:repeat="arg python: args.keys()">
-          <td tal:content="arg"></td>
-          <td tal:content="python: args[arg].get('type')"> </td>
-          <td><input type="text" name="" size="10" value=""
-                  tal:attributes="value python: args[arg].get('default');
-                                  name arg"/></td>
-        </tr>
+  <table border="1"
+      tal:define="args context/getArguments"
+      tal:condition="args">
+    <tbody>
+      <tr>
+        <th i18n:translate="">Argument Name</th>
+        <th i18n:translate="">Type</th>
+        <th i18n:translate="">Value</th>
+      </tr>
+
+      <tr tal:repeat="arg python: args.keys()">
+        <td tal:content="arg"></td>
+        <td tal:content="python: args[arg].get('type')"> </td>
+        <td><input type="text" name="" size="10" value=""
+                tal:attributes="value python: args[arg].get('default');
+                                name arg"/></td>
+      </tr>
 
 
-      </tbody>
-    </table>
+    </tbody>
+  </table>
 
-    <input type="submit" name="testResults.html:method" value="Test" />
+  <input type="submit" name="testResults.html:method" value="Test"
+         i18n:attributes="value test-button"/>
 
-  </form>
-  </div>
+</form>
+</div>
 
 </body>
 </html>


=== Zope3/src/zope/app/browser/content/sqltestresults.pt 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/content/sqltestresults.pt:1.3	Wed Jun 25 18:14:24 2003
+++ Zope3/src/zope/app/browser/content/sqltestresults.pt	Wed Aug  6 10:41:41 2003
@@ -1,38 +1,35 @@
 <html metal:use-macro="views/standard_macros/page">
-<head>
-  <title>Test SQL Script</title>
-</head>
 <body>
 
-  <div metal:fill-slot="body">
+<div metal:fill-slot="body">
 
-    <pre tal:content="view/getRenderedSQL" />
+  <pre tal:content="view/getRenderedSQL" />
 
-    <table border="1" cellspacing="0" cellpadding="2"
-        tal:define="result view/getTestResults"
-        tal:condition="result">
-      <tbody>
+  <table border="1" cellspacing="0" cellpadding="2"
+      tal:define="result view/getTestResults"
+      tal:condition="result">
+    <tbody>
 
-        <tr>
-          <th tal:repeat="field result/columns"
-              tal:content="field">Field Name</th>
-        </tr>
+      <tr>
+        <th tal:repeat="field result/columns"
+            tal:content="field">Field Name</th>
+      </tr>
 
-        <tr tal:repeat="row result">
-          <td tal:repeat="field result/columns"
-              tal:content="python: getattr(row, field)">Value</td>
-        </tr>
+      <tr tal:repeat="row result">
+        <td tal:repeat="field result/columns"
+            tal:content="python: getattr(row, field)">Value</td>
+      </tr>
 
 
-      </tbody>
-    </table>
+    </tbody>
+  </table>
 
-    <tal:block tal:condition="view/error">
-      <h3>An Error occurred</h3>
-      <pre tal:content="view/getFormattedError" />
-    </tal:block>
+  <tal:block tal:condition="view/error">
+    <h3 i18n:translate="">An Error occurred</h3>
+    <pre tal:content="view/getFormattedError" />
+  </tal:block>
 
-  </div>
+</div>
 
 </body>
 </html>


=== Zope3/src/zope/app/browser/content/xmldocument.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/browser/content/xmldocument.py:1.1	Wed Apr  9 07:47:52 2003
+++ Zope3/src/zope/app/browser/content/xmldocument.py	Wed Aug  6 10:41:41 2003
@@ -11,13 +11,11 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""XML-Document Views
+
 $Id$
 """
-
-from zope.publisher.browser import BrowserView
-
-class XMLDocumentView(BrowserView):
+class XMLDocumentView:
 
     def show(self):
         """Show the XML text"""


=== Zope3/src/zope/app/browser/content/zpt.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/content/zpt.py:1.3	Sat Jan 25 08:34:15 2003
+++ Zope3/src/zope/app/browser/content/zpt.py	Wed Aug  6 10:41:41 2003
@@ -15,10 +15,7 @@
 
 $Id$
 """
-
-from zope.publisher.browser import BrowserView
-
-class ZPTPageEval(BrowserView):
+class ZPTPageEval:
 
     def index(self, **kw):
         """Call a Page Template"""




More information about the Zope3-Checkins mailing list