Author: jmorliaguet
Date: Wed Oct  5 11:17:28 2005
New Revision: 27950

Modified:
   z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/view_editor.pt
   z3lab/cpsskins/branches/jmo-perspectives/elements/views.py
Log:

- some view manager fixes for objects that inherit the display of other elements



Modified: 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/view_editor.pt
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/view_editor.pt   
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/view_editor.pt   
Wed Oct  5 11:17:28 2005
@@ -1,15 +1,22 @@
 <html metal:use-macro="context/@@popup_macros/page">
   <body metal:fill-slot="body" i18n:domain="cpsskins">
-    <div class="editArea">
-      <h1>View editor</h1>
-      <p>The views associated to this element are listed in the table 
below:</p>
-      <form action="." tal:attributes="action request/URL" method="post"
-            enctype="multipart/form-data">
-        <table class="inline" cellpadding="0" cellspacing="1"
+    <div class="editArea"
          tal:define="info context/viewable:getViewInfo;
                      views info/views;
                      current_perspective context/@@getPerspective;
+                     default_view views/default|nothing;
                      format_names info/format_names">
+
+      <h1>View editor</h1>
+
+      <p tal:condition="not:default_view">No view is directly associated with 
this element.</p>
+
+      <form tal:condition="default_view"
+            action="." tal:attributes="action request/URL" method="post"
+            enctype="multipart/form-data">
+
+        <p>The views associated to this element are listed in the table 
below:</p>
+        <table class="inline" cellpadding="0" cellspacing="1">
           <tr>
             <th>View</th>
             <th>Display</th>
@@ -18,6 +25,7 @@
               <tal:block content="format_name" />
             </th>
           </tr>
+
           <tal:block repeat="view python: views.keys()">
             <tr tal:define="info views/?view;
                             even repeat/view/even;

Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/views.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/views.py  (original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/views.py  Wed Oct  5 
11:17:28 2005
@@ -152,6 +152,8 @@
                 'formats': [],
                 'perspective': perspective}
 
+        format_names = []
+
         # override initial values
         for r in reltool.search(first=object, predicate=hasDisplay) \
                + reltool.search(first=object,
@@ -164,9 +166,13 @@
 
             formats_info = {}
             for format in formattable.getFormats():
-                format_info = formats_info[format.formatname] = {}
+                format_name = format.formatname
+                format_info = formats_info[format_name] = {}
                 format_info['format'] = format
 
+                if format_name not in format_names:
+                    format_names.append(format_name)
+
                 customizable = False
                 if perspective is not None:
                     used_by = reltool.search(second=format, 
predicate=hasFormat)
@@ -183,6 +189,6 @@
 
         return {
             'views': views,
-            'format_names': formattable.getFormatNames(),
+            'format_names': format_names,
             }
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to