[Zope-Checkins] CVS: Zope/lib/python/OFS/dtml - fileEdit.dtml:1.6 imageEdit.dtml:1.7

Brian Lloyd brian@digicool.com
Wed, 17 Oct 2001 10:46:18 -0400


Update of /cvs-repository/Zope/lib/python/OFS/dtml
In directory cvs.zope.org:/tmp/cvs-serv27884/dtml

Modified Files:
	fileEdit.dtml imageEdit.dtml 
Log Message:
Added image preview on Image edit form; Added Web form editing for File 
object content if the content is a text type and under 64K; updated help
files.


=== Zope/lib/python/OFS/dtml/fileEdit.dtml 1.5 => 1.6 ===
 
 <p class="form-help">
-You can update the data for this <dtml-var kind> using the form below. 
+You can update the data for this file object using the form below. 
 Select a data file from your local computer by clicking the <em>browse</em> 
-button and click <em>upload</em> to update the contents of the <dtml-var 
-kind>.
+button and click <em>upload</em> to update the contents of the
+file. You may also edit the file content directly if the content is a 
+text type and small enough to be edited in a text area.
 </p>
 
 <form action="<dtml-var URL1>" method="post" enctype="multipart/form-data">
@@ -47,6 +48,19 @@
   </td>
 </tr>
 
+<dtml-if "this().getContentType()[:4] == 'text' and this().get_size() < 65536">
+<tr>
+  <td align="left" valign="top" colspan="2">
+  <div style="width: 100%;">
+  <textarea name="filedata:text" wrap="off" style="width: 100%;"<dtml-if 
+   dtpref_cols> cols="<dtml-var dtpref_cols>"<dtml-else
+   > cols="50"</dtml-if><dtml-if dtpref_rows> rows="<dtml-var 
+   dtpref_rows>"<dtml-else> rows="20"</dtml-if>><dtml-var 
+   __str__></textarea>
+  </div>
+  </td>
+</tr>
+<dtml-else>
 <tr>
   <td align="left" valign="top">
   <div class="form-label">
@@ -59,7 +73,6 @@
   </div>
   </td>
 </tr>
-
 <tr>
   <td align="left" valign="top">
   <div class="form-label">
@@ -72,6 +85,7 @@
   </div>
   </td>
 </tr>
+</dtml-if>
 
 <tr>
   <td></td>


=== Zope/lib/python/OFS/dtml/imageEdit.dtml 1.6 => 1.7 ===
   <td align="left" valign="top">
   <div class="form-label">
+  Preview
+  </div>
+  </td>
+  <td align="left" valign="top">
+    <dtml-if "height < 250">
+    <dtml-var tag>
+    <dtml-else>
+    <dtml-var "tag(scale=250.0 / height)">
+    </dtml-if>
+  </td>
+</tr>
+
+<tr>
+  <td align="left" valign="top">
+  <div class="form-label">
   Last Modified
   </div>
   </td>