[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - add.pt:1.2 edit.pt:1.4 subedit.pt:1.3 widget.py:1.9

Steve Alexander steve@cat-box.net
Thu, 16 Jan 2003 14:51:02 -0500


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

Modified Files:
	add.pt edit.pt subedit.pt widget.py 
Log Message:
Changed form layout from using tables to using divs.



=== Zope3/src/zope/app/browser/form/add.pt 1.1 => 1.2 ===
--- Zope3/src/zope/app/browser/form/add.pt:1.1	Thu Dec 26 17:26:27 2002
+++ Zope3/src/zope/app/browser/form/add.pt	Thu Jan 16 14:50:28 2003
@@ -32,21 +32,21 @@
         <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 class="row" metal:define-slot="extra_top" tal:replace="nothing">
+            <div class="label">Extra top</div>
+            <div class="label"><input type="text" style="width:100%" /></div>
+        </div>
+        <div class="row"
+             metal:define-macro="widget_rows" tal:repeat="widget view/widgets"
+             tal:content="structure widget/row">
+            <div class="label">Name</div>
+            <div class="field"><input type="text" style="width:100%" /></div>
+        </div>
+        <div class="row"
+             metal:define-slot="extra_bottom" tal:replace="nothing">
+            <div class="label">Extra bottom</div>
+            <div class="field"><input type="text" style="width:100%" /></div>
+        </div>
 
       </div>
 


=== Zope3/src/zope/app/browser/form/edit.pt 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/form/edit.pt:1.3	Thu Dec 26 17:26:27 2002
+++ Zope3/src/zope/app/browser/form/edit.pt	Thu Jan 16 14:50:28 2003
@@ -32,21 +32,22 @@
         <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 class="row"
+             metal:define-slot="extra_top" tal:replace="nothing">
+            <div class="label">Extra top</div>
+            <div class="field"><input type="text" style="width:100%" /></div>
+        </div>
+        <div class="row"
+             metal:define-macro="widget_rows" tal:repeat="widget view/widgets"
+             tal:content="structure widget/row">
+            <div class="label">Name</div>
+            <div class="field"><input type="text" style="width:100%" /></div>
+        </div>
+        <div class="row"
+             metal:define-slot="extra_bottom" tal:replace="nothing">
+            <div class="label">Extra bottom</div>
+            <div class="field"><input type="text" style="width:100%" /></div>
+        </div>
 
       </div>
 


=== Zope3/src/zope/app/browser/form/subedit.pt 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/form/subedit.pt:1.2	Wed Dec 25 09:12:32 2002
+++ Zope3/src/zope/app/browser/form/subedit.pt	Thu Jan 16 14:50:28 2003
@@ -27,20 +27,20 @@
   <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 class="row" metal:define-slot="extra_top" tal:replace="nothing">
+      <div class="label">Extra top</div>
+      <div class="field"><input type="text" style="width:100%" /></div>
+  </div>
+  <div class="row"
+       metal:define-macro="widget_rows" tal:repeat="widget view/widgets"
+       tal:content="structure widget/row">
+      <div class="label">Name</div>
+      <div class="field"><input type="text" style="width:100%" /></div>
+  </div>
+  <div class="row"
+       metal:define-slot="extra_bottom" tal:replace="nothing">
+      <div class="label">Extra bottom</div>
+      <div class="field"><input type="text" style="width:100%" /></div>
+  </div>
 
 </div>


=== Zope3/src/zope/app/browser/form/widget.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/browser/form/widget.py:1.8	Wed Jan 15 10:43:17 2003
+++ Zope3/src/zope/app/browser/form/widget.py	Thu Jan 16 14:50:28 2003
@@ -126,7 +126,8 @@
             )
 
     def row(self):
-        return "<td>%s</td><td>%s</td>" % (self.label(), self())
+        return '<div class="label">%s</div><div class="field">%s</div>' % (
+                self.label(), self())
 
 class DisplayWidget(BrowserWidget):
 
@@ -299,7 +300,7 @@
                 return int(value)
             except ValueError, v:
                 raise ConversionError("Invalid integer data", v)
-        
+
 
 class FloatWidget(TextWidget):
     displayWidth = 10
@@ -339,7 +340,11 @@
                              extra = self.getValue('extra'))
 
     def row(self):
-        return '<td colspan="2">%s<br />%s</td>' % (self.label(), self())
+        # XXX This was originally set to make a colspan=2 table cell, and
+        #     have the label above the text area. Perhaps we should use
+        #     different div classes for this case?
+        return '<div class="label">%s</div><div class="field">%s</div>' % (
+                self.label(), self())
 
 class BytesAreaWidget(Bytes, TextAreaWidget):
     pass