[Checkins] SVN: z3ext.cssregistry/trunk/ z3ext.controlpanel configlet moved to z3ext.ui.cssregistry package
Nikolay Kim
fafhrd at datacom.kz
Mon Nov 24 14:38:47 EST 2008
Log message for revision 93326:
z3ext.controlpanel configlet moved to z3ext.ui.cssregistry package
Changed:
U z3ext.cssregistry/trunk/CHANGES.txt
U z3ext.cssregistry/trunk/setup.py
D z3ext.cssregistry/trunk/src/z3ext/cssregistry/configlet.py
D z3ext.cssregistry/trunk/src/z3ext/cssregistry/configlet.zcml
D z3ext.cssregistry/trunk/src/z3ext/cssregistry/configletview.pt
D z3ext.cssregistry/trunk/src/z3ext/cssregistry/configletview.py
U z3ext.cssregistry/trunk/src/z3ext/cssregistry/configure.zcml
U z3ext.cssregistry/trunk/src/z3ext/cssregistry/interfaces.py
D z3ext.cssregistry/trunk/src/z3ext/cssregistry/locales/
-=-
Modified: z3ext.cssregistry/trunk/CHANGES.txt
===================================================================
--- z3ext.cssregistry/trunk/CHANGES.txt 2008-11-24 19:29:49 UTC (rev 93325)
+++ z3ext.cssregistry/trunk/CHANGES.txt 2008-11-24 19:38:47 UTC (rev 93326)
@@ -2,6 +2,12 @@
CHANGES
=======
+1.4.0 (2008-11-??)
+------------------
+
+- z3ext.controlpanel configlet moved to z3ext.ui.cssregistry package
+
+
1.3.2 (2008-11-24)
------------------
Modified: z3ext.cssregistry/trunk/setup.py
===================================================================
--- z3ext.cssregistry/trunk/setup.py 2008-11-24 19:29:49 UTC (rev 93325)
+++ z3ext.cssregistry/trunk/setup.py 2008-11-24 19:38:47 UTC (rev 93326)
@@ -21,7 +21,7 @@
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
-version = '1.3.3dev'
+version = '1.4.0dev'
setup(name='z3ext.cssregistry',
@@ -57,7 +57,6 @@
'zope.proxy',
'zope.interface',
'zope.component',
- 'zope.i18n',
'zope.i18nmessageid',
'zope.configuration',
'z3c.autoinclude',
@@ -67,11 +66,6 @@
'zope.testing',
'zope.publisher',
'zope.traversing',
- 'zope.securitypolicy',
- 'zope.app.zcmlfiles',
- 'z3ext.layout',
- 'z3ext.controlpanel',
- 'z3ext.statusmessage',
]),
include_package_data = True,
zip_safe = False,
Deleted: z3ext.cssregistry/trunk/src/z3ext/cssregistry/configlet.py
===================================================================
--- z3ext.cssregistry/trunk/src/z3ext/cssregistry/configlet.py 2008-11-24 19:29:49 UTC (rev 93325)
+++ z3ext.cssregistry/trunk/src/z3ext/cssregistry/configlet.py 2008-11-24 19:38:47 UTC (rev 93326)
@@ -1,46 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2008 Zope Corporation 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$
-"""
-from BTrees.OOBTree import OOBTree
-from zope import interface, component
-from zope.component import getUtility
-
-from registry import CSSRegistry, registries
-from interfaces import ICSSRegistryConfiglet
-from interfaces import ICSSRegistry, ICSSRegistryLayer
-
-
-class CSSRegistryConfiglet(CSSRegistry):
- """ css registry configlet """
- interface.implements(ICSSRegistryConfiglet)
-
- @property
- def properties(self):
- properties = self.data.get('properties')
- if properties is None:
- properties = OOBTree()
- self.data['properties'] = properties
-
- return properties
-
-
- at interface.implementer(ICSSRegistry)
- at component.adapter(ICSSRegistryLayer, interface.Interface)
-def portalCssRegistry(layer, request):
- css = getUtility(ICSSRegistryConfiglet)
- if css.enabled:
- return css
Deleted: z3ext.cssregistry/trunk/src/z3ext/cssregistry/configlet.zcml
===================================================================
--- z3ext.cssregistry/trunk/src/z3ext/cssregistry/configlet.zcml 2008-11-24 19:29:49 UTC (rev 93325)
+++ z3ext.cssregistry/trunk/src/z3ext/cssregistry/configlet.zcml 2008-11-24 19:38:47 UTC (rev 93326)
@@ -1,38 +0,0 @@
-<configure
- xmlns="http://namespaces.zope.org/zope"
- xmlns:zcml="http://namespaces.zope.org/zcml"
- xmlns:z3ext="http://namespaces.zope.org/z3ext"
- xmlns:browser="http://namespaces.zope.org/browser"
- zcml:condition="installed z3ext.controlpanel"
- i18n_domain="z3ext.cssregistry">
-
- <include package="z3ext.controlpanel" file="meta.zcml" />
- <include package="z3ext.controlpanel" />
-
- <z3ext:configlet
- name="ui.cssregistry"
- title="CSS Properties"
- description="CSS properties registry configuration."
- schema=".interfaces.ICSSRegistryConfiglet"
- class=".configlet.CSSRegistryConfiglet" />
-
- <adapter factory=".configlet.portalCssRegistry" />
-
- <class class=".configlet.CSSRegistryConfiglet">
- <require
- permission="zope.Public"
- attributes="name title"
- interface="zope.interface.common.mapping.IEnumerableMapping" />
- <require
- permission="z3ext.Configure"
- interface="zope.interface.common.mapping.IWriteMapping" />
- </class>
-
- <browser:page
- name="index.html"
- for=".interfaces.ICSSRegistryConfiglet"
- template="configletview.pt"
- class=".configletview.ViewRegistry"
- permission="z3ext.Configure" />
-
-</configure>
Deleted: z3ext.cssregistry/trunk/src/z3ext/cssregistry/configletview.pt
===================================================================
--- z3ext.cssregistry/trunk/src/z3ext/cssregistry/configletview.pt 2008-11-24 19:29:49 UTC (rev 93325)
+++ z3ext.cssregistry/trunk/src/z3ext/cssregistry/configletview.pt 2008-11-24 19:38:47 UTC (rev 93326)
@@ -1,102 +0,0 @@
-<form method="post" action="@@index.html" class="z-form"
- i18n:domain="z3ext.cssregistry">
- <div class="z-topframe" tal:define="props context/keys">
- <h1 tal:content="context/__title__">Portal CSS properties</h1>
- <div class="z-page-description" tal:content="context/__description__"></div>
-
- <div class="z-form-field">
- <label i18n:translate="">Status</label>
- <div>
- <select name="form.enabled">
- <option value="yes"
- tal:attributes="selected context/enabled" i18n:translate="">
- Enabled
- </option>
- <option value="no"
- tal:attributes="selected not:context/enabled" i18n:translate="">
- Disabled
- </option>
- </select>
- </div>
- </div>
- <br />
-
- <tal:block tal:condition="props">
- <h2 i18n:translate="">Properties</h2>
-
- <table class="z-content-listing">
- <tr>
- <th> </th>
- <th i18n:translate="">Property</th>
- <th i18n:translate="">Value</th>
- </tr>
- <tr tal:repeat="prop props"
- tal:attributes="class python:repeat['prop'].even() and 'even' or 'odd'">
- <td><input type="checkbox" name="property:list"
- tal:attributes="value prop" /></td>
- <td tal:content="python:context[prop].title or prop"></td>
- <td><input type="text"
- tal:attributes="name string:prop-$prop;
- value python:context[prop].value" /></td>
- </tr>
- </table>
- <div class="z-form-controls">
- <input type="submit" class="z-form-savebutton"
- name="form.save" value="Save" i18n:attributes="value" />
- <input type="submit" class="z-form-removebutton"
- name="form.remove" value="Remove" i18n:attributes="value" />
- </div>
- </tal:block>
-
- <tal:block tal:condition="not:props" i18n:translate="">
- There are no any defined properties.
- </tal:block>
- </div>
-
- <div class="z-frame">
- <h2 i18n:translate="">Add property</h2>
-
- <div class="z-form-field">
- <label i18n:translate="">Property name</label>
-
- <div>
- <input type="text" name="form.add.name" />
- </div>
- </div>
-
- <div class="z-form-field">
- <label i18n:translate="">Value</label>
-
- <div>
- <input type="text" name="form.add.value" />
- </div>
- </div>
-
- <div class="z-form-controls">
- <input type="submit" class="z-form-addbutton"
- name="form.add" value="Add" i18n:attributes="value" />
- </div>
- </div>
-
- <div class="z-frame"
- tal:define="regs view/listRegistries" tal:condition="regs">
- <h2 i18n:translate="">Copy/Update properties from existent registries</h2>
- <div> </div>
-
- <div class="z-form-field">
- <label i18n:translate="">Registry</label>
- <div></div>
- <select name="registry:int">
- <option tal:repeat="reg regs"
- tal:attributes="value python:repeat['reg'].index()"
- tal:content="string:${reg/name} (${reg/layer})"></option>
- </select>
- </div>
- <div class="z-form-controls">
- <input type="submit" class="z-form-button" name="form.copy"
- value="Copy" i18n:attributes="value" />
- <!--input type="submit" class="z-form-standalonebtn" name="form.update"
- value="Update" i18n:attributes="value" /-->
- </div>
- </div>
-</form>
Deleted: z3ext.cssregistry/trunk/src/z3ext/cssregistry/configletview.py
===================================================================
--- z3ext.cssregistry/trunk/src/z3ext/cssregistry/configletview.py 2008-11-24 19:29:49 UTC (rev 93325)
+++ z3ext.cssregistry/trunk/src/z3ext/cssregistry/configletview.py 2008-11-24 19:38:47 UTC (rev 93326)
@@ -1,91 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 Zope Corporation 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.
-#
-##############################################################################
-""" `browser:cssregistry` directive
-
-$Id$
-"""
-from zope import interface
-from zope.security.proxy import getObject
-
-from z3ext.layout.pagelet import BrowserPagelet
-from z3ext.statusmessage.interfaces import IStatusMessage
-
-from z3ext.cssregistry.property import Property, CSSProperty
-from z3ext.cssregistry.registry import registries
-from z3ext.cssregistry.interfaces import _, ICSSRegistry
-
-
-class ViewRegistry(BrowserPagelet):
-
- def listRegistries(self):
- regs = []
- for key, registry in registries.items():
- name, layer = key
-
- regs.append({'name': name or _('Without name'),
- 'layer': '%s.%s'%(layer.__module__, layer.__name__),
- 'registry': registry})
-
- return regs
-
- def update(self):
- request = self.request
-
- if 'form.copy' in request:
- reg = request.get('registry', None)
-
- registry = self.listRegistries()[int(reg)]['registry']
-
- for prop, value in registry.items():
- self.context[prop] = CSSProperty(
- value.name, value.value,
- value.title, value.description, value.type)
-
- IStatusMessage(request).add(
- _(u"CSS Registry has been copied."))
-
- if 'form.add' in request:
- name = request.get('form.add.name', '').strip()
- if not name:
- IStatusMessage(request).add(
- _(u"Can't add property with emtpy name."), 'error')
- else:
- self.context[name] = CSSProperty(
- name, request.get('form.add.value', ''))
-
- if 'form.remove' in request:
- for prop in request.get('property', ()):
- del self.context[prop]
- IStatusMessage(request).add(_(u"Properties have been removed."))
-
- if 'form.save' in request:
- for key, value in request.form.items():
- if key.startswith('prop-'):
- key = key[5:]
- old = self.context[key]
- property = CSSProperty(
- old.name, value,
- old.title, old.description, old.type)
-
- self.context[key] = property
-
- if request.get('form.enabled') == 'yes':
- self.context.enabled = True
- else:
- self.context.enabled = False
-
- IStatusMessage(request).add(_(u"Properties have been changed."))
-
- return self.index()
-
Modified: z3ext.cssregistry/trunk/src/z3ext/cssregistry/configure.zcml
===================================================================
--- z3ext.cssregistry/trunk/src/z3ext/cssregistry/configure.zcml 2008-11-24 19:29:49 UTC (rev 93325)
+++ z3ext.cssregistry/trunk/src/z3ext/cssregistry/configure.zcml 2008-11-24 19:38:47 UTC (rev 93326)
@@ -1,7 +1,5 @@
<configure
xmlns="http://namespaces.zope.org/zope"
- xmlns:i18n="http://namespaces.zope.org/i18n"
- xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="z3ext.cssregistry">
<includeDependencies package="." />
@@ -42,9 +40,9 @@
<property name="contentBackgroundColor" value="white" />
<property name="fontFamily"
- value="Verdana, Tahoma, Helvetica, Arial, sans-serif" />
+ value="'Lucida Grande', Verdana, Tahoma, Helvetica, Sans-Serif" />
<property name="headingFontFamily"
- value="Verdana, Tahoma, Helvetica, Arial, sans-serif" />
+ value="'Lucida Grande', Verdana, Tahoma, Helvetica, Sans-Serif" />
<property name="monospaceFontFamily"
value="Monaco, 'Courier New', Courier, monospace" />
@@ -83,9 +81,4 @@
<property name="notifyBackgroundColor" value="#ffce7b" />
</browser:cssregistry>
- <include file="configlet.zcml" />
-
- <!-- translations -->
- <i18n:registerTranslations directory="locales"/>
-
</configure>
Modified: z3ext.cssregistry/trunk/src/z3ext/cssregistry/interfaces.py
===================================================================
--- z3ext.cssregistry/trunk/src/z3ext/cssregistry/interfaces.py 2008-11-24 19:29:49 UTC (rev 93325)
+++ z3ext.cssregistry/trunk/src/z3ext/cssregistry/interfaces.py 2008-11-24 19:38:47 UTC (rev 93326)
@@ -78,12 +78,3 @@
interface.implements(ICSSRegistryLayer)
Layer = Layer()
-
-
-class ICSSRegistryConfiglet(ICSSRegistry):
- """ css registry configlet """
-
- enabled = schema.Bool(
- title = _(u'Enabled'),
- default = False,
- required = True)
More information about the Checkins
mailing list