Author: jmorliaguet
Date: Fri May 12 11:00:45 2006
New Revision: 3103

Modified:
   cpsskins/branches/paris-sprint-2006/ui/editing/views.py
   cpsskins/branches/paris-sprint-2006/ui/panels/element_editor.pt

Log:

- added a 'preview' tab for edited elements



Modified: cpsskins/branches/paris-sprint-2006/ui/editing/views.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/editing/views.py     (original)
+++ cpsskins/branches/paris-sprint-2006/ui/editing/views.py     Fri May 12 
11:00:45 2006
@@ -26,6 +26,7 @@
 from zope.security.proxy import removeSecurityProxy
 
 from cpsskins.browser.negotiation.interfaces import INegotiation
+from cpsskins.browser.rendering.interfaces import IViewer
 from cpsskins.elements.interfaces import IDisplay, IFormat
 from cpsskins.elements.interfaces import IDisplayable, IFormattable
 from cpsskins.relations.interfaces import IRelationTool
@@ -35,7 +36,6 @@
 from cpsskins.storage.interfaces import IStorage
 from cpsskins.utils import getThemeManager
 
-
 #######################################################################
 # Generic views
 #######################################################################
@@ -186,6 +186,9 @@
 
         # Main area
 
+        viewer = getMultiAdapter((context, request), IViewer)
+        preview = viewer()
+
         return {
             'negotiation': negotiation,
             'perspective': perspective,
@@ -195,6 +198,7 @@
             'formats': formats_info,
             'actions' : actions_info,
             'edited': tmutil.getElementById(edited_id),
+            'preview': preview,
             }
 
 #######################################################################

Modified: cpsskins/branches/paris-sprint-2006/ui/panels/element_editor.pt
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/panels/element_editor.pt     
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/panels/element_editor.pt     Fri May 
12 11:00:45 2006
@@ -1,6 +1,7 @@
 
 <tal:block i18n:domain="cpsskins"
     define="id request/form/id|nothing;
+            mode request/form/mode|string:edit;
             tmutil context/@@getThemeManager;
             element python: tmutil.getElementById(id);
             info element/@@editpanel/getInfo;
@@ -22,17 +23,24 @@
   <div class="tabs">
     <a i18n:translate=""
        tal:attributes="
-         href 
string:javascript:CPSSkins.getModelById('element-editor').updateData({'form': 
{'id': '$id', 'format': ''}})"
+         href 
string:javascript:CPSSkins.getModelById('element-editor').updateData({'form': 
{'id': '$id', 'format': '', 'mode': 'edit'}})"
        tal:content="info/element/name" />
 
     <a i18n:translate=""
+       tal:attributes="
+         href 
string:javascript:CPSSkins.getModelById('element-editor').updateData({'form': 
{'id': '$id', 'format': '', 'mode': 'preview'}})">Preview</a>
+
+    <a i18n:translate=""
        tal:repeat="format info/formats"
        tal:attributes="
          href 
string:javascript:CPSSkins.getModelById('element-editor').updateData({'script': 
'/++skin++cpsskins/@@/++resource++style_editor.js', 'form': {'id': '$id', 
'format': '${format/id}'}})"
        tal:content="format/name" />
   </div>
 
-  <div class="form"
+  <div class="form" tal:condition="python: mode == 'edit'"
        tal:content="structure edited/@@edit.html" />
 
+  <div class="form" tal:condition="python: mode == 'preview'"
+       tal:content="structure info/preview" />
+
 </tal:block>
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to