[CMF-checkins] SVN: CMF/branches/tseaver-viewification/CMFDefault/browser/ - Moving metadata.pt templates into subdirectory

Jens Vagelpohl jens at dataflake.org
Sat Oct 22 11:25:12 EDT 2005


Log message for revision 39557:
  - Moving metadata.pt templates into subdirectory
  - Adding a portal_status_message query string to the redirect URL
    if updates take place.
  

Changed:
  D   CMF/branches/tseaver-viewification/CMFDefault/browser/metadata.pt
  U   CMF/branches/tseaver-viewification/CMFDefault/browser/metadata.py
  A   CMF/branches/tseaver-viewification/CMFDefault/browser/templates/
  A   CMF/branches/tseaver-viewification/CMFDefault/browser/templates/content_edit.pt
  A   CMF/branches/tseaver-viewification/CMFDefault/browser/templates/content_view.pt
  A   CMF/branches/tseaver-viewification/CMFDefault/browser/templates/metadata.pt
  U   CMF/branches/tseaver-viewification/CMFDefault/browser/tests/test_metadata.py

-=-
Deleted: CMF/branches/tseaver-viewification/CMFDefault/browser/metadata.pt
===================================================================
--- CMF/branches/tseaver-viewification/CMFDefault/browser/metadata.pt	2005-10-22 12:36:36 UTC (rev 39556)
+++ CMF/branches/tseaver-viewification/CMFDefault/browser/metadata.pt	2005-10-22 15:25:11 UTC (rev 39557)
@@ -1,125 +0,0 @@
-<html metal:use-macro="context/@@standard_macros/page"
->
-<body>
-
-<metal:slot metal:fill-slot="header"
-            i18n:domain="cmf_default">
-<h1 i18n:translate="">
- Resource Metadata: <tal:span tal:content="context/Title"
-                              i18n:name="obj_title">Title</tal:span></h1>
-</metal:slot>
-
-<metal:slot metal:fill-slot="body"
-            i18n:domain="cmf_default"
-            tal:define="minfo view/getMetadataInfo;
-                        finfo view/getFormInfo;
-                       ">
-
-<form action="metadata.py" method="post">
-<table class="FormLayout">
- <tr>
-  <th i18n:translate="">Enable Discussion?</th>
-  <td colspan="3"
-      tal:define="allowed finfo/allow_discussion" >
-   <select name="allow_discussion" >
-    <option value="default"
-            tal:attributes="selected python: allowed is None"
-            i18n:translate="">Default</option>
-    <option value="off"
-            tal:attributes="selected python: allowed is False"
-            i18n:translate="">Off</option>
-    <option value="on"
-            tal:attributes="selected python: allowed is True"
-            i18n:translate="">On</option>
-   </select>
-  </td>
- </tr>
- <tr>
-  <th i18n:translate="">Identifier</th>
-  <td colspan="3"> <span tal:replace="minfo/Identifier"></span>
-  </td>
- </tr>
- <tr>
-  <th i18n:translate="">Title</th>
-  <td colspan="3">
-   <input type="text" name="title" value="" size="65"
-          tal:attributes="value minfo/Title" />
-  </td>
- </tr>
- <tr>
-  <th i18n:translate="">Description</th>
-  <td colspan="3">
-   <textarea name="description:text" rows="5" cols="65" wrap="soft"
-             tal:content="minfo/Description"></textarea>
-  </td>
- </tr>
- <tr>
-  <th i18n:translate="">Subject</th>
-  <td>
-   <textarea name="subject:lines" rows="3" cols="20"
-             tal:content="finfo/subject_lines"></textarea>
-  </td>
-  <th i18n:translate="">Contributors</th>
-  <td>
-   <textarea name="contributors:lines" rows="5" cols="30"
-             tal:content="finfo/contributor_lines"></textarea>
-  </td>
- </tr>
- <tr>
-  <th i18n:translate="">Creation Date</th>
-  <td> <span tal:replace="minfo/CreationDate"></span>
-  </td>
-  <th i18n:translate="">Last Modified Date</th>
-  <td> <span tal:replace="minfo/ModificationDate"></span>
-  </td>
- </tr>
- <tr>
-  <th i18n:translate="">Effective Date</th>
-  <td>
-   <input type="text" name="effective_date" value=""
-          tal:attributes="value minfo/EffectiveDate" />
-  </td>
-  <th i18n:translate="">Expiration Date</th>
-  <td>
-   <input type="text" name="expiration_date" value=""
-          tal:attributes="value minfo/ExpirationDate" />
-  </td>
- </tr>
- <tr>
-  <th i18n:translate="">Format</th>
-  <td> <input type="text" name="format" value=""
-              tal:attributes="value minfo/Format" />
-  </td>
- </tr>
- <tr>
-  <th i18n:translate="">Language</th>
-  <td> <input type="text" name="language" value=""
-              tal:attributes="value minfo/Language" />
-  </td>
- </tr>
- <tr>
-  <th i18n:translate="">Rights</th>
-  <td> <input type="text" name="rights" value=""
-              tal:attributes="value minfo/Rights" />
-  </td>
- </tr>
- <tr>
-  <td>&nbsp;</td>
-  <td colspan="3">
-   <div class="FormButtons">
-   <tal:loop tal:repeat="button finfo/buttons"
-   ><input type="submit" name="ButtonName" value="ButtonValue"
-           tal:attributes="name button/name;
-                           value button/value;
-                          "
-           i18n:attributes="value" /></tal:loop>
-  </div>
- </td>
- </tr>
-</table>
-</form>
-
-</metal:slot>
-
-</body>
-</html>

Modified: CMF/branches/tseaver-viewification/CMFDefault/browser/metadata.py
===================================================================
--- CMF/branches/tseaver-viewification/CMFDefault/browser/metadata.py	2005-10-22 12:36:36 UTC (rev 39556)
+++ CMF/branches/tseaver-viewification/CMFDefault/browser/metadata.py	2005-10-22 15:25:11 UTC (rev 39557)
@@ -14,6 +14,9 @@
 
 $Id$
 """
+
+from urllib import quote
+
 from Globals import InitializeClass
 from Products.Five.browser import BrowserView
 from Products.CMFCore.interfaces import IDublinCore
@@ -134,8 +137,11 @@
         for button in _BUTTONS.keys():
             if button in form:
                 self.update(form)
-                redirect = _BUTTONS[button]['redirect']
-                RESPONSE.redirect('%s/%s' % (context.absolute_url(), redirect))
+                qs = 'portal_status_message=%s' % quote('Metadata updated.')
+                goto = '%s/%s' % ( context.absolute_url()
+                                 , _BUTTONS[button]['redirect']
+                                 )
+                RESPONSE.redirect('%s?%s' % (goto, qs))
                 return
 
         return self.index()

Added: CMF/branches/tseaver-viewification/CMFDefault/browser/templates/content_edit.pt
===================================================================
--- CMF/branches/tseaver-viewification/CMFDefault/browser/templates/content_edit.pt	2005-10-22 12:36:36 UTC (rev 39556)
+++ CMF/branches/tseaver-viewification/CMFDefault/browser/templates/content_edit.pt	2005-10-22 15:25:11 UTC (rev 39557)
@@ -0,0 +1,20 @@
+<html metal:use-macro="context/@@standard_macros/page">
+  <body>
+
+    <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>
+    </metal:slot>
+
+    <metal:slot metal:fill-slot="body"
+                i18n:domain="cmf_default"
+                >
+
+      <div tal:replace="structure view/renderContent"/>
+
+    </metal:slot>
+
+  </body>
+</html>


Property changes on: CMF/branches/tseaver-viewification/CMFDefault/browser/templates/content_edit.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: CMF/branches/tseaver-viewification/CMFDefault/browser/templates/content_view.pt
===================================================================
--- CMF/branches/tseaver-viewification/CMFDefault/browser/templates/content_view.pt	2005-10-22 12:36:36 UTC (rev 39556)
+++ CMF/branches/tseaver-viewification/CMFDefault/browser/templates/content_view.pt	2005-10-22 15:25:11 UTC (rev 39557)
@@ -0,0 +1,30 @@
+<html metal:use-macro="context/@@standard_macros/page">
+  <body>
+  
+    <metal:slot metal:fill-slot="header"
+                i18n:domain="cmf_default">
+      <h1 i18n:translate="">
+        <tal:span tal:content="context/Title"
+             i18n:name="obj_title">Title</tal:span></h1>
+    
+      <div id="DesktopDescription" tal:content="here/Description">
+          Document Description goes here.
+      </div>
+    
+      <div metal:use-macro="here/content_byline/macros/byline">By Me</div>
+    </metal:slot> 
+    
+    <metal:slot metal:fill-slot="body"
+                i18n:domain="cmf_default">
+    
+      <div tal:replace="structure view/renderContent"/>
+    
+      <div class="Discussion">
+         <span tal:replace="structure here/viewThreadsAtBottom"
+               tal:condition="here/viewThreadsAtBottom|nothing"></span>
+      </div>
+    
+    </metal:slot>
+  
+  </body>
+</html>


Property changes on: CMF/branches/tseaver-viewification/CMFDefault/browser/templates/content_view.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: CMF/branches/tseaver-viewification/CMFDefault/browser/templates/metadata.pt
===================================================================
--- CMF/branches/tseaver-viewification/CMFDefault/browser/templates/metadata.pt	2005-10-22 12:36:36 UTC (rev 39556)
+++ CMF/branches/tseaver-viewification/CMFDefault/browser/templates/metadata.pt	2005-10-22 15:25:11 UTC (rev 39557)
@@ -0,0 +1,125 @@
+<html metal:use-macro="context/@@standard_macros/page"
+>
+<body>
+
+<metal:slot metal:fill-slot="header"
+            i18n:domain="cmf_default">
+<h1 i18n:translate="">
+ Resource Metadata: <tal:span tal:content="context/Title"
+                              i18n:name="obj_title">Title</tal:span></h1>
+</metal:slot>
+
+<metal:slot metal:fill-slot="body"
+            i18n:domain="cmf_default"
+            tal:define="minfo view/getMetadataInfo;
+                        finfo view/getFormInfo;
+                       ">
+
+<form action="metadata.py" method="post">
+<table class="FormLayout">
+ <tr>
+  <th i18n:translate="">Enable Discussion?</th>
+  <td colspan="3"
+      tal:define="allowed finfo/allow_discussion" >
+   <select name="allow_discussion" >
+    <option value="default"
+            tal:attributes="selected python: allowed is None"
+            i18n:translate="">Default</option>
+    <option value="off"
+            tal:attributes="selected python: allowed is False"
+            i18n:translate="">Off</option>
+    <option value="on"
+            tal:attributes="selected python: allowed is True"
+            i18n:translate="">On</option>
+   </select>
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Identifier</th>
+  <td colspan="3"> <span tal:replace="minfo/Identifier"></span>
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Title</th>
+  <td colspan="3">
+   <input type="text" name="title" value="" size="65"
+          tal:attributes="value minfo/Title" />
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Description</th>
+  <td colspan="3">
+   <textarea name="description:text" rows="5" cols="65" wrap="soft"
+             tal:content="minfo/Description"></textarea>
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Subject</th>
+  <td>
+   <textarea name="subject:lines" rows="3" cols="20"
+             tal:content="finfo/subject_lines"></textarea>
+  </td>
+  <th i18n:translate="">Contributors</th>
+  <td>
+   <textarea name="contributors:lines" rows="5" cols="30"
+             tal:content="finfo/contributor_lines"></textarea>
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Creation Date</th>
+  <td> <span tal:replace="minfo/CreationDate"></span>
+  </td>
+  <th i18n:translate="">Last Modified Date</th>
+  <td> <span tal:replace="minfo/ModificationDate"></span>
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Effective Date</th>
+  <td>
+   <input type="text" name="effective_date" value=""
+          tal:attributes="value minfo/EffectiveDate" />
+  </td>
+  <th i18n:translate="">Expiration Date</th>
+  <td>
+   <input type="text" name="expiration_date" value=""
+          tal:attributes="value minfo/ExpirationDate" />
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Format</th>
+  <td> <input type="text" name="format" value=""
+              tal:attributes="value minfo/Format" />
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Language</th>
+  <td> <input type="text" name="language" value=""
+              tal:attributes="value minfo/Language" />
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Rights</th>
+  <td> <input type="text" name="rights" value=""
+              tal:attributes="value minfo/Rights" />
+  </td>
+ </tr>
+ <tr>
+  <td>&nbsp;</td>
+  <td colspan="3">
+   <div class="FormButtons">
+   <tal:loop tal:repeat="button finfo/buttons"
+   ><input type="submit" name="ButtonName" value="ButtonValue"
+           tal:attributes="name button/name;
+                           value button/value;
+                          "
+           i18n:attributes="value" /></tal:loop>
+  </div>
+ </td>
+ </tr>
+</table>
+</form>
+
+</metal:slot>
+
+</body>
+</html>


Property changes on: CMF/branches/tseaver-viewification/CMFDefault/browser/templates/metadata.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: CMF/branches/tseaver-viewification/CMFDefault/browser/tests/test_metadata.py
===================================================================
--- CMF/branches/tseaver-viewification/CMFDefault/browser/tests/test_metadata.py	2005-10-22 12:36:36 UTC (rev 39556)
+++ CMF/branches/tseaver-viewification/CMFDefault/browser/tests/test_metadata.py	2005-10-22 15:25:11 UTC (rev 39557)
@@ -219,8 +219,9 @@
 
         view = self._makeOne(context, request)
         view.controller(response)
-        self.assertEqual(response._redirected,
-                         '%s/%s' % (_EXAMPLE_URL, 'metadata.html'))
+        goto = '%s/%s' % (_EXAMPLE_URL, 'metadata.html')
+        qs = 'portal_status_message=Metadata%20updated.'
+        self.assertEqual(response._redirected, '%s?%s' % (goto, qs))
         self.assertEqual(context._Title, NEW_TITLE)
 
 



More information about the CMF-checkins mailing list