Author: jmorliaguet
Date: Sun Apr 16 23:41:41 2006
New Revision: 2857

Added:
   cpsskins/branches/jmo-perspectives/ui/screens/elementeditor/
   cpsskins/branches/jmo-perspectives/ui/screens/elementeditor/__init__.py   
(contents, props changed)
   cpsskins/branches/jmo-perspectives/ui/screens/elementeditor/configure.zcml   
(contents, props changed)
   
cpsskins/branches/jmo-perspectives/ui/screens/elementeditor/element-editor.css  
 (contents, props changed)
Modified:
   cpsskins/branches/jmo-perspectives/elements/element.py
   cpsskins/branches/jmo-perspectives/elements/interfaces.py
   cpsskins/branches/jmo-perspectives/elements/slot.py
   cpsskins/branches/jmo-perspectives/locales/custom.pot
   cpsskins/branches/jmo-perspectives/locales/en/LC_MESSAGES/cpsskins.mo
   cpsskins/branches/jmo-perspectives/locales/en/LC_MESSAGES/cpsskins.po
   cpsskins/branches/jmo-perspectives/locales/fr/LC_MESSAGES/cpsskins.po
   cpsskins/branches/jmo-perspectives/ui/authoring/authoring.css
   cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js
   cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py
   cpsskins/branches/jmo-perspectives/ui/authoring/views.py
   cpsskins/branches/jmo-perspectives/ui/editing/configure.zcml
   cpsskins/branches/jmo-perspectives/ui/editing/views.py
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.css
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_contextualactions_test.html
   cpsskins/branches/jmo-perspectives/ui/manager/views.py
   cpsskins/branches/jmo-perspectives/ui/panels/action_pad.pt
   cpsskins/branches/jmo-perspectives/ui/panels/element_editor.pt
   cpsskins/branches/jmo-perspectives/ui/panels/settings.pt
   cpsskins/branches/jmo-perspectives/ui/screens/configure.zcml
   cpsskins/branches/jmo-perspectives/ui/screens/editor.pt
Log:

- saving work (mostly UI fixes)



Modified: cpsskins/branches/jmo-perspectives/elements/element.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/elements/element.py      (original)
+++ cpsskins/branches/jmo-perspectives/elements/element.py      Sun Apr 16 
23:41:41 2006
@@ -74,6 +74,12 @@
         return uniq([type.getElementType(), type.getResourceType(),
                      type.getContentType()])
 
+    def getTypeName(self):
+        type = IType(self.element)
+        return '-'.join(
+            uniq([type.elementname, type.resourcename, type.contentname])
+            )
+
 class Identifiable(object):
     """This adapter makes elements uniquely identifiable.
     """
@@ -85,14 +91,14 @@
 
     def getURI(self):
         element = self.element
-        type = ITypeable(element).getType()
+        type_name = ITypeable(element).getTypeName()
 
         relatable = IRelatable(element, None)
         if relatable is None:
             relatable = IRelatable(getParent(element), u'')
         identifier = str(relatable)
 
-        return '-'.join([t.getTaggedValue('name') for t in type] + 
[identifier])
+        return '%s-%s' % (type_name, identifier)
 
 class Node(Element):
     """A Node is an element in a tree structure.

Modified: cpsskins/branches/jmo-perspectives/elements/interfaces.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/elements/interfaces.py   (original)
+++ cpsskins/branches/jmo-perspectives/elements/interfaces.py   Sun Apr 16 
23:41:41 2006
@@ -209,7 +209,11 @@
         title=_(u"Slot's title"),
         required=False)
 
-    _slot = TextLine(
+    description = TextLine(
+        title=_(u"Slot's description"),
+        required=False)
+
+    slot = TextLine(
         title=_(u"Slot's name"),
         description=_(u"The slot name is used to identify the slot "
             "inside a theme. Slot names must be unique on a same page."),

Modified: cpsskins/branches/jmo-perspectives/elements/slot.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/elements/slot.py (original)
+++ cpsskins/branches/jmo-perspectives/elements/slot.py Sun Apr 16 23:41:41 2006
@@ -40,13 +40,14 @@
     """
     implements(ISlot)
 
-    def __init__(self, title=u'', _slot=u''):
+    def __init__(self, title=u'', description=u'', slot=u''):
         super(Slot, self).__init__()
         self.title = title
-        self._slot = _slot
+        self.description = description
+        self.slot = slot
 
     def __str__(self):
-        return self._slot
+        return self.slot
 
     def __repr__(self):
         return "Slot('%s', '%s')" % (self.title, str(self))
@@ -84,7 +85,7 @@
     def __str__(self):
         """The slot's name is used as an identifier. It needs not be unique.
         """
-        return self.element._slot
+        return str(self.element)
 
 class NodeTraverser(object):
     """This adapter makes slot nodes traversable.

Modified: cpsskins/branches/jmo-perspectives/locales/custom.pot
==============================================================================
--- cpsskins/branches/jmo-perspectives/locales/custom.pot       (original)
+++ cpsskins/branches/jmo-perspectives/locales/custom.pot       Sun Apr 16 
23:41:41 2006
@@ -1,55 +1,38 @@
 
-msgid "ITheme"
-msgstr ""
+# Elements
 
-msgid "IThemePage"
+msgid "canvas-theme"
 msgstr ""
 
-msgid "IPageBlock"
+msgid "canvas-themepage"
 msgstr ""
 
-msgid "ICell"
+msgid "canvas-pageblock"
 msgstr ""
 
-msgid "ISlot"
+msgid "canvas-cell"
 msgstr ""
 
-msgid "IPortlet"
+msgid "canvas-slot"
 msgstr ""
 
 # Formats
 
-msgid "IWidget"
-msgstr ""
-
-msgid "IStyle"
+msgid "format-widget"
 msgstr ""
 
-msgid "ILayout"
+msgid "format-style"
 msgstr ""
 
-msgid "IEffect"
+msgid "format-effect"
 msgstr ""
 
-
 # Portlets
 
-msgid "IImagePortlet"
-msgstr ""
-
-msgid "IBreadcrumbsPortlet"
-msgstr ""
-
-msgid "ICustomPortlet"
-msgstr ""
-
-msgid "IActionsPortlet"
-msgstr ""
-
-msgid "IDummyPortlet"
+msgid "canvas-portlet-standard.actions"
 msgstr ""
 
-msgid "IMacroSlotPortlet"
+msgid "canvas-portlet-standard.dummy"
 msgstr ""
 
 # Hints

Modified: cpsskins/branches/jmo-perspectives/locales/en/LC_MESSAGES/cpsskins.mo
==============================================================================
Binary files. No diff available.

Modified: cpsskins/branches/jmo-perspectives/locales/en/LC_MESSAGES/cpsskins.po
==============================================================================
--- cpsskins/branches/jmo-perspectives/locales/en/LC_MESSAGES/cpsskins.po       
(original)
+++ cpsskins/branches/jmo-perspectives/locales/en/LC_MESSAGES/cpsskins.po       
Sun Apr 16 23:41:41 2006
@@ -571,55 +571,102 @@
 msgid "Content Type"
 msgstr ""
 
-msgid "ITheme"
+# Elements
+msgid "canvas-theme"
 msgstr "Theme"
 
-msgid "IThemePage"
-msgstr "Theme page"
+msgid "canvas-themepage"
+msgstr "Thame page"
 
-msgid "IPageBlock"
+msgid "canvas-pageblock"
 msgstr "Page block"
 
-msgid "ICell"
+msgid "canvas-cell"
 msgstr "Cell"
 
-msgid "ISlot"
+msgid "canvas-slot"
 msgstr "Slot"
 
-msgid "IPortlet"
-msgstr "Portlet"
-
 # Formats
-msgid "IWidget"
+msgid "format-widget"
 msgstr "Widget"
 
-msgid "IStyle"
+msgid "format-style"
 msgstr "Style"
 
-msgid "ILayout"
-msgstr "Layout"
-
-msgid "IEffect"
+msgid "format-effect"
 msgstr "Effect"
 
 # Portlets
-msgid "IImagePortlet"
-msgstr "Image portlet"
+msgid "canvas-portlet-standard.actions"
+msgstr "Actions portlet"
 
-msgid "IBreadcrumbsPortlet"
-msgstr "Breadcrumbs portlet"
+# Portlets
+msgid "canvas-portlet-standard.dummy"
+msgstr "Dummy portlet"
 
-msgid "ICustomPortlet"
-msgstr "Custom portlet"
+# Hints
+msgid "hint-site-designer"
+msgstr ""
 
-msgid "IActionsPortlet"
-msgstr "Actions portlet"
+msgid "hint-layout-designer"
+msgstr ""
 
-msgid "IDummyPortlet"
-msgstr "Dummy portlet"
+msgid "hint-page-designer"
+msgstr ""
+
+msgid "hint-content-author"
+msgstr ""
+
+#~ msgid "ITheme"
+#~ msgstr "Theme"
+
+#~ msgid "IThemePage"
+#~ msgstr "Theme page"
+
+#~ msgid "IPageBlock"
+#~ msgstr "Page block"
+
+#~ msgid "ICell"
+#~ msgstr "Cell"
+
+#~ msgid "ISlot"
+#~ msgstr "Slot"
+
+#~ msgid "IPortlet"
+#~ msgstr "Portlet"
+
+# Formats
+#~ msgid "IWidget"
+#~ msgstr "Widget"
+
+#~ msgid "IStyle"
+#~ msgstr "Style"
+
+#~ msgid "ILayout"
+#~ msgstr "Layout"
+
+#~ msgid "IEffect"
+#~ msgstr "Effect"
+
+# Portlets
+#~ msgid "IImagePortlet"
+#~ msgstr "Image portlet"
+
+#~ msgid "IBreadcrumbsPortlet"
+#~ msgstr "Breadcrumbs portlet"
+
+#~ msgid "ICustomPortlet"
+#~ msgstr "Custom portlet"
+
+#~ msgid "IActionsPortlet"
+#~ msgstr "Actions portlet"
+
+#~ msgid "IDummyPortlet"
+#~ msgstr "Dummy portlet"
 
-msgid "IMacroSlotPortlet"
-msgstr "Macro-slot portlet"
+#~ msgid "IMacroSlotPortlet"
+#~ msgstr "Macro-slot portlet"
 
 #~ msgid "menu-edit-layout"
 #~ msgstr "Edit layout"

Modified: cpsskins/branches/jmo-perspectives/locales/fr/LC_MESSAGES/cpsskins.po
==============================================================================
--- cpsskins/branches/jmo-perspectives/locales/fr/LC_MESSAGES/cpsskins.po       
(original)
+++ cpsskins/branches/jmo-perspectives/locales/fr/LC_MESSAGES/cpsskins.po       
Sun Apr 16 23:41:41 2006
@@ -594,62 +594,84 @@
 msgid "Content Type"
 msgstr ""
 
-#, fuzzy
-msgid "ITheme"
-msgstr "Thème"
+# Elements
+msgid "canvas-theme"
+msgstr ""
 
-#, fuzzy
-msgid "IThemePage"
-msgstr "Nom du thème"
+msgid "canvas-themepage"
+msgstr ""
 
 #, fuzzy
-msgid "IPageBlock"
-msgstr "Bloc de page"
+msgid "canvas-pageblock"
+msgstr "Ajouter un bloc de page"
 
-#, fuzzy
-msgid "ICell"
-msgstr "Cellule"
+msgid "canvas-cell"
+msgstr ""
 
-#, fuzzy
-msgid "ISlot"
-msgstr "Slot"
+msgid "canvas-slot"
+msgstr ""
 
-#, fuzzy
-msgid "IPortlet"
-msgstr "Container de portlets"
+# Formats
+msgid "format-widget"
+msgstr ""
 
-#, fuzzy
-msgid "IWidget"
-msgstr "Largeur"
+msgid "format-style"
+msgstr ""
 
-msgid "IStyle"
+msgid "format-effect"
 msgstr ""
 
-msgid "ILayout"
+# Portlets
+msgid "canvas-portlet-standard.actions"
 msgstr ""
 
-msgid "IEffect"
+msgid "canvas-portlet-standard.dummy"
 msgstr ""
 
-# Portlets
-msgid "IImagePortlet"
+# Hints
+msgid "hint-site-designer"
 msgstr ""
 
-msgid "IBreadcrumbsPortlet"
+msgid "hint-layout-designer"
 msgstr ""
 
-msgid "ICustomPortlet"
+msgid "hint-page-designer"
 msgstr ""
 
-msgid "IActionsPortlet"
+msgid "hint-content-author"
 msgstr ""
 
 #, fuzzy
-msgid "IDummyPortlet"
-msgstr "Portlet pour tester"
+#~ msgid "ITheme"
+#~ msgstr "Thème"
 
-msgid "IMacroSlotPortlet"
-msgstr ""
+#, fuzzy
+#~ msgid "IThemePage"
+#~ msgstr "Nom du thème"
+
+#, fuzzy
+#~ msgid "IPageBlock"
+#~ msgstr "Bloc de page"
+
+#, fuzzy
+#~ msgid "ICell"
+#~ msgstr "Cellule"
+
+#, fuzzy
+#~ msgid "ISlot"
+#~ msgstr "Slot"
+
+#, fuzzy
+#~ msgid "IPortlet"
+#~ msgstr "Container de portlets"
+
+#, fuzzy
+#~ msgid "IWidget"
+#~ msgstr "Largeur"
+
+#, fuzzy
+#~ msgid "IDummyPortlet"
+#~ msgstr "Portlet pour tester"
 
 #~ msgid "Edit"
 #~ msgstr "Editer"

Modified: cpsskins/branches/jmo-perspectives/ui/authoring/authoring.css
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/authoring/authoring.css       
(original)
+++ cpsskins/branches/jmo-perspectives/ui/authoring/authoring.css       Sun Apr 
16 23:41:41 2006
@@ -81,32 +81,33 @@
 }
 
 /* toolbar buttons */
-#actionPad {
+.actionPad {
   padding-top: 12px;
   padding-left: 5px;
 }
 
-#actionPad a {
+.actionPad a {
   font-size: 12px;
   color: #000 !important;
-  background: #f6f6f6;
+  background: #f3f0f0;
   text-decoration: none;
   border: 1px;
   border-style: solid;
-  border-color: #999 #333 #333 #999;
+  border-color: #fff #000 #000 #fff;
   padding: 3px 4px 3px 4px;
   margin: 0 0 0 4px;
 }
 
-#actionPad a.selected, #actionPad a:hover {
+.actionPad a.selected, .actionPad a:hover {
   background-color: #f9ff50;
   border-width: 1px;
   border-style: solid;
   border-color: #333 #ccc #ccc #333;
 }
 
-#actionPad a.exit {
+.actionPad a.exit {
   background-color: #dfb;
+  border-color: #ccc #333 #333 #ccc;
 }
 
 .formClose {

Modified: cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js        
(original)
+++ cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js        Sun Apr 
16 23:41:41 2006
@@ -1,13 +1,4 @@
 
-/* Pop up - for testing. this will be rewritten as Ajax windows */
-
-function openWindow(url) {
-  var win = window.open(url, 'selector', "width=760, height=600, location=no, 
menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes");
-  if (!win.opener) win.opener = self;
-  if (window.focus) {window.focus()}
-  return false;
-}
-
 function insertPortlet(info) {
   var url = '@@insertElement'
   var args = {
@@ -42,7 +33,8 @@
 
 function editElement(info) {
   var id = info.target.getAttribute('targetid');
-  openWindow('@@edit-panel.html?id=' + id);
+  CPSSkins.getModelById('element-editor').setData({'form': {'id': id, 
'format': ''} });
+  
CPSSkins.getControllerById('main-editor-perspectives').switchTo('element-editor')
 }
 
 /* Register actions */

Modified: cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py      
(original)
+++ cpsskins/branches/jmo-perspectives/ui/authoring/definitions.py      Sun Apr 
16 23:41:41 2006
@@ -11,6 +11,18 @@
         }
     },
 
+    'element-editor': {
+        'id': 'element-editor',
+        'data': {
+            'url': '@@element-editor.html',
+            'css': '/++skin++cpsskins/@@/++resource++element-editor.css',
+            'form': {
+                'id': '',
+                'format': '',
+            },
+        }
+    },
+
     'perspective-selector': {
         'id': 'perspective-selector',
         'data': {
@@ -131,6 +143,7 @@
             'url': '@@negotiation.html',
         }
     },
+
 }
 
 VIEWS = {
@@ -143,24 +156,35 @@
         },
         'model': 'action-pad',
         'perspectives': ['site-manager', 'page-designer', 'layout-designer',
-                         'interaction-designer', 'content-author'],
+                         'interaction-designer', 'content-author',
+                         'element-editor'],
+        'controllers': ['main-editor-perspectives'],
+    },
+
+    'element-editor': {
+        'id': 'element-editor',
+        'widget': {
+            'type': 'panel',
+        },
+        'model': 'element-editor',
+        'perspectives': ['element-editor'],
         'controllers': ['main-editor-perspectives'],
     },
 
     'tooltip': {
         'id': 'tooltip',
-        'selectors': ['#actionPad a'],
+        'selectors': ['.actionPad a'],
         'widget': {
             'type': 'tooltip',
             'follow': True,
         },
         'show_effect': {
             'transition': 'fadein',
-            'delay': 1000,
+            'delay': 1300,
         },
         'hide_effect': {
             'transition': 'fadeout',
-            'delay': 1000,
+            'delay': 500,
         },
         'controllers': ['show-hide-tooltip'],
     },
@@ -171,7 +195,8 @@
             'type': 'panel',
         },
         'model': 'perspective-selector',
-        'perspectives': ['page-designer', 'layout-designer', 'content-author'],
+        'perspectives': ['page-designer', 'layout-designer', 'content-author',
+                         'element-editor'],
         'controllers': ['main-editor-perspectives', 'perspective-selector'],
     },
 
@@ -316,6 +341,18 @@
         'perspectives': ['io'],
         'controllers': ['site-manager-perspectives', 'io-actions'],
     },
+
+    # element editor
+    'element-editor': {
+        'id': 'element-editor',
+        'widget': {
+            'type': 'panel'
+        },
+        'model': 'element-editor',
+        'perspectives': ['element-editor'],
+        'controllers': ['main-editor-perspectives', 'element-editor-actions'],
+    },
+
     # Bottom area
     'portlet-factory': {
         'id': 'portlet-factory',
@@ -388,30 +425,41 @@
          'transition': 'fadein',
        },
        'hide_effect': {
-         'transition': 'fadeout',
+         'transition': 'hide',
        },
     },
 }
 
 CONTROLLERS = {
+
     'main-editor-perspectives': {
         'id': 'main-editor-perspectives',
         'type': 'perspective selector',
         'initial': 'site-manager',
     },
+
     'theme-switcher': {
         'id': 'theme-switcher',
         'type': 'remote scripting',
     },
+
     'site-manager-perspectives': {
         'id': 'site-manager-perspectives',
         'type': 'perspective selector',
         'initial': 'settings',
     },
+
+    'element-editor-perspectives': {
+        'id': 'element-editor-perspectives',
+        'type': 'perspective selector',
+        'initial': 'default',
+    },
+
     'show-hide-tooltip': {
         'id': 'show-hide-tooltip',
         'type': 'focus observer',
     },
+
     'portlet-factory': {
         'id': 'portlet-factory',
         'type': 'drag-and-drop',
@@ -434,6 +482,7 @@
             'action': 'insert portlet',
         },
     },
+
     'element-mover': {
         'id': 'element-mover',
         'type': 'drag-and-drop',
@@ -456,24 +505,35 @@
             'action': 'move element',
         },
     },
+
     'menu-actions': {
         'id': 'menu-actions',
         'type': 'command',
     },
+
     'show-hide-menu': {
         'id': 'show-hide-menu',
         'type': 'focus observer',
     },
+
     'settings-actions': {
         'id': 'settings-actions',
         'type': 'remote scripting',
     },
+
     'perspective-selector': {
         'id': 'perspective-selector',
         'type': 'remote scripting',
     },
+
     'io-actions': {
         'id': 'io-actions',
         'type': 'remote scripting',
     },
+
+    'element-editor-actions': {
+        'id': 'element-editor-actions',
+        'type': 'remote scripting',
+    },
+
 }

Modified: cpsskins/branches/jmo-perspectives/ui/authoring/views.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/authoring/views.py    (original)
+++ cpsskins/branches/jmo-perspectives/ui/authoring/views.py    Sun Apr 16 
23:41:41 2006
@@ -152,7 +152,7 @@
         """
         return getThemeManager().getElementById(id)
 
-    def renderElement(self, id, engine=u'default'):
+    def renderElement(self, id='1700182219', engine=u'default'):
         """Render the element and return the markup
         """
         element = self._getElementById(id)

Modified: cpsskins/branches/jmo-perspectives/ui/editing/configure.zcml
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/editing/configure.zcml        
(original)
+++ cpsskins/branches/jmo-perspectives/ui/editing/configure.zcml        Sun Apr 
16 23:41:41 2006
@@ -91,12 +91,23 @@
 
   </pages>
 
-  <page
-     name="getFormData"
-     for="cpsskins.elements.interfaces.IElement"
-     class=".views.ElementForm"
-     permission="zope.ManageContent"
-  />
+  <pages
+      for="cpsskins.elements.interfaces.IElement"
+      layer="cpsskins.browser.skin.cpsskins"
+      permission="zope.ManageContent"
+      class=".views.ElementForm">
+
+      <page
+          name="getFormData"
+          attribute="getFormData"
+      />
+
+      <page
+          name="submitFormData"
+          attribute="submitFormData"
+      />
+
+  </pages>
 
   <pages
       for="cpsskins.elements.interfaces.IElement"

Modified: cpsskins/branches/jmo-perspectives/ui/editing/views.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/editing/views.py      (original)
+++ cpsskins/branches/jmo-perspectives/ui/editing/views.py      Sun Apr 16 
23:41:41 2006
@@ -28,11 +28,12 @@
 
 from cpsskins.browser.negotiation.interfaces import INegotiation
 from cpsskins.elements.interfaces import IDisplayable, IFormattable
-from cpsskins.elements.interfaces import IType, IDisplay, IFormat
+from cpsskins.elements.interfaces import IType, ITypeable, IDisplay, IFormat
 from cpsskins.relations.interfaces import IRelationTool
 from cpsskins.relations.relations import DyadicRelation
 from cpsskins.setup.interfaces import IResourceManager, IResource, ISetting
 from cpsskins.storage.interfaces import IStorage
+from cpsskins.utils import getThemeManager
 
 
 #######################################################################
@@ -92,13 +93,22 @@
         self.context = context
         self.request = request
 
-    def __call__(self):
-        context = self.context
-        request = self.request
+        schema = IType(context).getContentType()
+        self.form_fields = form.Fields(schema, render_context=True)
+        self.widgets = form.setUpWidgets(self.form_fields, 'form',
+                                         context, request)
+
+    def getFormData(self):
+        return self.widgets
+
+    def submitFormData(self):
+        data = {}
+        errors = form.getWidgetsData(self.widgets, 'form', data)
+
+        changed = form.applyChanges(self.context, self.form_fields, data)
+
+        return ''
 
-        schema = IType(context).getResourceType()
-        form_fields = form.Fields(schema, render_context=True)
-        return form.setUpWidgets(form_fields, 'form', context, request)
 
 class EditPanel(BrowserView):
 
@@ -109,9 +119,13 @@
         context = self.context
         request = self.request
 
+        tmutil = getThemeManager()
+
         form = request.form
         format_name = form.get('format')
-        main_url = form.get('main_url')
+        element_id = form.get('id')
+
+        edited_id = format_name or element_id
 
         negotiation = getMultiAdapter((context, request),
                                       INegotiation, 'negotiation')
@@ -120,15 +134,10 @@
         display = displayable.getEffectiveDisplay(perspective)
         formattable = IFormattable(display)
 
-        main = context
-
         # Edited element
-        type = IType(context)
         element_info = {
-            'title': '%s.%s' % (type.elementname, type.contentname),
-            'url': '@@edit-menu.html?main_url=@@edit.html',
-            'selected': not format_name,
-            'icon': '',
+            'name': ITypeable(context).getTypeName(),
+            'id': context.identifier,
             }
 
         # Formats
@@ -139,22 +148,16 @@
             is_setting = ISetting.providedBy(f)
             if is_setting:
                 f = IResource(f).getResource()
-            type = IType(f)
-            name = type.resourcename
+            name = ITypeable(f).getTypeName()
             selected = name == format_name
             if selected:
                 format = f
                 if is_setting:
-                    main_url = '%s/@@manage-settings.html?format=%s' % (
-                               self.getAbsoluteURL(display), name),
                     format_is_setting = True
-                else:
-                    main = format
 
             formats_info.append({
-                'title': '%s.%s' % (type.elementname, type.resourcename),
-                'url': './@@edit-menu.html?format=%s' % name,
-                'selected': selected,
+                'name': name,
+                'id': f.identifier,
                 })
 
         # Actions
@@ -174,7 +177,6 @@
                 }])
 
         # Main area
-        main_url = main_url or self.getAbsoluteURL(main) + '/@@edit.html'
 
         return {
             'negotiation': negotiation,
@@ -184,7 +186,7 @@
             'element': element_info,
             'formats': formats_info,
             'actions' : actions_info,
-            'main_url': main_url,
+            'edited': tmutil.getElementById(edited_id),
             }
 
 #######################################################################

Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.css
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.css        
(original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.css        Sun Apr 
16 23:41:41 2006
@@ -92,14 +92,14 @@
 
 /* Contextual actions */
 
-.contextualActions {
+.contextActions {
   font: 11px Verdana, Arial, Helvetica, sans-serif;
   color: #000;
   background-color: #fff9cf;
   border: 1px solid #dd9;
 }
 
-.contextualActions a {
+.contextActions a {
   cursor: default;
   text-decoration: none;
   vertical-align: top;
@@ -111,7 +111,7 @@
   padding: 5px 10px 5px 4px;
 }
 
-.contextualActions a img {
+.contextActions a img {
   border: none;
   padding-right: 5px;
   vertical-align: bottom;

Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Sun Apr 16 
23:41:41 2006
@@ -614,12 +614,9 @@
   submitEvent: function(e) {
     var target = Event.findElement(e, 'form');
     if (target && target != document) {
-      var url = target.getAttribute('action');
+      var method = target.getAttribute('action');
       var params = Form.serialize(target);
-      if (params) {
-        url += '?' + params;
-      }
-      this._call(target, url);
+      this._call(target, method, params);
       Event.stop(e);
     }
   },
@@ -630,24 +627,35 @@
       target = Event.findElement(e, 'a');
     }
     if (target && target != document) {
-      this._call(target, target.href);
+      var href = target.href;
+      if (href.match(/^javascript:/)) {
+        eval(href);
+      } else {
+        var parts = href.split('?');
+        var method = href;
+        if (parts.length == 2) {
+          method = parts[0];
+          params = parts[1];
+        }
+        this._call(target, method, params);
+      }
       Event.stop(e);
     }
   },
 
-  _call: function(target, url) {
+  _call: function(target, url, params) {
     if (!url) return;
     var _request = this._request;
     var views = this.views;
     views.entries().each(function(v) {
       var view = CPSSkins.getViewById(v);
       if (target.childOf(view.widget)) {
-        _request(views, view, url);
+        _request(views, view, url, params);
       }
     });
   },
 
-  _request: function(views, view, url) {
+  _request: function(views, view, url, params) {
     var options = {
       onComplete: function(req) {
         var disp = req.getResponseHeader('content-disposition');
@@ -664,13 +672,8 @@
         });
       }
     };
-    var parts = url.split('?');
-    var method = url;
-    if (parts.length == 2) {
-      method = parts[0];
-      options.parameters = parts[1];
-    }
-    new Ajax.Request(method, options);
+    options.parameters = params;
+    new Ajax.Request(url, options);
   }
 
 });
@@ -1945,10 +1948,10 @@
     return new CPSSkins.ContextualMenu(widget, def);
   },
 
-  contextualactions: function(def) {
+  contextactions: function(def) {
     var widget = CPSSkins.Canvas.createNode({
       tag: "div",
-      classes: "contextualActions",
+      classes: "contextActions",
       style: {position:"absolute", display:"none"}
     });
     return new CPSSkins.ContextualActions(widget, def);
@@ -2354,20 +2357,6 @@
               CPSSkins.ContextualMenu.prototype);
 Object.extend(CPSSkins.ContextualActions.prototype, {
 
-  prepare: function() {
-    var selected = this.selected;
-    if (!selected) return;
-
-    var widget = this.widget;
-    widget.moveTo({'x': this.mouseX-50, 'y': this.mouseY});
-    widget.fitInsideScreen();
-  },
-
-  render: function(data) {
-    this.widget.innerHTML = '';
-    this._renderFragment(this.widget, this.def.widget, data);
-  },
-
   _renderFragment: function(container, fragment, data) {
     var createNode = CPSSkins.Canvas.createNode;
     fragment.items.each(function(item) {
@@ -2407,13 +2396,6 @@
     });
   },
 
-  hideEvent: function(e) {
-    this.hide();
-  },
-
-  mouseOverEvent: function(e) {
-  }
-
 });
 
 
@@ -2461,6 +2443,7 @@
       Event.observe(document, "mousemove", this.moveEvent);
     }
 
+    this._displayed = true;
     this.show();
     Event.stop(e);
   },
@@ -2480,6 +2463,7 @@
       Event.stopObserving(document, "mousemove", this.moveEvent);
     }
 
+    this._displayed = false;
     this.hide();
     Event.stop(e);
   }

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_contextualactions_test.html
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_contextualactions_test.html
       (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_contextualactions_test.html
       Sun Apr 16 23:41:41 2006
@@ -35,7 +35,7 @@
     {"id": "menu",
      "selectors": ["div"],
      "widget": {
-       "type": "contextualactions",
+       "type": "contextactions",
        "items": [
          {"type": "item",
           "label": "Edit",

Modified: cpsskins/branches/jmo-perspectives/ui/manager/views.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/manager/views.py      (original)
+++ cpsskins/branches/jmo-perspectives/ui/manager/views.py      Sun Apr 16 
23:41:41 2006
@@ -98,8 +98,10 @@
         theme[u'page'][u'main'][u'right'] = Cell(u'Right')
         theme[u'page'][u'bottom'][u'bottom'] = Cell(u'Bottom')
         # Add the slots
-        theme[u'page'][u'main'][u'left'][u'left'] = Slot(u'Left slot', u'left')
-        theme[u'page'][u'main'][u'right'][u'right'] = Slot('Right slot', 
u'right')
+        theme[u'page'][u'main'][u'left'][u'left'] = Slot(u'Left slot', u'',
+                                                         u'left')
+        theme[u'page'][u'main'][u'right'][u'right'] = Slot(u'Right slot', u'',
+                                                           u'right')
 
         # Some basic layout formatting
         def set_width(element, width):

Modified: cpsskins/branches/jmo-perspectives/ui/panels/action_pad.pt
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/panels/action_pad.pt  (original)
+++ cpsskins/branches/jmo-perspectives/ui/panels/action_pad.pt  Sun Apr 16 
23:41:41 2006
@@ -1,24 +1,19 @@
-<div id="actionPad">
+<div class="actionPad">
 
   <ins class="model" cite="@@getHint?msgid=hint-site-manager"></ins>
-  <a 
onclick="CPSSkins.getControllerById('main-editor-perspectives').switchTo('site-manager')"
-     href="javascript:void(0)">Site manager</a>
+  <a 
href="javascript:CPSSkins.getControllerById('main-editor-perspectives').switchTo('site-manager')">Site
 manager</a>
 
   <ins class="model" cite="@@getHint?msgid=hint-layout-designer"></ins>
-  <a 
onclick="CPSSkins.getControllerById('main-editor-perspectives').switchTo('layout-designer')"
-     href="javascript:void(0)">Layout designer</a>
+  <a 
href="javascript:CPSSkins.getControllerById('main-editor-perspectives').switchTo('layout-designer')">Layout
 designer</a>
 
   <ins class="model" cite="@@getHint?msgid=hint-page-designer"></ins>
-  <a 
onclick="CPSSkins.getControllerById('main-editor-perspectives').switchTo('page-designer')"
-     href="javascript:void(0)">Page designer</a>
+  <a 
href="javascript:CPSSkins.getControllerById('main-editor-perspectives').switchTo('page-designer')">Page
 designer</a>
 
   <ins class="model" cite="@@getHint?msgid=hint-content-author"></ins>
-  <a 
onclick="CPSSkins.getControllerById('main-editor-perspectives').switchTo('content-author')"
-     href="javascript:void(0)">Content author</a>
+  <a 
href="javascript:CPSSkins.getControllerById('main-editor-perspectives').switchTo('content-author')">Content
 author</a>
 
   <ins class="model" cite="@@getHint?msgid=hint-interaction-designer"></ins>
-  <a 
onclick="CPSSkins.getControllerById('main-editor-perspectives').switchTo('interaction-designer')"
-     href="javascript:void(0)">Interaction designer</a>
+  <a 
href="CPSSkins.getControllerById('main-editor-perspectives').switchTo('interaction-designer')">Interaction
 designer</a>
 
   <!-- tooltip -->
   <ins class="view" cite="@@getView?id=tooltip"></ins>

Modified: cpsskins/branches/jmo-perspectives/ui/panels/element_editor.pt
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/panels/element_editor.pt      
(original)
+++ cpsskins/branches/jmo-perspectives/ui/panels/element_editor.pt      Sun Apr 
16 23:41:41 2006
@@ -1,24 +1,40 @@
-<h1>Element editor</h1>
 
-<ins class="controller" cite="@@getController?id=element-editor-actions"></ins>
+<tal:block i18n:domain="cpsskins"
+    define="id request/form/id|nothing;
+            tmutil context/@@getThemeManager;
+            element python: tmutil.getElementById(id);
+            info element/@@editpanel/getInfo;
+            edited nocall:info/edited">
+
+  <a class="back"
+     
href="javascript:CPSSkins.getControllerById('main-editor-perspectives').goBack()">&lt;
 Back to the editor</a>
+
+  <h1 tal:content="element/title" />
+
+  <p class="description" tal:content="element/description" />
+
+  <div class="tabs">
+    <a i18n:translate=""
+       tal:attributes="
+         href 
string:javascript:CPSSkins.getModelById('element-editor').updateData({'form': 
{'id': $id, 'format': ''}})"
+       tal:content="info/element/name" />
+
+    <a i18n:translate=""
+       tal:repeat="format info/formats"
+       tal:attributes="
+         href 
string:javascript:CPSSkins.getModelById('element-editor').updateData({'form': 
{'id': $id, 'format': '${format/id}'}})"
+       tal:content="format/name" />
+  </div>
+
+  <form action="." tal:attributes="action 
string:${edited/@@absolute_url}/@@submitFormData">
+    <table>
+      <tr tal:repeat="formdata edited/@@getFormData">
+        <td tal:content="formdata/label" />
+        <td tal:content="structure formdata" />
+      </tr>
+    </table>
 
-<tal:block define="tmutil context/@@getThemeManager;
-                   id request/form/id;
-                   format request/form/format|string:;
-                   element python: tmutil.getElementById(id)">
-
-   <tal:block content="element/title" />
-
-   <form action=".">
-     <table>
-       <tr tal:repeat="formdata element/@@getFormData">
-         <td tal:content="formdata/label" />
-         <td tal:content="structure formdata" />
-       </tr>
-     </table>
-
-     <button type="submit">OK</button>
-   </form>
+    <button type="submit">SAVE</button>
+  </form>
 
 </tal:block>
-

Modified: cpsskins/branches/jmo-perspectives/ui/panels/settings.pt
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/panels/settings.pt    (original)
+++ cpsskins/branches/jmo-perspectives/ui/panels/settings.pt    Sun Apr 16 
23:41:41 2006
@@ -9,7 +9,7 @@
       <div class="sections">
         <span class="description">manage settings ...</span>
         <ul>
-          <li tal:repeat="section python: ['perspective', 'style', 'color']">
+          <li tal:repeat="section python: ['perspective', 'widget', 'style', 
'color']">
             <a class="section" tal:attributes="href 
string:javascript:CPSSkins.getModelById('settings-section').setData({'form': 
{'section': '$section'}})" tal:content="section">SECTION</a></li>
         </ul>
         <br style="clear:both"/>

Modified: cpsskins/branches/jmo-perspectives/ui/screens/configure.zcml
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/screens/configure.zcml        
(original)
+++ cpsskins/branches/jmo-perspectives/ui/screens/configure.zcml        Sun Apr 
16 23:41:41 2006
@@ -28,4 +28,7 @@
   <!-- JSR168-like portlets -->
   <include package=".jsr168" />
 
+  <!-- element editor -->
+  <include package=".elementeditor" />
+
 </configure>

Modified: cpsskins/branches/jmo-perspectives/ui/screens/editor.pt
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/screens/editor.pt     (original)
+++ cpsskins/branches/jmo-perspectives/ui/screens/editor.pt     Sun Apr 16 
23:41:41 2006
@@ -24,6 +24,7 @@
     <div class="floatingHeader">
       <ins class="model" cite="@@getModel?id=action-pad"></ins>
       <ins class="view" cite="@@getView?id=action-pad"></ins>
+
       <ins class="model" cite="@@getModel?id=perspective-selector"></ins>
       <ins class="view" cite="@@getView?id=perspective-selector"></ins>
       <ins class="controller" 
cite="@@getController?id=perspective-selector"></ins>
@@ -67,6 +68,12 @@
 
       <ins class="model" cite="@@getModel?id=interaction-designer"></ins>
       <ins class="view" cite="@@getView?id=interaction-designer"></ins>
+
+      <!-- element editor -->
+      <ins class="model" cite="@@getModel?id=element-editor"></ins>
+      <ins class="view" cite="@@getView?id=element-editor"></ins>
+      <ins class="controller" 
cite="@@getController?id=element-editor-actions"></ins>
+
     </div>
 
     <ins class="controller" cite="@@getController?id=theme-switcher"></ins>

Added: cpsskins/branches/jmo-perspectives/ui/screens/elementeditor/__init__.py
==============================================================================
--- (empty file)
+++ cpsskins/branches/jmo-perspectives/ui/screens/elementeditor/__init__.py     
Sun Apr 16 23:41:41 2006
@@ -0,0 +1,19 @@
+##############################################################################
+#
+# Copyright (c) 2005-2006 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: 
cpsskins/branches/jmo-perspectives/ui/screens/elementeditor/configure.zcml
==============================================================================
--- (empty file)
+++ cpsskins/branches/jmo-perspectives/ui/screens/elementeditor/configure.zcml  
Sun Apr 16 23:41:41 2006
@@ -0,0 +1,12 @@
+<configure
+    xmlns="http://namespaces.zope.org/browser";>
+
+  <!-- Element editor -->
+
+  <resource
+      name="element-editor.css"
+      file="element-editor.css"
+      layer="cpsskins.browser.skin.cpsskins"
+  />
+
+</configure>

Added: 
cpsskins/branches/jmo-perspectives/ui/screens/elementeditor/element-editor.css
==============================================================================
--- (empty file)
+++ 
cpsskins/branches/jmo-perspectives/ui/screens/elementeditor/element-editor.css  
    Sun Apr 16 23:41:41 2006
@@ -0,0 +1,46 @@
+
+h1 {
+  letter-spacing: -0.03em;
+  font-size: 160%;
+  font-weight: normal;
+  color: #000;
+  border-left: 7px solid #fcaf3e;
+  padding: 1px 2px 1px 8px;
+  margin: 0.5em 0 0.4em 0;
+}
+
+.description {
+  color: #333;
+  padding-right: 1.5em;
+  font-style: italic;
+}
+
+a {
+  color: #000;
+}
+
+a.back {
+  border: 1px solid #ccc;
+  background-color: #efc;
+  padding: 0.2em;
+  float: right; 
+}
+
+div.tabs a {
+  border-color: #666;
+  border-width: 1px;
+  border-style: solid solid none solid;
+  background-color: #f3f0f0;
+  padding: 1px 12px 1px 12px;
+  margin-right: 2px;
+}
+
+form {
+  border: 1px solid #666;
+  padding: 1em;
+}
+
+button, input {
+  border: 1px solid #999;
+  padding: 0.2em;
+}
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to