Author: jmorliaguet
Date: Tue Nov  8 20:18:37 2005
New Revision: 29358

Added:
   z3lab/cpsskins/branches/jmo-perspectives/configuration/configure.zcml   
(contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/configuration/perspectives/configure.zcml
   (contents, props changed)
Modified:
   
z3lab/cpsskins/branches/jmo-perspectives/browser/editing/presentation_editor.pt
   
z3lab/cpsskins/branches/jmo-perspectives/configuration/perspectives/perspective.py
   z3lab/cpsskins/branches/jmo-perspectives/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/elements/display.py
   z3lab/cpsskins/branches/jmo-perspectives/elements/presentation.py
   z3lab/cpsskins/branches/jmo-perspectives/elements/theme.py
   z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.css
   
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.css
Log:

- saving work

  (moving towards a unified model for global / local utilities / instances)



Modified: 
z3lab/cpsskins/branches/jmo-perspectives/browser/editing/presentation_editor.pt
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/browser/editing/presentation_editor.pt 
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/browser/editing/presentation_editor.pt 
    Tue Nov  8 20:18:37 2005
@@ -32,6 +32,7 @@
                             display info/display;
                             formats info/formats;
                             perspective info/perspective;
+                            perspective_name perspective/name|nothing;
                             perspective_is_current python: perspective == 
current_perspective;
                             current_formats python: current_perspective and 
                                             
views[str(current_perspective)]['formats'] or []"
@@ -44,12 +45,12 @@
                 <tal:block condition="perspective">
                   <a title="Add view"
                      tal:condition="not:display"
-                     tal:attributes="href 
string:@@clonePresentation?perspective=$perspective">
+                     tal:attributes="href 
string:@@clonePresentation?perspective=$perspective_name">
                     <img src="/++skin++cpsskins/@@/add-16.png" />
                   </a>
                   <a tal:condition="display"
                      title="Remove view" onclick="return window.confirm('Are 
you sure?')"
-                     tal:attributes="href 
string:@@removePresentation?perspective=$perspective">
+                     tal:attributes="href 
string:@@removePresentation?perspective=$perspective_name">
                     <img src="/++skin++cpsskins/@@/remove-16.png" />
                   </a>
                 </tal:block>
@@ -72,12 +73,12 @@
                                         (not perspective and default_effective)
                                       ) and 'effective' or nothing">
                     <a tal:condition="customizable"
-                       tal:attributes="href 
string:@@customizeFormat?name=$format_name&perspective=$perspective">
+                       tal:attributes="href 
string:@@customizeFormat?name=$format_name&perspective=$perspective_name">
                       <img src="/++skin++cpsskins/@@/unchecked-16.png" />
                     </a>
                     <tal:block condition="not:customizable">
                       <a tal:condition="perspective"
-                         tal:attributes="href 
string:@@uncustomizeFormat?name=$format_name&perspective=$perspective">
+                         tal:attributes="href 
string:@@uncustomizeFormat?name=$format_name&perspective=$perspective_name">
                         <img src="/++skin++cpsskins/@@/checked-16.png" />
                       </a>
                       <tal:block condition="not:perspective">
@@ -94,7 +95,7 @@
                 <a href="" style="display:block; width: auto"
                    tal:condition="not:perspective_is_current"
                    tal:define="perspective python: perspective and perspective 
or ''"
-                   tal:attributes="href 
string:@@setPerspective?perspective=$perspective">&nbsp;</a>
+                   tal:attributes="href 
string:@@setPerspective?perspective=$perspective_name">&nbsp;</a>
               </td>
             </tr>
           </tal:block>

Added: z3lab/cpsskins/branches/jmo-perspectives/configuration/configure.zcml
==============================================================================
--- (empty file)
+++ z3lab/cpsskins/branches/jmo-perspectives/configuration/configure.zcml       
Tue Nov  8 20:18:37 2005
@@ -0,0 +1,7 @@
+<configure>
+
+  <include package=".engines" />
+
+  <include package=".perspectives" />
+
+</configure>

Added: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/perspectives/configure.zcml
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/configuration/perspectives/configure.zcml
  Tue Nov  8 20:18:37 2005
@@ -0,0 +1,23 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope";>
+
+
+  <content class=".perspective.Perspective">
+
+    <require
+        permission="zope.View"
+        interface=".perspective.IPerspective"
+        />
+
+    <require
+        permission="zope.ManageContent"
+        set_schema=".perspective.IPerspective"
+        />
+
+  </content>
+
+  <adapter
+      factory=".perspective.Relatable"
+  />
+
+</configure>

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/perspectives/perspective.py
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/configuration/perspectives/perspective.py
  (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/configuration/perspectives/perspective.py
  Tue Nov  8 20:18:37 2005
@@ -18,11 +18,23 @@
 
 __docformat__ = "reStructuredText"
 
+from zope.component import adapts
 from zope.interface import implements, Interface
+from zope.schema import DottedName, TextLine
+
+from cpsskins.relations.interfaces import IRelatable
 
 class IPerspective(Interface):
     """A perspective."""
 
+    name = DottedName(
+        title=u"Name",
+        )
+
+    title = TextLine(
+        title=u"Title",
+        )
+
 class Perspective(object):
 
     implements(IPerspective)
@@ -31,3 +43,15 @@
         self.name = name 
         self.title = title
 
+class Relatable(object):
+    """This adapter makes perspectives relatable.
+    """
+    adapts(IPerspective)
+    implements(IRelatable)
+
+    def __init__(self, context):
+        self.context = context
+
+    def __str__(self):
+        """The perspective's name is used as an identifier."""
+        return self.context.name

Modified: z3lab/cpsskins/branches/jmo-perspectives/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/configure.zcml     (original)
+++ z3lab/cpsskins/branches/jmo-perspectives/configure.zcml     Tue Nov  8 
20:18:37 2005
@@ -68,7 +68,7 @@
 
   <include package=".perspectives" />
 
-  <include package=".configuration.engines" />
+  <include package=".configuration" />
 
   <include package=".registry" />
 

Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/display.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/display.py        
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/display.py        Tue Nov 
 8 20:18:37 2005
@@ -175,7 +175,7 @@
                 second=display,
                 )
         else:
-            if not IPerspective.providedBy(perspective):
+            if not configuration.IPerspective.providedBy(perspective):
                 raise ValueError("%s is not a perspective" % repr(perspective))
             relation = TriadicRelation(
                 predicate=hasDisplayFromPerspective,

Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/presentation.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/presentation.py   
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/presentation.py   Tue Nov 
 8 20:18:37 2005
@@ -148,7 +148,8 @@
 
         # set initial values
         for perspective in theme.listPerspectives():
-            views[str(perspective)] = {
+            view_name = perspective['name']
+            views[view_name] = {
                 'relation': None,
                 'display': None,
                 'formats': [],

Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/theme.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/theme.py  (original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/theme.py  Tue Nov  8 
20:18:37 2005
@@ -86,7 +86,7 @@
             return v
 
     def getPerspectiveById(self, id):
-        return queryUtility(configuration, IPerspective, id)
+        return queryUtility(configuration.IPerspective, id)
 
     def addPerspective(self, object):
         """Add a perspective to the perspective storage

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.css
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.css    
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.css    
Tue Nov  8 20:18:37 2005
@@ -32,7 +32,7 @@
   left: 0;
   width: 100%;
   background-color: #999;
-  border-top: 2px solid black;
+  border-top: 2px solid #666;
   height: 25px;
   z-index: 20;
 }

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.css
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.css 
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.css 
    Tue Nov  8 20:18:37 2005
@@ -28,7 +28,7 @@
 }
 
 .pageBlockEditHeader form, .pageBlockEditHeaderSelected form {
-  padding: 0x;
+  padding: 0;
   margin: 0;
 }
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to