Author: jmorliaguet Date: Thu May 25 10:38:47 2006 New Revision: 3207 Added: cpsskins/branches/paris-sprint-2006/ui/screens/common/action_pad.pt (contents, props changed) cpsskins/branches/paris-sprint-2006/ui/screens/common/configure.zcml (contents, props changed) cpsskins/branches/paris-sprint-2006/ui/screens/common/location_selector.pt (contents, props changed) cpsskins/branches/paris-sprint-2006/ui/screens/common/page_tabs.pt (contents, props changed) cpsskins/branches/paris-sprint-2006/ui/screens/common/perspective_selector.pt (contents, props changed) cpsskins/branches/paris-sprint-2006/ui/screens/common/portlet_factory.pt (contents, props changed) cpsskins/branches/paris-sprint-2006/ui/screens/common/theme_tabs.pt (contents, props changed) cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py (contents, props changed) cpsskins/branches/paris-sprint-2006/ui/screens/elementeditor/element_editor.pt (contents, props changed) cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/io.pt (contents, props changed) cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/io_section.pt (contents, props changed) cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/negotiation.pt (contents, props changed) cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/setting_editor.pt (contents, props changed) cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/settings.pt (contents, props changed) cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/settings_section.pt (contents, props changed) Removed: cpsskins/branches/paris-sprint-2006/ui/panels/ Modified: cpsskins/branches/paris-sprint-2006/ui/configure.zcml cpsskins/branches/paris-sprint-2006/ui/screens/configure.zcml cpsskins/branches/paris-sprint-2006/ui/screens/elementeditor/configure.zcml cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/configure.zcml
Log: - reorganized skins, removed the 'panels' package Modified: cpsskins/branches/paris-sprint-2006/ui/configure.zcml ============================================================================== --- cpsskins/branches/paris-sprint-2006/ui/configure.zcml (original) +++ cpsskins/branches/paris-sprint-2006/ui/configure.zcml Thu May 25 10:38:47 2006 @@ -9,9 +9,7 @@ <include package=".authoring" /> - <!-- screens, panels, etc. --> - - <include package=".panels" /> + <!-- screens --> <include package=".screens" /> Added: cpsskins/branches/paris-sprint-2006/ui/screens/common/action_pad.pt ============================================================================== --- (empty file) +++ cpsskins/branches/paris-sprint-2006/ui/screens/common/action_pad.pt Thu May 25 10:38:47 2006 @@ -0,0 +1,16 @@ +<div class="actionPad"> + + <ins class="model" cite="@@getHint?msgid=hint-site-manager"></ins> + <a href="javascript:CPSSkins.getControllerById('main-editor-perspectives').switchTo('site-manager')">Site manager</a> + + <ins class="model" cite="@@getHint?msgid=hint-page-designer"></ins> + <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 href="javascript:CPSSkins.getControllerById('main-editor-perspectives').switchTo('content-author')">Content author</a> + + <!-- tooltip --> + <ins class="view" cite="@@getView?id=tooltip"></ins> + <ins class="controller" cite="@@getController?id=show-hide-tooltip"></ins> + +</div> Added: cpsskins/branches/paris-sprint-2006/ui/screens/common/configure.zcml ============================================================================== --- (empty file) +++ cpsskins/branches/paris-sprint-2006/ui/screens/common/configure.zcml Thu May 25 10:38:47 2006 @@ -0,0 +1,55 @@ +<configure + xmlns="http://namespaces.zope.org/browser" + xmlns:zope="http://namespaces.zope.org/zope"> + + <pages + for="*" + layer="cpsskins.browser.skin.cpsskins" + permission="zope.ManageContent"> + + <page + name="actionPad.html" + template="action_pad.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="*" + layer="cpsskins.browser.skin.cpsskins" + permission="zope.ManageContent" + class=".views.Rendering"> + + <page + name="renderPage.html" + attribute="renderPage" + /> + + </pages> + +</configure> Added: cpsskins/branches/paris-sprint-2006/ui/screens/common/location_selector.pt ============================================================================== --- (empty file) +++ cpsskins/branches/paris-sprint-2006/ui/screens/common/location_selector.pt Thu May 25 10:38:47 2006 @@ -0,0 +1,3 @@ + +<div class="locationSelector">Choose location: /.../.../</div> + Added: cpsskins/branches/paris-sprint-2006/ui/screens/common/page_tabs.pt ============================================================================== --- (empty file) +++ cpsskins/branches/paris-sprint-2006/ui/screens/common/page_tabs.pt Thu May 25 10:38:47 2006 @@ -0,0 +1,14 @@ +<ul class="pageTabs" + tal:define="tmutil context/@@getThemeManager; + negotiation nocall:context/@@negotiation; + effective_theme negotiation/getTheme; + effective_page negotiation/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 tal:content="python: page.title or 'No title'" + tal:attributes="href string:@@setWorkPage?name=${page/name}" /></li> + </tal:block> + <li><a href="./@@addPage">+</a></li> +</ul> Added: cpsskins/branches/paris-sprint-2006/ui/screens/common/perspective_selector.pt ============================================================================== --- (empty file) +++ cpsskins/branches/paris-sprint-2006/ui/screens/common/perspective_selector.pt Thu May 25 10:38:47 2006 @@ -0,0 +1,15 @@ +<form class="perspective" title="Perspective selector" i18n:attributes="title" + action="@@setPerspective" method="post" + tal:define="tmutil context/@@getThemeManager; + perspectives tmutil/listPerspectives; + current context/@@negotiation/getPerspective"> + <select 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> + <button type="submit">OK</button> +</form> Added: cpsskins/branches/paris-sprint-2006/ui/screens/common/portlet_factory.pt ============================================================================== --- (empty file) +++ cpsskins/branches/paris-sprint-2006/ui/screens/common/portlet_factory.pt Thu May 25 10:38:47 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:++resource++${portlet/icon}" /></td> + </tal:block> + </tr> +</table> Added: cpsskins/branches/paris-sprint-2006/ui/screens/common/theme_tabs.pt ============================================================================== --- (empty file) +++ cpsskins/branches/paris-sprint-2006/ui/screens/common/theme_tabs.pt Thu May 25 10:38:47 2006 @@ -0,0 +1,30 @@ +<table class="topTabs" cellpadding="0" cellspacing="0" border="0" summary="" + tal:define="tmutil context/@@getThemeManager; + negotiation nocall:context/@@negotiation; + effective_theme negotiation/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 alt="" width="5" height="5" src="++resource++ltab.png" /> + </td> + <td tal:attributes="class python: selected and 'tabselected' or 'tab'"> + <a tal:content="python: theme.title or 'No title'" + tal:attributes="href string:@@setWorkTheme?name=${theme/name}" /> + </td> + <td tal:attributes="class python: selected and 'rtabselected' or 'rtab'"> + <img alt="" width="5" height="5" src="++resource++rtab.png" /> + </td> + <td class="separator"></td> + </tal:block> + </tal:block> + <td class="ltab"> + <img alt="" width="5" height="5" src="++resource++ltab.png" /> + </td> + <td class="tab" style="width:40px"><a href="./@@addTheme">+</a></td> + <td class="rtab"> + <img alt="" width="5" height="5" src="++resource++rtab.png" /> + </td> + </tr> +</table> Added: cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py ============================================================================== --- (empty file) +++ cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py Thu May 25 10:38:47 2006 @@ -0,0 +1,44 @@ +############################################################################## +# +# 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" + +from zope.app.zapi import getMultiAdapter +from zope.interface import implements, Interface + +from cpsskins.browser.negotiation.interfaces import INegotiation +from cpsskins.browser.rendering.interfaces import IViewer +from cpsskins.utils import getThemeManager + +class Rendering: + """Page rendering view + """ + + def __init__(self, context, request): + self.context = context + self.request = request + + def renderPage(self, engine=u''): + """Render the page + """ + negotiation = getMultiAdapter((self.context, self.request), + INegotiation, 'negotiation') + theme_obj = negotiation.getTheme() + page = theme_obj.getDefaultPage() + viewer = getMultiAdapter((page, self.request), IViewer) + return viewer(engine=engine) + Modified: cpsskins/branches/paris-sprint-2006/ui/screens/configure.zcml ============================================================================== --- cpsskins/branches/paris-sprint-2006/ui/screens/configure.zcml (original) +++ cpsskins/branches/paris-sprint-2006/ui/screens/configure.zcml Thu May 25 10:38:47 2006 @@ -10,6 +10,8 @@ template="editor.pt" /> + <include package=".common" /> + <!-- site manager --> <include package=".sitemanager" /> Modified: cpsskins/branches/paris-sprint-2006/ui/screens/elementeditor/configure.zcml ============================================================================== --- cpsskins/branches/paris-sprint-2006/ui/screens/elementeditor/configure.zcml (original) +++ cpsskins/branches/paris-sprint-2006/ui/screens/elementeditor/configure.zcml Thu May 25 10:38:47 2006 @@ -21,4 +21,16 @@ layer="cpsskins.browser.skin.cpsskins" /> + <pages + for="*" + layer="cpsskins.browser.skin.cpsskins" + permission="zope.ManageContent"> + + <page + name="element-editor.html" + template="element_editor.pt" + /> + + </pages> + </configure> Added: cpsskins/branches/paris-sprint-2006/ui/screens/elementeditor/element_editor.pt ============================================================================== --- (empty file) +++ cpsskins/branches/paris-sprint-2006/ui/screens/elementeditor/element_editor.pt Thu May 25 10:38:47 2006 @@ -0,0 +1,81 @@ +<tal:block i18n:domain="cpsskins" define=" + id request/form/id|nothing; + mode request/form/mode|string:edit; + tmutil context/@@getThemeManager; + element python: tmutil.getElementById(id); + info element/@@editpanel/getInfo; + display nocall:info/display; + display_id display/identifier; + setting nocall:info/setting; + edited nocall:info/edited; + edited_type edited/type:resourcename; + format request/form/format|nothing; + setting_info edited/@@getSettingsInfo"> + + <a href="javascript:CPSSkins.getControllerById('main-editor-perspectives').goBack()">< back to the editor</a> + + <h1 class="title" tal:define="title element/title"> + <tal:block condition="not:title" i18n:translate="" + content="info/element/name" /> + <tal:block condition="title" content="title" /> + </h1> + + <p class="description" tal:content="description" + tal:define="description element/description|string:No description" /> + + <div class="tabs"> + <a i18n:translate="" tal:content="info/element/name" tal:attributes=" + href string:javascript:CPSSkins.getModelById('element-editor').updateData({form: {id: '$id', mode: 'edit'}})" /> + + <a i18n:translate="" tal:content="display/type:name" tal:attributes=" + href string:javascript:CPSSkins.getModelById('element-editor').updateData({form: {id: $id, tab: '${display/type:name}'}})" /> + + <a i18n:translate="" tal:repeat="format info/formats" tal:attributes=" + href string:javascript:CPSSkins.getModelById('element-editor').updateData({script: '/++skin++cpsskins/++resource++style_editor.js', form: {id: $id, display: $display_id, format: ${format/id}, uri: '${format/uri}', tab: '${format/name}'}})" + tal:content="format/name" /> + + <a i18n:translate="" tal:attributes=" + href string:javascript:CPSSkins.getModelById('element-editor').updateData({form: {id: '$id', mode: 'preview'}})">Preview</a> + </div> + + <div class="form"> + <tal:block condition="python: mode == 'edit' and setting is None" + content="structure edited/@@edit.html" /> + + <tal:block condition="python: mode == 'preview'" + content="structure info/preview" /> + + </div> + + <div tal:define="tab request/form/tab|nothing" + tal:condition="tab"> + <a class="inlineTabs" tal:condition="not:setting" + tal:attributes="href string:javascript:createSetting('$tab', '${info/uri}')">create a setting</a> + </div> + + <!-- + <div tal:condition="not:setting"> + <div>Create a setting</div> + <form enctype="multipart/form-data" method="post" + tal:attributes="action string:${edited/@@absolute_url}/@@createSetting"> + <p> + <label for="title">Title</label> + <input id="title" type="text" name="title" /> + <input type="submit" name="UPDATE_SUBMIT" + i18n:translate="create-button" value="Create" /> + </p> + </form> + </div> + + <tal:block condition="python: edited_type in setting_info"> + <ul> + <li tal:repeat="setting setting_info/?edited_type"> + <a href="" tal:content="setting/name" + tal:attributes="href string:${display/@@absolute_url}/@@useSettingAsFormat?uri=${setting/uri}" /> + </li> + </ul> + </tal:block> + + --> + +</tal:block> Modified: cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/configure.zcml ============================================================================== --- cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/configure.zcml (original) +++ cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/configure.zcml Thu May 25 10:38:47 2006 @@ -94,4 +94,42 @@ </pages> + <!-- Panels --> + <pages + for="*" + layer="cpsskins.browser.skin.cpsskins" + permission="zope.ManageContent"> + + <page + name="settings.html" + template="settings.pt" + /> + + <page + name="setting-editor.html" + template="setting_editor.pt" + /> + + <page + name="settings-section.html" + template="settings_section.pt" + /> + + <page + name="negotiation.html" + template="negotiation.pt" + /> + + <page + name="io.html" + template="io.pt" + /> + + <page + name="io-section.html" + template="io_section.pt" + /> + + </pages> + </configure> Added: cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/io.pt ============================================================================== --- (empty file) +++ cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/io.pt Thu May 25 10:38:47 2006 @@ -0,0 +1,26 @@ + +<table class="panel" cellpadding="0" cellspacing="0" + tal:define="info context/@@getSettingsInfo"> + <tr> + <td class="icon"> + <img src="++resource++io-48.png" /> + </td> + <td class="section"> + <div class="sections"> + <ul class="items"> + <li tal:repeat="section python: ['export', 'import', 'snapshots']"> + <a class="section" + tal:attributes="href string:javascript:CPSSkins.getModelById('io-section').setData({'form': {'section': '$section'}})" + tal:content="section">SECTION</a> + </li> + </ul> + <br style="clear:both"/> + </div> + </td> + <td class="subsection"> + <ins class="model" cite="@@getModel?id=io-section"></ins> + <ins class="view" cite="@@getView?id=io-section"></ins> + <ins class="controller" cite="@@getController?id=io-actions"></ins> + </td> + </tr> +</table> Added: cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/io_section.pt ============================================================================== --- (empty file) +++ cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/io_section.pt Thu May 25 10:38:47 2006 @@ -0,0 +1,62 @@ +<div class="sections" + tal:define="section request/form/section|nothing; + snapshot request/form/snapshot|nothing"> + <div tal:condition="section"> + + <div tal:condition="python: section == 'export'"> + <h3>Export site</h3> + <a href="@@createSnapshot">Create a snapshot</a> + + <tal:block condition="snapshot"> + <h4>Download snapshot</h4> + <a tal:attributes="href string:@@downloadSnapshot?filename=$snapshot" + tal:content="snapshot" /> + </tal:block> + </div> + + <div tal:condition="python: section == 'import'"> + <h3>Import site</h3> + + <h4>Import a site configuration</h4> + <form action="@@importSite" method="post" enctype="multipart/form-data"> + <p> + <input type="file" name="file" /> + <button type="submit">Upload</button> + </p> + </form> + + <h4>Switch to another configuration</h4> + <form action="@@importSnapshot" method="post" + enctype="multipart/form-data"> + <select name="filename"> + <option tal:repeat="snapshot context/@@listSnapshots" + tal:content="snapshot" /> + </select> + <button type="submit">Load</button> + </form> + </div> + + <div tal:condition="python: section == 'snapshots'"> + <h3>Snapshots</h3> + + <h4>Upload a snapshot</h4> + <form action="@@uploadSnapshot" method="post" + enctype="multipart/form-data"> + <p> + <input type="file" name="file" /> + <button type="submit">Upload</button> + </p> + </form> + + <ul> + <li tal:repeat="snapshot context/@@listSnapshots"> + <a tal:attributes="href string:@@downloadSnapshot?filename=$snapshot" + tal:content="snapshot" /> + </li> + </ul> + </div> + + </div> + <div tal:condition="not:section"> + </div> +</div> Added: cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/negotiation.pt ============================================================================== --- (empty file) +++ cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/negotiation.pt Thu May 25 10:38:47 2006 @@ -0,0 +1,17 @@ +<table class="panel" cellpadding="0" cellspacing="0" + tal:define="info context/@@getSettingsInfo"> + <tr> + <td class="icon"> + <img src="++resource++negotiation-48.png" width="48" height="48" /> + </td> + <td class="section"> + <div class="sections"> + <span class="description">local themes, perspectives ...</span> + + </div> + </td> + <td class="subsection"> + </td> + </tr> + +</table> Added: cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/setting_editor.pt ============================================================================== --- (empty file) +++ cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/setting_editor.pt Thu May 25 10:38:47 2006 @@ -0,0 +1,12 @@ +<tal:block define="uri request/form/uri|nothing"> + <a class="back" + href="javascript:CPSSkins.getControllerById('site-manager-perspectives').goBack()">Back</a> + + <h3>Setting editor</h3> + + <tal:block define="setting view/@@getSetting"> + <div class="form" tal:content="structure setting/@@edit.html" /> + </tal:block> + +</tal:block> + Added: cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/settings.pt ============================================================================== --- (empty file) +++ cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/settings.pt Thu May 25 10:38:47 2006 @@ -0,0 +1,29 @@ +<table i18n:domain="cpsskins" class="panel" cellpadding="0" cellspacing="0" + tal:define="info context/@@getSettingsInfo"> + <tr class="header"> + <th style="width: 50px"></th> + <th style="width: 150px">Category</th> + <th>Available settings</th> + </tr> + <tr> + <td class="icon"> + <img src="++resource++settings-48.png" width="48" height="48"/> + </td> + <td class="section"> + <div class="sections"> + <ul class="items"> + <li tal:repeat="section python: ['perspective', 'format-widget', 'format-style', 'field-color', 'field-image']"> + <a i18n:translate="" + tal:attributes="href string:javascript:CPSSkins.getModelById('settings-section').setData({'form': {'section': '$section'}})" + tal:content="section">SECTION</a></li> + </ul> + <br style="clear:both"/> + </div> + </td> + <td class="subsection"> + <ins class="model" cite="@@getModel?id=settings-section"></ins> + <ins class="view" cite="@@getView?id=settings-section"></ins> + <ins class="controller" cite="@@getController?id=settings-actions"></ins> + </td> + </tr> +</table> Added: cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/settings_section.pt ============================================================================== --- (empty file) +++ cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/settings_section.pt Thu May 25 10:38:47 2006 @@ -0,0 +1,33 @@ +<div class="sections" i18n:domain="cpsskins" + tal:define="section request/form/section|nothing"> + <form tal:condition="section" action="@@createSetting"> + <ul style="height: 120px; overflow: auto;" class="items" + tal:define="setting_info context/@@getSettingsInfo"> + <li tal:condition="request/form/create|nothing"> + <input type="text" class="text" name="title" /> + <input type="hidden" name="uri" + tal:attributes="value request/form/uri" /> + <input type="submit" class="submit" value="create" /> + </li> + <li tal:repeat="info setting_info/?section|nothing"> + <span tal:content="info/setting/title" /> + <tal:block define="name info/name; + uri info/uri; + readonly info/readonly; + custom info/custom"> + <a tal:attributes="href string:@@customizeSetting?uri=$uri" + tal:condition="python: not custom and readonly">[customize]</a> + <a tal:attributes="href string:@@removeSetting?uri=$uri" + tal:condition="python: not custom and not readonly">[remove]</a> + <a tal:attributes="href string:@@decustomizeSetting?uri=$uri" + tal:condition="custom">[remove customization]</a> + <a href="javascript:void(0)" + tal:attributes="onclick string:editSetting('$uri')" + tal:condition="not:readonly">[edit]</a> + </tal:block> + </li> + </ul> + </form> + <div tal:condition="not:section"> + </div> +</div> -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins