[CMF-checkins] SVN: CMF/branches/tseaver-viewification/CMFDefault/browser/ - synced document_edit_form view with recent skin changes

Yvo Schubbe y.2006_ at wcm-solutions.de
Mon Jan 30 14:04:42 EST 2006


Log message for revision 41505:
  - synced document_edit_form view with recent skin changes

Changed:
  U   CMF/branches/tseaver-viewification/CMFDefault/browser/documentviews.py
  U   CMF/branches/tseaver-viewification/CMFDefault/browser/templates/document_edit.pt

-=-
Modified: CMF/branches/tseaver-viewification/CMFDefault/browser/documentviews.py
===================================================================
--- CMF/branches/tseaver-viewification/CMFDefault/browser/documentviews.py	2006-01-30 19:01:22 UTC (rev 41504)
+++ CMF/branches/tseaver-viewification/CMFDefault/browser/documentviews.py	2006-01-30 19:04:42 UTC (rev 41505)
@@ -29,7 +29,6 @@
     """ Edit view for IMutableDocument.
     """
 
-    # XXX: _BUTTONS should become configurable
     _BUTTONS = ({'name': 'change',
                  'value': _(u'Change'),
                  'transform': ('validateTextFile', 'validateHTML', 'update'),
@@ -39,23 +38,20 @@
                  'transform': ('validateTextFile', 'validateHTML', 'update'),
                  'redirect': ('context', 'object/view')})
 
+    def title(self):
+        return self.context.Title()
+
+    def description(self):
+        return self.context.Description()
+
     def SafetyBelt(self):
-        if 'SafetyBelt' in self.request.form:
-            return self.request['SafetyBelt']
-        else:
-            return self.context.SafetyBelt()
+        return self.request.form.get('SafetyBelt', self.context.SafetyBelt())
 
     def text_format(self):
-        if 'text_format' in self.request.form:
-            return self.request['text_format']
-        else:
-            return self.context.text_format
+        return self.request.form.get('text_format', self.context.text_format)
 
-    def EditableBody(self):
-        if 'text' in self.request.form:
-            return self.request['text']
-        else:
-            return self.context.EditableBody()
+    def text(self):
+        return self.request.form.get('text', self.context.EditableBody())
 
     def validateTextFile(self, file='', **kw):
         try:

Modified: CMF/branches/tseaver-viewification/CMFDefault/browser/templates/document_edit.pt
===================================================================
--- CMF/branches/tseaver-viewification/CMFDefault/browser/templates/document_edit.pt	2006-01-30 19:01:22 UTC (rev 41504)
+++ CMF/branches/tseaver-viewification/CMFDefault/browser/templates/document_edit.pt	2006-01-30 19:04:42 UTC (rev 41505)
@@ -3,7 +3,7 @@
 
 <metal:slot metal:fill-slot="header" i18n:domain="cmf_default">
 <h1 i18n:translate="">Edit: <tal:span
-    tal:content="context/Title" i18n:name="obj_title">Title</tal:span></h1>
+    tal:content="view/title" i18n:name="obj_title">Title</tal:span></h1>
 </metal:slot>
 
 <metal:slot metal:fill-slot="body" i18n:domain="cmf_default">
@@ -12,15 +12,15 @@
 <form action="document_edit_form" method="post" enctype="multipart/form-data"
    tal:attributes="action request/ACTUAL_URL">
  <input type="hidden" name="SafetyBelt" value=""
-        tal:attributes="value view/SafetyBelt" />
+    tal:attributes="value view/SafetyBelt" />
 <table class="FormLayout">
  <tr>
   <th i18n:translate="">Title</th>
-  <td tal:content="context/Title">Title</td>
+  <td tal:content="view/title">Title</td>
  </tr>
  <tr>
   <th i18n:translate="">Description</th>
-  <td tal:content="context/Description">Description</td>
+  <td tal:content="view/description">Description</td>
  </tr>
  <tr>
   <th i18n:translate="">Format</th>
@@ -46,7 +46,7 @@
   <th class="TextField" i18n:translate="">Edit</th>
   <td class="TextField">
    <textarea name="text:text" rows="20" cols="80" wrap="soft"
-             tal:content="view/EditableBody"></textarea>
+      tal:content="view/text"></textarea>
   </td>
  </tr>
  <tr>



More information about the CMF-checkins mailing list