Author: jmorliaguet Date: Fri Nov 18 16:55:55 2005 New Revision: 1882 Added: cpsskins/branches/jmo-perspectives/engines/authoring/icons/associations-48.png (contents, props changed) Modified: cpsskins/branches/jmo-perspectives/configuration/perspectives/metaconfigure.py cpsskins/branches/jmo-perspectives/configuration/perspectives/perspective.py cpsskins/branches/jmo-perspectives/engines/authoring/icons/configure.zcml cpsskins/branches/jmo-perspectives/engines/sitedesigner/browser.py cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.css cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.pt cpsskins/branches/jmo-perspectives/interfaces.py Log:
- saving work (site designer screen) Modified: cpsskins/branches/jmo-perspectives/configuration/perspectives/metaconfigure.py ============================================================================== --- cpsskins/branches/jmo-perspectives/configuration/perspectives/metaconfigure.py (original) +++ cpsskins/branches/jmo-perspectives/configuration/perspectives/metaconfigure.py Fri Nov 18 16:55:55 2005 @@ -33,6 +33,8 @@ raise ConfigurationError( "The '%s' perspective has already been registered." % name) + # register as a global setting resource = Perspective(name=name, title=title) - provideUtility(configuration.Perspective(title=title, resource=resource), - configuration.IPerspective, name) + setting = configuration.Perspective(title=title, readonly=True, + resource=resource) + provideUtility(setting, configuration.IPerspective, name) Modified: cpsskins/branches/jmo-perspectives/configuration/perspectives/perspective.py ============================================================================== --- cpsskins/branches/jmo-perspectives/configuration/perspectives/perspective.py (original) +++ cpsskins/branches/jmo-perspectives/configuration/perspectives/perspective.py Fri Nov 18 16:55:55 2005 @@ -35,8 +35,9 @@ """ implements(IPerspective) - def __init__(self, title=u'', resource=None): + def __init__(self, title=u'', readonly=False, resource=None): self.title = title + self.readonly = readonly self.resource = resource class Resource(object): Added: cpsskins/branches/jmo-perspectives/engines/authoring/icons/associations-48.png ============================================================================== Binary file. No diff available. Modified: cpsskins/branches/jmo-perspectives/engines/authoring/icons/configure.zcml ============================================================================== --- cpsskins/branches/jmo-perspectives/engines/authoring/icons/configure.zcml (original) +++ cpsskins/branches/jmo-perspectives/engines/authoring/icons/configure.zcml Fri Nov 18 16:55:55 2005 @@ -51,7 +51,7 @@ layer="cpsskins" /> <resource - name="site-structure-48.png" file="site-structure-48.png" + name="associations-48.png" file="associations-48.png" layer="cpsskins" /> <resource Modified: cpsskins/branches/jmo-perspectives/engines/sitedesigner/browser.py ============================================================================== --- cpsskins/branches/jmo-perspectives/engines/sitedesigner/browser.py (original) +++ cpsskins/branches/jmo-perspectives/engines/sitedesigner/browser.py Fri Nov 18 16:55:55 2005 @@ -18,7 +18,7 @@ __docformat__ = "reStructuredText" from zope.app.publisher.browser import BrowserView -from zope.component import getUtilitiesFor +from zope.component import getUtilitiesFor, providedBy from zope.app.interface import queryType from cpsskins.interfaces import ISettings, ISetting, ISettingType @@ -30,6 +30,10 @@ """ info = {} for name, setting in getUtilitiesFor(ISetting): - type_name = queryType(setting, ISettingType).__identifier__ + type_name = queryType(setting, ISettingType).__name__ info.setdefault(type_name, []).append(setting) return info + + def customize(self, name=u''): + """ """ + Modified: cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.css ============================================================================== --- cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.css (original) +++ cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.css Fri Nov 18 16:55:55 2005 @@ -19,7 +19,7 @@ font-weight: normal; color: #000; padding: 1px 2px 1px 8px; - margin: 0.8em 0 1em 8px; + margin: 0.8em 8px 1em 0; border-bottom: 1px solid #eee; background-color: #efc; } @@ -32,7 +32,7 @@ } .sections { - padding: 0em 0em 1.5em 0.5em; + padding: 0.5em 0em 1em 0.5em; } .sections .section { @@ -40,12 +40,41 @@ } .icon { - padding-right: 1.5em; + padding-right: 1em; padding-left: 0.5em; float: left; } +a, a:visited, a:hover { + color: #204a87; +} + ul { + margin: 0; + padding-left: 2em; + list-style: square; +} + +.sections ul { list-style: none; } +li { +} + + +table.panel { + width: 100%; +} + +table.panel td { + vertical-align:top; +} + +table.panel td.first { + width: 25%; +} + +table.panel td.second { + width: 75%; +} Modified: cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.pt ============================================================================== --- cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.pt (original) +++ cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.pt Fri Nov 18 16:55:55 2005 @@ -1,5 +1,6 @@ <tal:block define="engine string:site-designer; - current_type context/@@get|nothing"> + current_section context/@@getCurrentSection|nothing; + current_type context/@@getSettingType|string:IPerspective"> <metal:block use-macro="context/@@authoring_macros/editor"> @@ -19,30 +20,56 @@ <h1>Site designer</h1> - <h2>Settings</h2> - <span class="description">Perspectives, styles, images, ...</span> - <div class="sections"> - <img class="icon" - src="/++skin++cpsskins/@@/++resource++settings-48.png" /> - <tal:block define="info context/@@getSettingInfo" - repeat="type info"> - <a class="section" href="" tal:content="type" i18n:translate="" /> - <div tal:repeat="setting info/?type" - tal:content="setting/title" /> - </tal:block> - <br style="clear:both"/> - </div> + <table class="panel" cellpadding="0" cellspacing="0"> + <tr> + <td class="first"> + + <h2>Settings</h2> + + <div class="sections"> + <img class="icon" + src="/++skin++cpsskins/@@/++resource++settings-48.png" /> + <ul> + <li> + <a class="section" href="@@setSettingType?type=IPerspective" + tal:content="string:Perspectives" i18n:translate="" /> + </li> + <li> + <a class="section" href="@@setSettingType?type=IStyle" + tal:content="string:Styles" i18n:translate="" /> + </li> + <li> + <a class="section" href="@@setSettingType?type=IAccessKey" + tal:content="string:Access keys" i18n:translate="" /> + </li> + </ul> + <br style="clear:both"/> + </div> + + </td> + <td class="second"> + + <h2 tal:content="current_type" /> + + <ul tal:define="setting_info context/@@getSettingInfo"> + <li tal:repeat="info setting_info/?current_type"> + <tal:block content="info/title" /> + <a href="" tal:condition="info/readonly">[customize]</a> + </li> + </ul> + + </td> + </tr> + </table> - <h2>Site structure</h2> - <span class="description">Local themes, perspectives, ...</span> + <h2>Associations</h2> <div class="sections"> <img class="icon" - src="/++skin++cpsskins/@@/++resource++site-structure-48.png" /> + src="/++skin++cpsskins/@@/++resource++associations-48.png" /> <br style="clear:both"/> </div> <h2>Management</h2> - <span class="description">Import, export ...</span> <div class="sections"> <img class="icon" src="/++skin++cpsskins/@@/++resource++management-48.png" /> @@ -50,11 +77,8 @@ </div> </div> - </metal:block> - <metal:block fill-slot="footer"> - </metal:block> </metal:block> </tal:block> Modified: cpsskins/branches/jmo-perspectives/interfaces.py ============================================================================== --- cpsskins/branches/jmo-perspectives/interfaces.py (original) +++ cpsskins/branches/jmo-perspectives/interfaces.py Fri Nov 18 16:55:55 2005 @@ -21,7 +21,7 @@ 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 zope.schema import Bool, TextLine from cpsskins.elements.interfaces import IElement, IPortlet, IDisplay, IFormat @@ -106,5 +106,10 @@ description=u"The setting's title", ) + readonly = Bool( + title=u"Read-only", + description=u"The setting is read-only", + ) + resource = Attribute("The resource.") -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins