Index: /WAeUP_SRP/trunk/skins/waeup_custom/cpsdocument_edit_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_custom/cpsdocument_edit_form.pt	(revision 858)
+++ /WAeUP_SRP/trunk/skins/waeup_custom/cpsdocument_edit_form.pt	(revision 859)
@@ -6,90 +6,9 @@
            no_form=True);
     form_action string:cpsdocument_edit;
+    form_type string:waeup;
     creation python:False;
     edition python:True;
-    metadata metadata|nothing;
-    ">
-<metal:block define-macro="edit_form">
-<metal:block use-macro="here/content_lib_master/macros/master">
-  
-  <metal:block fill-slot="header">
-    <span tal:condition="not: context/isManager">
-        <metal:block use-macro="here/error_not_found/macros/not_found" />
-    </span>
-    <span tal:condition="context/isManager">
-    <h3 tal:condition="creation" i18n:translate="">
-      Create a document of type
-      <tal:block i18n:name="type_name" i18n:translate=""
-            tal:define="type_name request/type_name;
-                        type_info python:here.portal_types[type_name]"
-            tal:content="type_info/Title">Type Title</tal:block>
-    </h3>
-    <span tal:condition="not:creation">
-     <a href=""
-       tal:attributes="href string:${here/academicsParent}">
-      <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/>
-      Up one level
-    </a>
-    <h3>
-      <tal:block condition="python: edition and not metadata"
-        i18n:translate="">Edit <span id="page_title" i18n:name="title"
-        tal:content="here/title_or_id">Page Title</span>
-      </tal:block>
-      <tal:block tal:condition="metadata"
-        i18n:translate="">Metadata of <span i18n:name="title" tal:content="here/title_or_id">Page Title</span>
-      </tal:block>
-    </h3>
-    <br />        
-    </span>
-    </span>
-  </metal:block>
-  
- 
-  <metal:block fill-slot="main" tal:condition="context/isManager">
-    <form action="ACTION" method="post" id="editForm"
-          enctype="multipart/form-data" class="workflow"
-          tal:attributes="action form_action">
-      <div class="group">
-        <div class="documentFields">
-          <tal:block define="getFormUidHtml nocall:modules/Products.CPSDocument.utils/getFormUidHtml"
-                     replace="structure python:getFormUidHtml(request)"/>
-          <input type="hidden" name="type_name" value="VALUE"
-                 tal:condition="creation"
-                 tal:attributes="value request/type_name" />
-          <input type="hidden" id="button_placeholder" name="button_placeholder" value="" />
-          <div id="rendered_main" tal:content="structure rendered_main">
-            CONTENT
-          </div>
-        </div>
-
-        <tal:block condition="not:creation">
-          <div class="tooltipArea" style="visibility: hidden;"
-               id="transition_comments_help"
-               onclick="showElement(false, 'transition_comments_help')"
-               i18n:translate="help_transition_comments_modification">
-            In this field you can give the reason for the modification
-            on this document. Your comments may be used to notify other users.
-          </div>
-          <dl>
-            <dt><label for="comments"
-                       i18n:translate="transition_comments_modification"
-                       >Reason of the modification</label>
-              <button type="button" class="tooltipControl"
-                      onclick="toggleElementVisibility('transition_comments_help')"> ? </button>
-            </dt>
-            <dd>
-              <textarea name="comments" id="comments" cols="60" rows="3"
-                        tal:content="nothing">
-              </textarea>
-            </dd>
-          </dl>
-        </tal:block>
-
-        <metal:block use-macro="here/cpsdocument_edit_buttons/macros/buttons"/>
-      </div>
-    </form>
-  </metal:block>
-
-</metal:block>
-</metal:block>
+    metadata metadata|nothing;"
+    >
+  <metal:block use-macro="context/waeup_edit_form/macros/edit_form" />
 </tal:block>
Index: eUP_SRP/trunk/skins/waeup_default/external_edit.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/external_edit.py	(revision 858)
+++ 	(revision )
@@ -1,47 +1,0 @@
-##parameters=REQUEST, cluster=None, cpsdocument_edit_and_view_button=None, action=None
-# $Id$
-"""
-Called when a document form is posted.
-
-Validates data, then:
-
- - if there's no error, updates the object and redirects to it,
-
- - if there's an error, puts data in session and redirects to edit form.
-
-A form uid is propagated during the redirect to uniquely identify the
-form in the session.
-"""
-
-from urllib import urlencode
-from Products.CPSDocument.utils import getFormUidUrlArg
-
-# Check flexible controls
-context.editLayouts(REQUEST=REQUEST)
-
-# Validate the document and write it if it's valid
-# (We don't call getEditableContent here, validate does it when needed.)
-doc = context.getContent()
-is_valid, ds = doc.validate(request=REQUEST, proxy=context, cluster=cluster,
-                            use_session=True)
-
-if action is None:
-    ti = doc.getTypeInfo()
-    action = ti.queryMethodID('edit', 'external_edit_form')
-    action = '/' + action
-
-if is_valid:
-    comments = REQUEST.get('comments')
-    context.cpsdocument_notify_modification(comments=comments)
-    if cpsdocument_edit_and_view_button is not None:
-        action = ''
-    psm = 'psm_content_changed'
-    args = {}
-else:
-    psm = 'psm_content_error'
-    args = getFormUidUrlArg(REQUEST)
-
-args['portal_status_message'] = psm
-url = context.absolute_url() + action + '?' + urlencode(args)
-REQUEST.RESPONSE.redirect(url)
-
Index: /WAeUP_SRP/trunk/skins/waeup_default/external_edit_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/external_edit_form.pt	(revision 858)
+++ /WAeUP_SRP/trunk/skins/waeup_default/external_edit_form.pt	(revision 859)
@@ -6,43 +6,9 @@
            no_form=True);
     form_action string:external_edit;
+    form_type string:external;
     edition python:True;
-    metadata metadata|nothing;
-    ">
-<metal:block define-macro="edit_form">
-<metal:block use-macro="here/content_lib_master/macros/master">
-
-
-  <metal:block fill-slot="header">
-    <h3>
-      <tal:block condition="python: edition and not metadata"
-        i18n:translate="">Edit <span id="page_title" i18n:name="title"
-        tal:content="here/title_or_id">Page Title</span></tal:block>
-      <tal:block tal:condition="metadata"
-        i18n:translate="">Metadata of <span i18n:name="title" tal:content="here/title_or_id">Page Title</span></tal:block>
-    </h3>
-  </metal:block>
-
-  <metal:block fill-slot="main">
-    <form action="ACTION" method="post" id="editForm"
-          enctype="multipart/form-data" class="workflow"
-          tal:attributes="action form_action">
-      <div class="group">
-        <div class="documentFields">
-          <tal:block define="getFormUidHtml nocall:modules/Products.CPSDocument.utils/getFormUidHtml"
-                     replace="structure python:getFormUidHtml(request)"/>
-          
-          <input type="hidden" id="button_placeholder" name="button_placeholder" value="" />
-          <div id="rendered_main" tal:content="structure rendered_main">
-            CONTENT
-          </div>
-        </div>
-
-        <metal:block use-macro="here/external_edit_buttons/macros/buttons"/>
-               
-      </div>
-    </form>
-  </metal:block>
-
-</metal:block>
-</metal:block>
+    creation python:False;
+    metadata metadata|nothing;"
+    >
+  <metal:block use-macro="context/waeup_edit_form/macros/edit_form" />
 </tal:block>
Index: /WAeUP_SRP/trunk/skins/waeup_default/waeup_edit.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/waeup_edit.py	(revision 859)
+++ /WAeUP_SRP/trunk/skins/waeup_default/waeup_edit.py	(revision 859)
@@ -0,0 +1,49 @@
+##parameters=REQUEST, cluster=None, cpsdocument_edit_and_view_button=None, came_from=None
+# $Id: external_edit.py 805 2006-11-09 09:38:29Z joachim $
+"""
+Called when a document form is posted.
+
+Validates data, then:
+
+ - if there's no error, updates the object and redirects to it,
+
+ - if there's an error, puts data in session and redirects to edit form.
+
+A form uid is propagated during the redirect to uniquely identify the
+form in the session.
+"""
+
+from urllib import urlencode
+from Products.CPSDocument.utils import getFormUidUrlArg
+
+# Check flexible controls
+#context.editLayouts(REQUEST=REQUEST)
+
+# Validate the document and write it if it's valid
+# (We don't call getEditableContent here, validate does it when needed.)
+doc = context.getContent()
+is_valid, ds = doc.validate(request=REQUEST, proxy=context, cluster=cluster,
+                            use_session=True)
+
+##if action is None:
+##    ti = doc.getTypeInfo()
+##    action = ti.queryMethodID('edit', 'external_edit_form')
+##    action = '/' + action
+
+action = "/" + came_from
+
+if is_valid:
+    comments = REQUEST.get('comments')
+    context.cpsdocument_notify_modification(comments=comments)
+    if cpsdocument_edit_and_view_button is not None:
+        action = ''
+    psm = 'psm_content_changed'
+    args = {}
+else:
+    psm = 'psm_content_error'
+    args = getFormUidUrlArg(REQUEST)
+
+args['portal_status_message'] = psm
+url = context.absolute_url() + action + '?' + urlencode(args)
+REQUEST.RESPONSE.redirect(url)
+
Index: /WAeUP_SRP/trunk/skins/waeup_default/waeup_edit_buttons.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/waeup_edit_buttons.pt	(revision 859)
+++ /WAeUP_SRP/trunk/skins/waeup_default/waeup_edit_buttons.pt	(revision 859)
@@ -0,0 +1,17 @@
+<metal:block define-macro="buttons">
+  <input type="submit" name="cpsdocument_edit_button"
+         class="standalone" value="button_change"
+         id="cpsdocument_edit_button"
+         i18n:attributes="value"
+         tal:condition="not:creation" />
+  <input type="submit" name="cpsdocument_edit_and_view_button"
+         class="standalone" value="button_change_and_view"
+         id="cpsdocument_edit_and_view_button"
+         i18n:attributes="value"
+         tal:condition="not:creation" />
+  <input type="submit" name="cpsdocument_create_button"
+         class="standalone" value="button_create"
+         i18n:attributes="value"
+         id="cpsdocument_create_button"
+         tal:condition="creation" />
+</metal:block>
Index: /WAeUP_SRP/trunk/skins/waeup_default/waeup_edit_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/waeup_edit_form.pt	(revision 859)
+++ /WAeUP_SRP/trunk/skins/waeup_default/waeup_edit_form.pt	(revision 859)
@@ -0,0 +1,96 @@
+<tal:block define="
+    rendered_main python:context.getContent().render(layout_mode='edit', 
+           cluster=None,
+           request=request, 
+           use_session=True, 
+           no_form=True);
+    form_action string:cpsdocument_edit;
+    creation python:False;
+    edition python:True;
+    metadata metadata|nothing;
+    ">
+<metal:block define-macro="edit_form">
+<metal:block use-macro="here/content_lib_master/macros/master">
+  
+  <metal:block fill-slot="header">
+    <span tal:condition="not: context/isManager">
+        <metal:block use-macro="here/error_not_found/macros/not_found" />
+    </span>
+    <span tal:condition="context/isManager">
+    <h3 tal:condition="creation" i18n:translate="">
+      Create a document of type
+      <tal:block i18n:name="type_name" i18n:translate=""
+            tal:define="type_name request/type_name;
+                        type_info python:here.portal_types[type_name]"
+            tal:content="type_info/Title">Type Title</tal:block>
+    </h3>
+    <span tal:condition="python: not creation">
+     <a href="" tal:condition="python: form_type in ('waeup',)"
+       tal:attributes="href string:${here/academicsParent}">
+      <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/>
+      Up one level
+    </a>
+    <h3>
+      <tal:block condition="python: edition and not metadata"
+        i18n:translate="">Edit <span id="page_title" i18n:name="title"
+        tal:content="here/title_or_id">Page Title</span>
+      </tal:block>
+      <tal:block tal:condition="metadata"
+        i18n:translate="">Metadata of <span i18n:name="title" tal:content="here/title_or_id">Page Title</span>
+      </tal:block>
+    </h3>
+    <br />        
+    </span>
+    </span>
+  </metal:block>
+  
+ 
+  <metal:block fill-slot="main" tal:condition="context/isManager">
+    <form action="waeup_edit" method="post" id="editForm"
+          enctype="multipart/form-data" class="workflow"
+          >
+        <input type="hidden" id="came_from" name="came_from" value="" 
+               tal:attributes="value string:${form_action}_form"/>
+      <div class="group">
+        <div class="documentFields">
+          <tal:block define="getFormUidHtml nocall:modules/Products.CPSDocument.utils/getFormUidHtml"
+                     replace="structure python:getFormUidHtml(request)"/>
+          <input type="hidden" name="type_name" value="VALUE"
+                 tal:condition="creation"
+                 tal:attributes="value request/type_name" />
+          <div id="rendered_main" tal:content="structure rendered_main">
+            CONTENT
+          </div>
+        </div>
+
+        <tal:block condition="python: 0 and not creation">
+          <div class="tooltipArea" style="visibility: hidden;"
+               id="transition_comments_help"
+               onclick="showElement(false, 'transition_comments_help')"
+               i18n:translate="help_transition_comments_modification">
+            In this field you can give the reason for the modification
+            on this document. Your comments may be used to notify other users.
+          </div>
+          <dl>
+            <dt><label for="comments"
+                       i18n:translate="transition_comments_modification"
+                       >Reason of the modification</label>
+              <button type="button" class="tooltipControl"
+                      onclick="toggleElementVisibility('transition_comments_help')"> ? </button>
+            </dt>
+            <dd>
+              <textarea name="comments" id="comments" cols="60" rows="3"
+                        tal:content="nothing">
+              </textarea>
+            </dd>
+          </dl>
+        </tal:block>
+
+        <metal:block use-macro="python:path('context/%s_edit_buttons/macros/buttons' % form_type)"/>
+      </div>
+    </form>
+  </metal:block>
+
+</metal:block>
+</metal:block>
+</tal:block>
