Author: jmorliaguet
Date: Sun Nov 13 19:58:37 2005
New Revision: 29497

Added:
   z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/
   z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/__init__.py   
(contents, props changed)
   z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/browser.py   
(contents, props changed)
   z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/configure.zcml 
  (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.css 
  (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.pt  
 (contents, props changed)
Modified:
   z3lab/cpsskins/branches/jmo-perspectives/browser/editing/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/browser/editing/edit_menu.pt
   
z3lab/cpsskins/branches/jmo-perspectives/configuration/perspectives/metaconfigure.py
   
z3lab/cpsskins/branches/jmo-perspectives/configuration/perspectives/perspective.py
   z3lab/cpsskins/branches/jmo-perspectives/elements/theme.py
   z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.css
   z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.js
   
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring_macros.pt
   z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/engines/configure.zcml
   
z3lab/cpsskins/branches/jmo-perspectives/engines/contentauthor/content_author.pt
   
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/configure.zcml
   
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/layout_designer.pt
   z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/configure.zcml
   
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.pt
   z3lab/cpsskins/branches/jmo-perspectives/interfaces.py
   z3lab/cpsskins/branches/jmo-perspectives/resources/manager.py
Log:

- added a "site designer" screen for managing site settings / resources

- cosmetic



Modified: 
z3lab/cpsskins/branches/jmo-perspectives/browser/editing/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/editing/configure.zcml     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/editing/configure.zcml     
Sun Nov 13 19:58:37 2005
@@ -2,6 +2,11 @@
     xmlns="http://namespaces.zope.org/browser";
     xmlns:zope="http://namespaces.zope.org/zope";>
 
+  <menu
+       id="cpsskins_editing_actions"
+       title="Editing actions"
+  />
+
   <!--.editing.Editing pages -->
 
   <resource
@@ -80,6 +85,13 @@
       template="presentation_editor.pt"
   />
 
+  <menuItem
+      for="*"
+      title="Presentations"
+      menu="cpsskins_editing_actions"
+      action="@@edit-menu.html?main_url=@@presentation-editor.html"
+  />
+
   <!-- Canvas element editor -->
 
   <editform

Modified: z3lab/cpsskins/branches/jmo-perspectives/browser/editing/edit_menu.pt
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/editing/edit_menu.pt       
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/editing/edit_menu.pt       
Sun Nov 13 19:58:37 2005
@@ -51,11 +51,15 @@
 
     <div style="clear:both"></div>
 
-    <div class="presentations">
-      <a href="@@edit-menu.html?main_url=@@presentation-editor.html"
-         title="Presentation editor">
-         Manage presentations
-      </a>
+    <div class="editActions"
+     tal:define="actions 
current_theme/@@view_get_menu/cpsskins_editing_actions"
+     tal:condition="actions">
+      <a href="#"
+         tal:repeat="info actions"
+         tal:attributes="href info/action;
+                         class info/selected"
+         tal:content="info/title"
+         i18n:translate="" />
     </div>
 
   </body>

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/perspectives/metaconfigure.py
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/configuration/perspectives/metaconfigure.py
        (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/configuration/perspectives/metaconfigure.py
        Sun Nov 13 19:58:37 2005
@@ -19,10 +19,14 @@
 
 from zope.component import queryUtility, provideUtility
 from zope.configuration.exceptions import ConfigurationError
+from zope.interface import alsoProvides
 
 from cpsskins import configuration
+from cpsskins.interfaces import ISettingType
 from cpsskins.perspectives import Perspective
 
+alsoProvides(configuration.IPerspective, ISettingType)
+
 def perspective(_context, name=u'', title=u''):
 
     if queryUtility(configuration.IPerspective, name) is not None:
@@ -30,5 +34,5 @@
             "The '%s' perspective has already been registered." % name)
 
     resource = Perspective(name=name, title=title)
-    provideUtility(configuration.Perspective(resource=resource),
+    provideUtility(configuration.Perspective(title=title, resource=resource),
                    configuration.IPerspective, name)

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
  Sun Nov 13 19:58:37 2005
@@ -25,18 +25,18 @@
 from zope.app.container.contained import Contained
 
 from cpsskins.configuration.interfaces import IResource
+from cpsskins.interfaces import ISetting
 
-class IPerspective(Interface):
+class IPerspective(ISetting):
     """A perspective configuration item."""
 
-    resource = Attribute("The actual data.")
-
 class Perspective(Persistent, Contained):
     """A perspective configuration item.
     """
     implements(IPerspective)
 
-    def __init__(self, resource=None):
+    def __init__(self, title=u'', resource=None):
+        self.title = title
         self.resource = resource
 
 class Resource(object):

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  Sun Nov 13 
19:58:37 2005
@@ -91,7 +91,7 @@
         """
         perspective = Perspective(name=name, title=title)
         mgr = getUtility(IResourceManager, 'perspectives')
-        mgr.register(resource=perspective, context=self)
+        mgr.register(title=title, resource=perspective, context=self)
 
     def listPerspectives(self):
         return getUtility(IResourceManager, 'perspectives').list(self)

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    
Sun Nov 13 19:58:37 2005
@@ -76,7 +76,7 @@
 .actionPad a {
   font: 12px Arial, Helvetica, sans-serif;
   color: #000 !important;
-  background: #f3f3f3;
+  background: #f6f6f6;
   text-decoration: none;
   border: 1px;
   border-style: solid;
@@ -103,7 +103,7 @@
 
 
 /* Theme tabs */
-.themeTabs {
+.topTabs {
   position: absolute:
   margin: 0px;
   background-color: #000;
@@ -114,49 +114,49 @@
   padding-top: 4px;
 }
 
-.themeTabs img {
+.topTabs img {
   vertical-align: top;
 }
 
-.themeTabs, .themeTabs a {
+.topTabs, .topTabs a {
   text-decoration: none;
   font: 11px Arial, Helvetica, sans-serif;
   color: #000;
 }
 
-.themeTabs tr {
+.topTabs tr {
   background-color: #000;
   height: 17px;
 }
 
-.themeTabs .ltab, .themeTabs .rtab {
+.topTabs .ltab, .topTabs .rtab {
   background-color: #e3e3e3;
   vertical-align: top;
   width: 5px;
   border-bottom: 1px solid #ccc;
 }
 
-.themeTabs .separator {
+.topTabs .separator {
   background-color: #000;
   width: 2px;
   border: none;
 }
 
-.themeTabs .ltabselected, .themeTabs .rtabselected {
+.topTabs .ltabselected, .topTabs .rtabselected {
   background-color: #fff;
   vertical-align: top;
   width: 5px;
 }
 
-.themeTabs .tabselected {
+.topTabs .tabselected {
   background-color: #fff;
 }
 
-.themeTabs a {
+.topTabs a {
   color: #000;
 }
 
-.themeTabs .tab {
+.topTabs .tab {
   background-color : #e3e3e3;
   border-bottom: 1px solid #ccc;
 }

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.js
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.js     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.js     
Sun Nov 13 19:58:37 2005
@@ -405,7 +405,6 @@
   mo.onmouseup = function(e) {
     setCursor("default");
     if (!moved) return;
-    clear_dragbox();
     if (!current_elem) return;
     if ((moved.order == getElementOrder(current_elem))
      && (moved.container == current_elem.parentNode)) return;

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring_macros.pt
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring_macros.pt  
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring_macros.pt  
    Sun Nov 13 19:58:37 2005
@@ -101,10 +101,8 @@
 </metal:block>
 
 <!-- Theme tabs are used to switch between themes -->
-<metal:block define-macro="themetabs"
-  tal:define="themes tmutil/getThemes">
-  <table class="themeTabs" cellpadding="0" cellspacing="0"
-         border="0" summary="">
+<metal:block define-macro="themetabs" tal:define="themes tmutil/getThemes">
+  <table class="topTabs" cellpadding="0" cellspacing="0" border="0" summary="">
     <tr>
       <tal:block repeat="theme themes">
         <tal:block define="selected python: theme == current_theme">

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/configure.zcml   
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/configure.zcml   
Sun Nov 13 19:58:37 2005
@@ -27,10 +27,9 @@
 
   <browser:menu
        id="cpsskins_authoring_actions"
-       title="Authoring actions."
+       title="Authoring actions"
   />
 
-
   <browser:pages
       for="cpsskins.elements.IElement"
       layer="cpsskins"

Modified: z3lab/cpsskins/branches/jmo-perspectives/engines/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/engines/configure.zcml     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/configure.zcml     Sun Nov 
13 19:58:37 2005
@@ -8,6 +8,11 @@
   <include package=".authoring" />
 
 
+  <!-- site designer -->
+
+  <include package=".sitedesigner" />
+
+
   <!-- page designer -->
 
   <include package=".pagedesigner" />

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/contentauthor/content_author.pt
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/engines/contentauthor/content_author.pt
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/contentauthor/content_author.pt
    Sun Nov 13 19:58:37 2005
@@ -1,4 +1,5 @@
-<tal:block define="engine string:content-author">
+<tal:block define="engine string:content-author"
+                   toptabs tmutil/getThemes">
 
 <metal:block use-macro="context/@@authoring_macros/editor">
   <metal:block fill-slot="css">

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/configure.zcml
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/configure.zcml  
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/configure.zcml  
    Sun Nov 13 19:58:37 2005
@@ -25,7 +25,7 @@
   />
 
   <browser:resource
-      name="layout_designer.css"
+      name="layout-designer.css"
       file="layout_designer.css"
       layer="cpsskins"
   />

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/layout_designer.pt
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/layout_designer.pt
  (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/layout_designer.pt
  Sun Nov 13 19:58:37 2005
@@ -3,7 +3,7 @@
 <metal:block use-macro="context/@@authoring_macros/editor">
   <metal:block fill-slot="css">
     <link rel="Stylesheet" type="text/css"
-          href="/++skin++cpsskins/@@/++resource++layout_designer.css" />
+          href="/++skin++cpsskins/@@/++resource++layout-designer.css" />
   </metal:block>
 
   <metal:block fill-slot="header">

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/configure.zcml
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/configure.zcml    
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/configure.zcml    
    Sun Nov 13 19:58:37 2005
@@ -36,7 +36,7 @@
   </browser:menuItems>
 
   <browser:resource
-      name="page_designer.css"
+      name="page-designer.css"
       file="page_designer.css"
       layer="cpsskins"
   />

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.pt
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.pt  
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.pt  
    Sun Nov 13 19:58:37 2005
@@ -3,7 +3,7 @@
 <metal:block use-macro="context/@@authoring_macros/editor">
   <metal:block fill-slot="css">
     <link rel="Stylesheet" type="text/css"
-          href="/++skin++cpsskins/@@/++resource++layout_designer.css" />
+          href="/++skin++cpsskins/@@/++resource++page-designer.css" />
   </metal:block>
 
   <metal:block fill-slot="header">

Added: z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/__init__.py
==============================================================================
--- (empty file)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/__init__.py   
Sun Nov 13 19:58:37 2005
@@ -0,0 +1,18 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"

Added: z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/browser.py
==============================================================================
--- (empty file)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/browser.py    
Sun Nov 13 19:58:37 2005
@@ -0,0 +1,36 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+from zope.app.publisher.browser import BrowserView
+from zope.component import getUtility
+from zope.app.interface import queryType
+
+from cpsskins.interfaces import ISettings, ISettingType
+
+class SiteDesignerView(BrowserView):
+
+    def getSettingInfo(self):
+         """Return information about registered resources categorized by type.
+         """
+         info = {}
+         settings = getUtility(ISettings)
+         for setting in settings.values():
+             type = queryType(setting, ISettingType).__identifier__
+             info.setdefault(type, []).append(setting)
+         return info

Added: 
z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/configure.zcml
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/configure.zcml    
    Sun Nov 13 19:58:37 2005
@@ -0,0 +1,40 @@
+<configure
+    xmlns="http://namespaces.zope.org/browser";>
+
+  <!-- Site designer -->
+
+  <page
+      layer="cpsskins"
+      for="*"
+      name="site-designer.html"
+      permission="zope.ManageContent"
+      template="site_designer.pt"
+  />
+
+  <menuItem
+      for="*"
+      menu="cpsskins_authoring_actions"
+      title="Site designer"
+      action="@@site-designer.html"
+      description="..."
+  />
+
+  <resource
+      name="site-designer.css"
+      file="site_designer.css"
+      layer="cpsskins"
+  />
+
+  <pages
+      for="*"
+      permission="zope.Public"
+      class=".browser.SiteDesignerView">
+
+    <page
+        name="getSettingInfo"
+        attribute="getSettingInfo"
+    />
+
+  </pages>
+
+</configure>

Added: 
z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.css
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.css 
    Sun Nov 13 19:58:37 2005
@@ -0,0 +1,27 @@
+
+.editArea {
+  font: 11px Arial, sans-serif;
+  padding: 1em;
+}
+
+h1 {
+  letter-spacing: -0.03em;
+  font-size: 180%;
+  font-weight: normal;
+  color: #000;
+  border-left: 7px solid #fc0;
+  padding: 1px 2px 1px 8px;
+  margin: 0.4em 0 1em 0;
+  background-color: #ffc;
+}
+
+h2 {
+  font-size: 150%;
+  font-weight: normal;
+  color: #000;
+  padding-bottom: 0.5em;
+  padding: 1px 2px 1px 0px;
+  margin: 0.4em 0 1em 8px;
+  border-bottom: 1px solid #eee;
+}
+

Added: 
z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.pt
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.pt  
    Sun Nov 13 19:58:37 2005
@@ -0,0 +1,41 @@
+<tal:block define="engine string:site-designer">
+
+<metal:block use-macro="context/@@authoring_macros/editor">
+
+  <metal:block fill-slot="css">
+    <link rel="Stylesheet" type="text/css"
+          href="/++skin++cpsskins/@@/++resource++site-designer.css" />
+  </metal:block>
+
+  <metal:block fill-slot="header">
+    <metal:block use-macro="context/@@authoring_macros/perspective_selector" />
+    <metal:block use-macro="context/@@authoring_macros/navigation_pad" />
+  </metal:block>
+
+  <metal:block fill-slot="main">
+
+    <div class="editArea">
+
+      <h1>Settings</h1>
+
+      <tal:block define="info context/@@getSettingInfo"
+                 repeat="type info">
+
+        <h2 tal:content="type" i18n:translate="" />
+
+        <ul>
+          <li tal:repeat="setting info/?type"
+              tal:content="setting/title" />
+        </ul>
+
+      </tal:block>
+
+    </div>
+
+  </metal:block>
+
+  <metal:block fill-slot="footer">
+  </metal:block>
+</metal:block>
+
+</tal:block>

Modified: z3lab/cpsskins/branches/jmo-perspectives/interfaces.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/interfaces.py      (original)
+++ z3lab/cpsskins/branches/jmo-perspectives/interfaces.py      Sun Nov 13 
19:58:37 2005
@@ -17,9 +17,11 @@
 """
 __docformat__ = "reStructuredText"
 
-from zope.interface import Interface
+from zope.interface import Interface, Attribute
+from zope.interface.interfaces import IInterface
 from zope.app.cache.interfaces.ram import IRAMCache
 from zope.i18nmessageid import MessageFactory
+from zope.schema import TextLine
 
 from cpsskins.elements.interfaces import IElement, IPortlet, IDisplay, IFormat
 
@@ -94,5 +96,21 @@
     def __setitem__(key, value):
         """ """
 
+# Settings
+
 class ISettings(Interface):
     """ """
+
+class ISettingType(IInterface):
+    """ """
+
+class ISetting(Interface):
+    """ """
+
+    title = TextLine(
+        title=u"Title",
+        description=u"The setting's title",
+        )
+
+    resource = Attribute("The resource.")
+

Modified: z3lab/cpsskins/branches/jmo-perspectives/resources/manager.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/resources/manager.py       
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/resources/manager.py       Sun Nov 
13 19:58:37 2005
@@ -38,12 +38,12 @@
 
     """
 
+    def register(title, resource, context):
+        """Register a resource."""
+
     def lookup(name, context, default):
         """Look up a resource."""
 
-    def register(object, context):
-        """Register a resource."""
-
 class ResourceManager(object):
     """Resource manager utility"""
 
@@ -52,15 +52,15 @@
 
     implements(IResourceManager)
 
-    def register(self, resource=None, context=None):
+    def register(self, title=u'', resource=None, context=None):
         """Register a local resource."""
         if context is None:
             raise ValueError("Must specify a context.")
         settings = getUtility(ISettings, context=context)
 
         chooser = INameChooser(settings)
-        name = chooser.chooseName('', object)
-        settings[name] = self.setting_factory(resource=resource)
+        name = chooser.chooseName(title, object)
+        settings[name] = self.setting_factory(title=title, resource=resource)
 
         reg = UtilityRegistration(name, self.setting_type, settings[name])
         settings.registrationManager.addRegistration(reg)
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to