Author: jmorliaguet Date: Wed Jan 4 21:07:51 2006 New Revision: 2138 Added: cpsskins/branches/jmo-perspectives/ui/screens/ cpsskins/branches/jmo-perspectives/ui/screens/__init__.py (contents, props changed) cpsskins/branches/jmo-perspectives/ui/screens/configure.zcml (contents, props changed) cpsskins/branches/jmo-perspectives/ui/screens/editor.pt (contents, props changed) cpsskins/branches/jmo-perspectives/ui/screens/location_selector.pt (contents, props changed) cpsskins/branches/jmo-perspectives/ui/screens/page_tabs.pt (contents, props changed) cpsskins/branches/jmo-perspectives/ui/screens/perspective_selector.pt (contents, props changed) cpsskins/branches/jmo-perspectives/ui/screens/portlet_factory.pt (contents, props changed) cpsskins/branches/jmo-perspectives/ui/screens/theme_tabs.pt (contents, props changed) cpsskins/branches/jmo-perspectives/ui/screens/views.py (contents, props changed) Log:
- saving work: refactoring of the theme editor using the single-page application principle http://en.wikipedia.org/wiki/Single_Page_Application Added: cpsskins/branches/jmo-perspectives/ui/screens/__init__.py ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/ui/screens/__init__.py Wed Jan 4 21:07:51 2006 @@ -0,0 +1,19 @@ +############################################################################## +# +# 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: cpsskins/branches/jmo-perspectives/ui/screens/configure.zcml ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/ui/screens/configure.zcml Wed Jan 4 21:07:51 2006 @@ -0,0 +1,56 @@ +<configure + xmlns="http://namespaces.zope.org/browser" + xmlns:zope="http://namespaces.zope.org/zope"> + + <!-- Panels --> + <pages + for="*" + layer="cpsskins" + permission="zope.ManageContent"> + + <page + name="editor.html" + template="editor.pt" + /> + + <page + name="perspectiveSelector.html" + template="perspective_selector.pt" + /> + + <page + name="themeTabs.html" + template="theme_tabs.pt" + /> + + <page + name="pageTabs.html" + template="page_tabs.pt" + /> + + <page + name="portletFactory.html" + template="portlet_factory.pt" + /> + + <page + name="locationSelector.html" + template="location_selector.pt" + /> + + </pages> + + <pages + for="cpsskins.elements.interfaces.IElement" + layer="cpsskins" + permission="zope.ManageContent" + class=".views.Rendering"> + + <page + name="renderPage.html" + attribute="renderPage" + /> + + </pages> + +</configure> Added: cpsskins/branches/jmo-perspectives/ui/screens/editor.pt ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/ui/screens/editor.pt Wed Jan 4 21:07:51 2006 @@ -0,0 +1,146 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" + tal:define="tmutil context/@@getThemeManager; + negociation nocall:context/@@negociation; + effective_theme negociation/getTheme; + effective_page negociation/getPage"> + <head> + <link rel="Stylesheet" type="text/css" + href="/++skin++cpsskins/@@/++resource++authoring.css" /> + <link rel="Stylesheet" type="text/css" + href="/++skin++cpsskins/@@/++resource++cpsskins.css" /> + <link rel="Stylesheet" type="text/css" + href="/++skin++cpsskins/@@/++resource++widgets.css" /> + <link rel="Stylesheet" type="text/css" href="./renderCSS" /> + + <script type="text/javascript" + src="/++skin++cpsskins/@@/++resource++prototype.js"></script> + <script type="text/javascript" + src="/++skin++cpsskins/@@/++resource++json.js"></script> + <script type="text/javascript" + src="/++skin++cpsskins/@@/++resource++cpsskins.js"></script> + <script type="text/javascript" + src="/++skin++cpsskins/@@/++resource++authoring.js"></script> + </head> + <body> + <div class="floatingHeader"> + + <div id="actionPad"> + + <!-- json-data: + {"hint":"Site designers are in charge of the overall site's design. + They manage resources and settings.." + --> + <a href="#" onclick="javascript: new CPSSkins.switchPerspective('site-designer')">Site designer</a> + + <!-- json-data: + {"hint":"Layout designers define the layout structure of pages." + --> + <a href="#" onclick="javascript: new CPSSkins.switchPerspective('layout-designer')">Layout designer</a> + + <!-- json-data: + {"hint":"Page designers are in charge of the site's graphic design. + They also define the areas in which content authors will add + the site's content"} + --> + <a href="#" onclick="javascript: new CPSSkins.switchPerspective('page-designer')">Page designer</a> + + <!-- json-data: + {"hint":"Content authors add content to pages in different contexts."} + --> + <a href="#" onclick="javascript: new CPSSkins.switchPerspective('content-author')">Content author</a> + + <cpsskins:tooltip showdelay="1500"></cpsskins:tooltip> + + </div> + + <cpsskins:panel + perspectives="page-designer,layout-designer,content-author" + url="@@perspectiveSelector.html"> + </cpsskins:panel> + + </div> + + <div id="editArea"> + + <!-- top area --> + <cpsskins:panel + perspectives="page-designer,layout-designer" + url="@@themeTabs.html"> + </cpsskins:panel> + + <cpsskins:panel + perspectives="page-designer,layout-designer" + url="@@pageTabs.html"> + </cpsskins:panel> + + <cpsskins:panel + perspectives="content-author" + url="@@locationSelector.html"> + </cpsskins:panel> + + <!-- main area: rendered page --> + <cpsskins:panel + tal:repeat="engine python:('page-designer', 'layout-designer', + 'content-author')" + tal:attributes="perspectives engine; + url string:@@renderPage.html?engine=$engine"> + </cpsskins:panel> + + <!-- Contextual menu --> + <cpsskins:contextmenu controller="menuactions"> + + <item + action="edit" + label="menu-edit" i18n:attributes="label" + icon="/++skin++cpsskins/@@/edit-16.png"></item> + + <item + action="duplicate" + label="menu-duplicate" i18n:attributes="label" + icon="/++skin++cpsskins/@@/duplicate-16.png"></item> + + <separator></separator> + + <item + action="copy" + label="menu-copy" i18n:attributes="label" + icon="/++skin++cpsskins/@@/copy-16.png"></item> + <item + action="paste" + label="menu-paste" i18n:attributes="label" + icon="/++skin++cpsskins/@@/paste-16.png"></item> + + <separator></separator> + + <submenu label="menu-format" i18n:attributes="label"> + <items choices="formats"></items> + </submenu> + + <separator></separator> + + <item + action="delete" + label="menu-delete" i18n:attributes="label" + confirm="Deleting, are you sure?" + icon="/++skin++cpsskins/@@/delete-16.png"></item> + + </cpsskins:contextmenu> + + <div id="drag-feedback-box"></div> + <div id="factory-box"></div> + <div id="selection-box"></div> + </div> + + <div class="floatingFooter"> + + <cpsskins:panel + perspectives="page-designer,layout-designer,content-author" + url="@@portletFactory.html"> + </cpsskins:panel> + + </div> + + </body> +</html> Added: cpsskins/branches/jmo-perspectives/ui/screens/location_selector.pt ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/ui/screens/location_selector.pt Wed Jan 4 21:07:51 2006 @@ -0,0 +1,3 @@ + +<div class="locationSelector">Choose location: /.../.../</div> + Added: cpsskins/branches/jmo-perspectives/ui/screens/page_tabs.pt ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/ui/screens/page_tabs.pt Wed Jan 4 21:07:51 2006 @@ -0,0 +1,14 @@ +<ul class="pageTabs" + tal:define="tmutil context/@@getThemeManager; + negociation nocall:context/@@negociation; + effective_theme negociation/getTheme; + effective_page negociation/getPage; + pages effective_theme/getPages"> + <tal:block repeat="page pages"> + <li tal:define="selected python: page == effective_page" + tal:attributes="class python: selected and 'selected' or None"> + <a href="" + tal:content="page/title" + tal:attributes="href string:${page/@@absolute_url}/@@${view/__name__}" /></li> + </tal:block> +</ul> Added: cpsskins/branches/jmo-perspectives/ui/screens/perspective_selector.pt ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/ui/screens/perspective_selector.pt Wed Jan 4 21:07:51 2006 @@ -0,0 +1,14 @@ +<form class="perspective" title="Perspective selector" i18n:attributes="title" + action="@@setPerspective" method="post" + tal:define="tmutil context/@@getThemeManager; + perspectives tmutil/listPerspectives; + current context/@@negociation/getPerspective"> + <select onchange="submit()" name="perspective"> + <option value="" i18n:translate="">default</option> + <option tal:repeat="perspective perspectives" + tal:content="perspective/title" + tal:attributes="value perspective/name; + selected python:perspective.name == current + and 'selected' or nothing" /> + </select> +</form> Added: cpsskins/branches/jmo-perspectives/ui/screens/portlet_factory.pt ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/ui/screens/portlet_factory.pt Wed Jan 4 21:07:51 2006 @@ -0,0 +1,15 @@ +<table class="toolbox" cellpadding="2" cellspacing="1" + tal:define="portlets context/@@view_get_menu/cpsskins_add_portlet" + tal:condition="portlets"> + <tr> + <tal:block repeat="portlet portlets"> + <td class="factory" + tal:define="title portlet/title" + tal:attributes="type_name portlet/action"> + <img width="16" height="16" + i18n:attributes="title" + tal:attributes="title title; + src string:/++skin++cpsskins/++resource++${portlet/icon}" /></td> + </tal:block> + </tr> +</table> Added: cpsskins/branches/jmo-perspectives/ui/screens/theme_tabs.pt ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/ui/screens/theme_tabs.pt Wed Jan 4 21:07:51 2006 @@ -0,0 +1,26 @@ +<table class="topTabs" cellpadding="0" cellspacing="0" border="0" summary="" + tal:define="tmutil context/@@getThemeManager; + negociation nocall:context/@@negociation; + effective_theme negociation/getTheme; + themes tmutil/getThemes"> + <tr> + <tal:block repeat="theme themes"> + <tal:block define="selected python: theme == effective_theme"> + <td tal:attributes="class python: selected and 'ltabselected' or 'ltab'"> + <img src="" alt="" width="5" height="5" + tal:attributes="src string:${context/++resource++ltab.png}" /> + </td> + <td tal:attributes="class python: selected and 'tabselected' or 'tab'"> + <a href="" + tal:content="theme/title" + tal:attributes="href string:${theme/@@absolute_url}/@@editor.html" /> + </td> + <td tal:attributes="class python: selected and 'rtabselected' or 'rtab'"> + <img src="" alt="" width="5" height="5" + tal:attributes="src string:${context/++resource++rtab.png}" /> + </td> + <td class="separator"></td> + </tal:block> + </tal:block> + </tr> +</table> Added: cpsskins/branches/jmo-perspectives/ui/screens/views.py ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/ui/screens/views.py Wed Jan 4 21:07:51 2006 @@ -0,0 +1,33 @@ +############################################################################## +# +# 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.app.zapi import getMultiAdapter +from zope.interface import implements, Interface + +from cpsskins.browser.rendering.interfaces import IViewer + +class Rendering(BrowserView): + + def renderPage(self, engine=u''): + """Render the page + """ + viewer = getMultiAdapter((self.context, self.request), IViewer) + return viewer(engine=engine) + -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins