[Checkins] SVN: z3ext.preferences/tags/1.4.3/ release tag
Nikolay Kim
fafhrd at datacom.kz
Fri Dec 12 05:59:57 EST 2008
Log message for revision 93935:
release tag
Changed:
A z3ext.preferences/tags/1.4.3/
D z3ext.preferences/tags/1.4.3/CHANGES.txt
A z3ext.preferences/tags/1.4.3/CHANGES.txt
D z3ext.preferences/tags/1.4.3/bootstrap.py
A z3ext.preferences/tags/1.4.3/bootstrap.py
U z3ext.preferences/tags/1.4.3/setup.py
D z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/group.py
A z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/group.py
D z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/groupcategory.pt
A z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/groupcategory.pt
D z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/index.pt
A z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/index.pt
D z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/index.py
A z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/index.py
D z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/layoutcontent.pt
A z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/layoutcontent.pt
D z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/navigation.pt
A z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/navigation.pt
D z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/navigation.py
A z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/navigation.py
D z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/styles.css
A z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/styles.css
-=-
Deleted: z3ext.preferences/tags/1.4.3/CHANGES.txt
===================================================================
--- z3ext.preferences/trunk/CHANGES.txt 2008-12-12 02:14:57 UTC (rev 93925)
+++ z3ext.preferences/tags/1.4.3/CHANGES.txt 2008-12-12 10:59:57 UTC (rev 93935)
@@ -1,114 +0,0 @@
-=======
-CHANGES
-=======
-
-1.4.3 (2008-??-??)
-------------------
-
-- raise Unauthorized exception if unauthenticated user access preferences panel
-
-
-1.4.2 (2008-10-27)
-------------------
-
-- Show preference category if it has editable fields
-
-
-1.4.1 (2008-10-22)
-------------------
-
-- Added translations: ru, nl
-
-
-1.4.0 (2008-10-15)
-------------------
-
-- UI api refactored
-
-- Added default css styles
-
-
-1.3.2 (2008-05-16)
-------------------
-
-- Replace 'autoinclude' with 'includeDependendcies'
-
-
-1.3.1 (2008-05-07)
-------------------
-
-- Fix category rendering
-
-
-1.3.0 (2008-05-06)
-------------------
-
-- UI refactoring
-
-- Do not include permission checker for zope.Public permission
-
-
-1.2.1 (2008-04-22)
-------------------
-
-- Added permission checker to directive
-
-
-1.2.0 (2008-04-18)
-------------------
-
-- 'schema' field for z3ext:preferenceGroup is required now
-
-- Added adapter for IPrincipal to 'schema' with automatic binding
-
-
-1.1.1 (2008-04-15)
-------------------
-
-- Use 'z3ext.ManagePreference' as default preference permission
-
-
-1.1.0 (2008-04-11)
-------------------
-
-- Added 'for' field to z3ext:preferenceGroup directive
-
-
-1.0.2 (2008-04-07)
-------------------
-
-- Fix UI in navigation
-
-
-1.0.1 (2008-04-04)
-------------------
-
-- Fixed group category layout
-
-
-1.0.0 (2008-03-25)
-------------------
-
-- Tests added
-
-- Code moved to svn.zope.org
-
-
-0.9.2 (2008-02-29)
-------------------
-
-- Use z3c.autoinclude
-
-- Added z3c.baseregistry support
-
-
-0.9.1 (2008-02-20)
-------------------
-
-- Use z3ext.layoutform
-
-
-0.9.0 (2008-02-01)
-------------------
-
-- Initial release
Copied: z3ext.preferences/tags/1.4.3/CHANGES.txt (from rev 93926, z3ext.preferences/trunk/CHANGES.txt)
===================================================================
--- z3ext.preferences/tags/1.4.3/CHANGES.txt (rev 0)
+++ z3ext.preferences/tags/1.4.3/CHANGES.txt 2008-12-12 10:59:57 UTC (rev 93935)
@@ -0,0 +1,116 @@
+=======
+CHANGES
+=======
+
+1.4.3 (2008-12-12)
+------------------
+
+- Simplify preferences navigation
+
+- raise Unauthorized exception if unauthenticated user access preferences panel
+
+
+1.4.2 (2008-10-27)
+------------------
+
+- Show preference category if it has editable fields
+
+
+1.4.1 (2008-10-22)
+------------------
+
+- Added translations: ru, nl
+
+
+1.4.0 (2008-10-15)
+------------------
+
+- UI api refactored
+
+- Added default css styles
+
+
+1.3.2 (2008-05-16)
+------------------
+
+- Replace 'autoinclude' with 'includeDependendcies'
+
+
+1.3.1 (2008-05-07)
+------------------
+
+- Fix category rendering
+
+
+1.3.0 (2008-05-06)
+------------------
+
+- UI refactoring
+
+- Do not include permission checker for zope.Public permission
+
+
+1.2.1 (2008-04-22)
+------------------
+
+- Added permission checker to directive
+
+
+1.2.0 (2008-04-18)
+------------------
+
+- 'schema' field for z3ext:preferenceGroup is required now
+
+- Added adapter for IPrincipal to 'schema' with automatic binding
+
+
+1.1.1 (2008-04-15)
+------------------
+
+- Use 'z3ext.ManagePreference' as default preference permission
+
+
+1.1.0 (2008-04-11)
+------------------
+
+- Added 'for' field to z3ext:preferenceGroup directive
+
+
+1.0.2 (2008-04-07)
+------------------
+
+- Fix UI in navigation
+
+
+1.0.1 (2008-04-04)
+------------------
+
+- Fixed group category layout
+
+
+1.0.0 (2008-03-25)
+------------------
+
+- Tests added
+
+- Code moved to svn.zope.org
+
+
+0.9.2 (2008-02-29)
+------------------
+
+- Use z3c.autoinclude
+
+- Added z3c.baseregistry support
+
+
+0.9.1 (2008-02-20)
+------------------
+
+- Use z3ext.layoutform
+
+
+0.9.0 (2008-02-01)
+------------------
+
+- Initial release
Deleted: z3ext.preferences/tags/1.4.3/bootstrap.py
===================================================================
--- z3ext.preferences/trunk/bootstrap.py 2008-12-12 02:14:57 UTC (rev 93925)
+++ z3ext.preferences/tags/1.4.3/bootstrap.py 2008-12-12 10:59:57 UTC (rev 93935)
@@ -1,52 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2006 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.
-#
-##############################################################################
-"""Bootstrap a buildout-based project
-
-Simply run this script in a directory containing a buildout.cfg.
-The script accepts buildout command-line options, so you can
-use the -c option to specify an alternate configuration file.
-
-$Id$
-"""
-
-import os, shutil, sys, tempfile, urllib2
-
-tmpeggs = tempfile.mkdtemp()
-
-ez = {}
-exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
- ).read() in ez
-ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
-
-import pkg_resources
-
-cmd = 'from setuptools.command.easy_install import main; main()'
-if sys.platform == 'win32':
- cmd = '"%s"' % cmd # work around spawn lamosity on windows
-
-ws = pkg_resources.working_set
-assert os.spawnle(
- os.P_WAIT, sys.executable, sys.executable,
- '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
- dict(os.environ,
- PYTHONPATH=
- ws.find(pkg_resources.Requirement.parse('setuptools')).location
- ),
- ) == 0
-
-ws.add_entry(tmpeggs)
-ws.require('zc.buildout')
-import zc.buildout.buildout
-zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
-shutil.rmtree(tmpeggs)
Copied: z3ext.preferences/tags/1.4.3/bootstrap.py (from rev 93926, z3ext.preferences/trunk/bootstrap.py)
===================================================================
--- z3ext.preferences/tags/1.4.3/bootstrap.py (rev 0)
+++ z3ext.preferences/tags/1.4.3/bootstrap.py 2008-12-12 10:59:57 UTC (rev 93935)
@@ -0,0 +1,77 @@
+##############################################################################
+#
+# Copyright (c) 2006 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.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id$
+"""
+
+import os, shutil, sys, tempfile, urllib2
+
+tmpeggs = tempfile.mkdtemp()
+
+is_jython = sys.platform.startswith('java')
+
+try:
+ import pkg_resources
+except ImportError:
+ ez = {}
+ exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+ ).read() in ez
+ ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+ import pkg_resources
+
+if sys.platform == 'win32':
+ def quote(c):
+ if ' ' in c:
+ return '"%s"' % c # work around spawn lamosity on windows
+ else:
+ return c
+else:
+ def quote (c):
+ return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws = pkg_resources.working_set
+
+if is_jython:
+ import subprocess
+
+ assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
+ quote(tmpeggs), 'zc.buildout'],
+ env=dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ ),
+ ).wait() == 0
+
+else:
+ assert os.spawnle(
+ os.P_WAIT, sys.executable, quote (sys.executable),
+ '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+ dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ ),
+ ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+shutil.rmtree(tmpeggs)
Modified: z3ext.preferences/tags/1.4.3/setup.py
===================================================================
--- z3ext.preferences/trunk/setup.py 2008-12-12 02:14:57 UTC (rev 93925)
+++ z3ext.preferences/tags/1.4.3/setup.py 2008-12-12 10:59:57 UTC (rev 93935)
@@ -21,7 +21,7 @@
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
-version='1.4.3dev'
+version='1.4.3'
setup(name = 'z3ext.preferences',
Deleted: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/group.py
===================================================================
--- z3ext.preferences/trunk/src/z3ext/preferences/browser/group.py 2008-12-12 02:14:57 UTC (rev 93925)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/group.py 2008-12-12 10:59:57 UTC (rev 93935)
@@ -1,57 +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.
-#
-##############################################################################
-""" IPreferenceGroup view
-
-$Id$
-"""
-from zope import schema
-from zope.cachedescriptors.property import Lazy
-from z3ext.layoutform import Fields, PageletEditForm
-
-
-class PreferenceGroup(object):
-
- def update(self):
- context = self.context
- request = self.request
-
- subgroups = []
-
- for name, group in context.items():
- if not group.isAvailable():
- continue
- subgroups.append(group)
-
- self.subgroups = subgroups
- self.hasFields = bool(schema.getFields(self.context.__schema__))
- self.render = self.render()
-
-
-class PreferenceGroupView(PageletEditForm):
-
- @property
- def prefix(self):
- return str(self.context.__id__)
-
- @property
- def label(self):
- return self.context.__title__
-
- @property
- def description(self):
- return self.context.__description__
-
- @Lazy
- def fields(self):
- return Fields(self.context.__schema__, omitReadOnly=True)
Copied: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/group.py (from rev 93926, z3ext.preferences/trunk/src/z3ext/preferences/browser/group.py)
===================================================================
--- z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/group.py (rev 0)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/group.py 2008-12-12 10:59:57 UTC (rev 93935)
@@ -0,0 +1,63 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+""" IPreferenceGroup view
+
+$Id$
+"""
+from zope import schema
+from zope.cachedescriptors.property import Lazy
+from z3ext.layoutform import Fields, PageletEditForm
+
+
+class PreferenceGroup(object):
+
+ def update(self):
+ context = self.context
+ request = self.request
+
+ subgroups = []
+
+ for name, group in context.items():
+ if not group.isAvailable():
+ continue
+ subgroups.append(group)
+
+ self.subgroups = subgroups
+ self.hasFields = bool(schema.getFields(self.context.__schema__))
+
+ if not self.hasFields and len(subgroups) == 1:
+ self.oneSubgroup = True
+ else:
+ self.oneSubgroup = False
+
+ self.render = self.render()
+
+
+class PreferenceGroupView(PageletEditForm):
+
+ @property
+ def prefix(self):
+ return str(self.context.__id__)
+
+ @property
+ def label(self):
+ return self.context.__title__
+
+ @property
+ def description(self):
+ return self.context.__description__
+
+ @Lazy
+ def fields(self):
+ return Fields(self.context.__schema__, omitReadOnly=True)
Deleted: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/groupcategory.pt
===================================================================
--- z3ext.preferences/trunk/src/z3ext/preferences/browser/groupcategory.pt 2008-12-12 02:14:57 UTC (rev 93925)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/groupcategory.pt 2008-12-12 10:59:57 UTC (rev 93935)
@@ -1,9 +0,0 @@
-<tal:block tal:condition="view/hasFields"
- tal:content="structure context/@@pagelet/preference.editGroup" />
-
-<div class="z-frame" tal:condition="view/subgroups">
- <tal:block tal:repeat="group view/subgroups">
- <tal:block tal:content="structure group/@@pagelet/preference.previewGroup" />
- <br />
- </tal:block>
-</div>
Copied: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/groupcategory.pt (from rev 93926, z3ext.preferences/trunk/src/z3ext/preferences/browser/groupcategory.pt)
===================================================================
--- z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/groupcategory.pt (rev 0)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/groupcategory.pt 2008-12-12 10:59:57 UTC (rev 93935)
@@ -0,0 +1,14 @@
+<tal:block tal:condition="view/hasFields"
+ tal:content="structure context/@@pagelet/preference.editGroup" />
+
+<tal:block tal:condition="nocall:view/oneSubgroup">
+ <tal:block tal:define="group python:view.subgroups[0]"
+ tal:content="structure group/@@pagelet/preference.editGroup" />
+</tal:block>
+
+<div class="z-form" tal:condition="python: not view.oneSubgroup and view.subgroups">
+ <tal:block tal:repeat="group view/subgroups">
+ <tal:block tal:content="structure group/@@pagelet/preference.previewGroup" />
+ <br />
+ </tal:block>
+</div>
Deleted: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/index.pt
===================================================================
--- z3ext.preferences/trunk/src/z3ext/preferences/browser/index.pt 2008-12-12 02:14:57 UTC (rev 93925)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/index.pt 2008-12-12 10:59:57 UTC (rev 93935)
@@ -1,32 +0,0 @@
-<div class="z-frame">
- <ul class="z-prefs-listing">
- <li tal:repeat="item view/groups">
- <tal:block tal:define="group item/group">
- <div class="z-prefs-icon" tal:define="icon group/@@zmi_icon|nothing"
- tal:condition="icon">
- <tal:block tal:condition="icon" tal:content="structure icon"/>
- </div>
- <div class="z-prefs-details">
- <a tal:attributes="href string:${group/__id__}/">
- <tal:block tal:content="group/__title__"/></a>
- <div><tal:block tal:content="group/__description__"/> </div>
-
- <ul class="z-prefs-listing" tal:condition="item/subgroups">
- <li tal:repeat="sgroup item/subgroups">
- <div class="z-prefs-icon" tal:define="icon sgroup/group/@@zmi_icon|nothing"
- tal:condition="icon">
- <tal:block tal:condition="icon" tal:content="structure icon" />
- </div>
- <div class="z-prefs-details">
- <a tal:attributes="href string:${group/__id__}/${sgroup/id}/">
- <tal:block tal:content="sgroup/group/__title__"/></a>
- <div><tal:block tal:content="sgroup/group/__description__"/>
- </div>
- </div>
- </li>
- </ul>
- </div>
- </tal:block>
- </li>
- </ul>
-</div>
Copied: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/index.pt (from rev 93926, z3ext.preferences/trunk/src/z3ext/preferences/browser/index.pt)
===================================================================
--- z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/index.pt (rev 0)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/index.pt 2008-12-12 10:59:57 UTC (rev 93935)
@@ -0,0 +1,32 @@
+<div class="z-form">
+ <ul class="z-listing">
+ <li tal:repeat="item view/groups">
+ <tal:block tal:define="group item/group">
+ <div class="z-listing-icon" tal:define="icon group/@@zmi_icon|nothing"
+ tal:condition="icon">
+ <tal:block tal:condition="icon" tal:content="structure icon"/>
+ </div>
+ <div class="z-listing-details">
+ <a tal:attributes="href string:${group/__id__}/">
+ <tal:block tal:content="group/__title__"/></a>
+ <div><tal:block tal:content="group/__description__"/> </div>
+
+ <ul class="z-listing" tal:condition="item/subgroups">
+ <li tal:repeat="sgroup item/subgroups">
+ <div class="z-listing-icon" tal:define="icon sgroup/group/@@zmi_icon|nothing"
+ tal:condition="icon">
+ <tal:block tal:condition="icon" tal:content="structure icon" />
+ </div>
+ <div class="z-listing-details">
+ <a tal:attributes="href string:${group/__id__}/${sgroup/id}/">
+ <tal:block tal:content="sgroup/group/__title__"/></a>
+ <div><tal:block tal:content="sgroup/group/__description__"/>
+ </div>
+ </div>
+ </li>
+ </ul>
+ </div>
+ </tal:block>
+ </li>
+ </ul>
+</div>
Deleted: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/index.py
===================================================================
--- z3ext.preferences/trunk/src/z3ext/preferences/browser/index.py 2008-12-12 02:14:57 UTC (rev 93925)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/index.py 2008-12-12 10:59:57 UTC (rev 93935)
@@ -1,49 +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.
-#
-##############################################################################
-"""
-
-$Id$
-"""
-from zope.interface import Interface
-from zope.component import getUtility
-from zope.security import checkPermission
-from z3ext.preferences.utils import hasEditableFields
-from z3ext.preferences.interfaces import IPreferenceGroup, IPreferenceCategory
-
-
-class PreferencesView(object):
-
- def groups(self):
- root = self.context
- request = self.request
-
- groups = []
- for name, group in root.items():
- if not group.isAvailable():
- continue
-
- if IPreferenceCategory.providedBy(group):
- subgroups = [(sgroup.__title__,
- sgroup.__id__.split('.')[-1], sgroup)
- for t, sgroup in group.items()
- if sgroup.isAvailable()]
- if subgroups or hasEditableFields(group):
- groups.append((group.__title__, group,
- [{'id': id, 'group': sgroup}
- for t, id, sgroup in subgroups]))
- else:
- groups.append((group.__title__, group, ()))
-
- return [{'group':group, 'subgroups': groups}
- for t, group, groups in groups]
Copied: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/index.py (from rev 93926, z3ext.preferences/trunk/src/z3ext/preferences/browser/index.py)
===================================================================
--- z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/index.py (rev 0)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/index.py 2008-12-12 10:59:57 UTC (rev 93935)
@@ -0,0 +1,51 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+from zope.interface import Interface
+from zope.component import getUtility
+from zope.security import checkPermission
+from z3ext.preferences.utils import hasEditableFields
+from z3ext.preferences.interfaces import IPreferenceGroup, IPreferenceCategory
+
+
+class PreferencesView(object):
+
+ def groups(self):
+ root = self.context
+ request = self.request
+
+ groups = []
+ for name, group in root.items():
+ if not group.isAvailable():
+ continue
+
+ if IPreferenceCategory.providedBy(group):
+ subgroups = [(sgroup.__title__,
+ sgroup.__id__.split('.')[-1], sgroup)
+ for t, sgroup in group.items()
+ if sgroup.isAvailable()]
+ if (len(subgroups) > 1) or hasEditableFields(group):
+ groups.append((group.__title__, group,
+ [{'id': id, 'group': sgroup}
+ for t, id, sgroup in subgroups]))
+ elif len(subgroups) == 1:
+ groups.append((group.__title__, group, ()))
+ else:
+ groups.append((group.__title__, group, ()))
+
+ return [{'group':group, 'subgroups': groups}
+ for t, group, groups in groups]
Deleted: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/layoutcontent.pt
===================================================================
--- z3ext.preferences/trunk/src/z3ext/preferences/browser/layoutcontent.pt 2008-12-12 02:14:57 UTC (rev 93925)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/layoutcontent.pt 2008-12-12 10:59:57 UTC (rev 93935)
@@ -1,6 +0,0 @@
-<h1 class="z-prefs-title" tal:content="layoutcontext/__title__"></h1>
-<div class="z-page-description" tal:content="layoutcontext/__description__"></div>
-
-<div tal:content="structure view/render">
- [rendered body]
-</div>
Copied: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/layoutcontent.pt (from rev 93933, z3ext.preferences/trunk/src/z3ext/preferences/browser/layoutcontent.pt)
===================================================================
--- z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/layoutcontent.pt (rev 0)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/layoutcontent.pt 2008-12-12 10:59:57 UTC (rev 93935)
@@ -0,0 +1,6 @@
+<h1 class="z-prefs-title" tal:content="layoutcontext/__title__"></h1>
+<div class="z-page-description" tal:content="layoutcontext/__description__"></div>
+
+<div class="z-prefs-content" tal:content="structure view/render">
+ [rendered body]
+</div>
Deleted: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/navigation.pt
===================================================================
--- z3ext.preferences/trunk/src/z3ext/preferences/browser/navigation.pt 2008-12-12 02:14:57 UTC (rev 93925)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/navigation.pt 2008-12-12 10:59:57 UTC (rev 93935)
@@ -1,23 +0,0 @@
-<tal:block tal:repeat="viewlet view/viewlets"
- tal:content="structure viewlet/render" />
-
-<div class="z-prefs-nav">
- <tal:block tal:repeat="item view/data">
- <metal:block metal:define-macro="level">
- <div class="z-prefs-nav-item"
- tal:attributes="class python:item['selected'] and 'z-prefs-nav-item-selected'
- or 'z-prefs-nav-item'">
- <div tal:omit-tag="not:item/level|nothing"
- tal:attributes="class string:z-prefs-level${item/level|nothing}">
- <a tal:attributes="href string:${item/prefs/@@absolute_url}/">
- <al:block tal:content="structure item/icon" />
- <tal:block tal:content="item/title" />
- </a>
- </div>
- </div>
- <tal:block tal:repeat="item item/items">
- <metal:block use-macro="view/template/macros/level"/>
- </tal:block>
- </metal:block>
- </tal:block>
-</div>
Copied: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/navigation.pt (from rev 93926, z3ext.preferences/trunk/src/z3ext/preferences/browser/navigation.pt)
===================================================================
--- z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/navigation.pt (rev 0)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/navigation.pt 2008-12-12 10:59:57 UTC (rev 93935)
@@ -0,0 +1,25 @@
+<tal:block tal:repeat="viewlet view/viewlets"
+ tal:content="structure viewlet/render" />
+
+<div class="z-prefs-nav">
+ <tal:block tal:repeat="item view/data">
+ <metal:block metal:define-macro="level">
+ <div class="z-prefs-nav-item"
+ tal:attributes="class python:item['selected'] and 'z-prefs-nav-item-selected'
+ or 'z-prefs-nav-item'">
+ <div tal:omit-tag="not:item/level|nothing"
+ tal:attributes="class string:z-level${item/level|nothing}">
+ <a tal:attributes="href string:${item/prefs/@@absolute_url}/;
+ title item/description"
+ tal:omit-tag="not:item/editable">
+ <al:block tal:content="structure item/icon" />
+ <tal:block tal:content="item/title" />
+ </a>
+ </div>
+ </div>
+ <tal:block tal:repeat="item item/items">
+ <metal:block use-macro="view/template/macros/level"/>
+ </tal:block>
+ </metal:block>
+ </tal:block>
+</div>
Deleted: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/navigation.py
===================================================================
--- z3ext.preferences/trunk/src/z3ext/preferences/browser/navigation.py 2008-12-12 02:14:57 UTC (rev 93925)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/navigation.py 2008-12-12 10:59:57 UTC (rev 93935)
@@ -1,90 +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.
-#
-##############################################################################
-"""
-
-$Id$
-"""
-from zope.component import queryMultiAdapter
-from zope.viewlet.manager import ViewletManagerBase
-from z3ext.preferences.utils import hasEditableFields
-from z3ext.preferences.interfaces import IRootPreferences
-from z3ext.preferences.interfaces import IPreferenceGroup
-from z3ext.preferences.interfaces import IPreferenceCategory
-
-
-class Navigation(ViewletManagerBase):
-
- def update(self):
- super(Navigation, self).update()
-
- context = self.context
-
- self.isRoot = IRootPreferences.providedBy(context)
- if self.isRoot:
- return
-
- path = []
- parent = context
- while IPreferenceGroup.providedBy(parent):
- path.insert(0, parent)
- parent = parent.__parent__
-
- self.root, path = path[0], path[1:]
-
- self.data = self._process(self.root, path)
-
- def _process(self, context, path, level=1):
- request = self.request
- maincontext = self.context
-
- if path:
- data = []
- items = getattr(context, 'items', ())
- if callable(items):
- items = items()
-
- for name, prefs in items:
- if not prefs.isAvailable():
- continue
-
- info = {'name': name,
- 'title': prefs.__title__,
- 'icon': queryMultiAdapter(
- (prefs, request), name='zmi_icon'),
- 'items': (),
- 'selected': False,
- 'prefs': prefs,
- 'level': level}
-
- if prefs.__id__ == path[0].__id__:
- info['items'] = self._process(prefs, path[1:], level+1)
-
- if prefs.__id__ == self.context.__id__:
- info['selected'] = True
- #info['items'] = self._process(prefs, [prefs], level+1)
-
- if IPreferenceCategory.providedBy(prefs) and not info['items']:
- if not self._process(prefs, [prefs], level+1) \
- and not hasEditableFields(prefs):
- continue
-
- data.append(info)
-
- return data
-
- def render(self):
- if self.isRoot:
- return u''
- else:
- return super(Navigation, self).render()
Copied: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/navigation.py (from rev 93926, z3ext.preferences/trunk/src/z3ext/preferences/browser/navigation.py)
===================================================================
--- z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/navigation.py (rev 0)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/navigation.py 2008-12-12 10:59:57 UTC (rev 93935)
@@ -0,0 +1,98 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+from zope.component import queryMultiAdapter
+from zope.viewlet.manager import ViewletManagerBase
+from z3ext.preferences.utils import hasEditableFields
+from z3ext.preferences.interfaces import IRootPreferences
+from z3ext.preferences.interfaces import IPreferenceGroup
+from z3ext.preferences.interfaces import IPreferenceCategory
+
+
+class Navigation(ViewletManagerBase):
+
+ def update(self):
+ super(Navigation, self).update()
+
+ context = self.context
+
+ self.isRoot = IRootPreferences.providedBy(context)
+ if self.isRoot:
+ return
+
+ path = []
+ parent = context
+ while IPreferenceGroup.providedBy(parent):
+ path.insert(0, parent)
+ parent = parent.__parent__
+
+ self.root, path = path[0], path[1:]
+
+ self.data = self._process(self.root, path)
+
+ def _process(self, context, path, level=1):
+ request = self.request
+ maincontext = self.context
+
+ if path:
+ data = []
+ items = getattr(context, 'items', ())
+ if callable(items):
+ items = items()
+
+ for name, prefs in items:
+ if not prefs.isAvailable():
+ continue
+
+ info = {'name': name,
+ 'title': prefs.__title__,
+ 'description': prefs.__description__,
+ 'icon': queryMultiAdapter(
+ (prefs, request), name='zmi_icon'),
+ 'items': (),
+ 'selected': False,
+ 'prefs': prefs,
+ 'level': level,
+ 'editable': True}
+
+ if prefs.__id__ == path[0].__id__:
+ info['items'] = self._process(prefs, path[1:], level+1)
+ elif prefs.__parent__.__id__ == '':
+ info['items'] = self._process(prefs, [self.root], level+1)
+ if len(info['items']) == 1:
+ info['items'] = ()
+
+ if prefs.__id__ == self.context.__id__:
+ info['selected'] = True
+
+ if IPreferenceCategory.providedBy(prefs):
+ if not info['items']:
+ if not self._process(prefs, [prefs], level+1) \
+ and not hasEditableFields(prefs):
+ continue
+ elif not hasEditableFields(prefs):
+ info['editable'] = False
+
+ data.append(info)
+
+ return data
+
+ def render(self):
+ if self.isRoot:
+ return u''
+ else:
+ return super(Navigation, self).render()
Deleted: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/styles.css
===================================================================
--- z3ext.preferences/trunk/src/z3ext/preferences/browser/styles.css 2008-12-12 02:14:57 UTC (rev 93925)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/styles.css 2008-12-12 10:59:57 UTC (rev 93935)
@@ -1,165 +0,0 @@
-/* zrt-cssregistry: */
-
- at media all {
-
- #z-preferences {
- padding: 1.5em;
- border: borderWidth borderStyle globalBorderColor;
- background-color: globalBackgroundColor;
- margin: 2em 1.5em 1.5em 1.5em;
- font-size: 110%;
- }
-
- #z-preferences .z-prefs-title {
- font-weight: bold;
- }
-
- #z-preferences h1 {
- font-size: 130%;
- font-weight: bold;
- }
-
- #z-preferences h2 {
- font-size: 120%;
- }
-
- #z-preferences h2 {
- font-size: 130%;
- }
-
- #z-preferences table.z-prefs-layout {
- width: 100%;
- }
-
- #z-preferences table.z-prefs-layout tr {
- vertical-align: top;
- }
-
- #z-preferences .z-prefs-nav-wrapper {
- padding-right: 1em;
- width: 200px;
- }
-
- #z-preferences .z-prefs-nav {
- border: borderWidth borderStyle globalBorderColor;
- border-bottom: none;
- background: contentBackgroundColor;
- font-size: fontSmallSize;
- }
-
- #z-preferences .z-prefs-nav a {
- text-decoration: none;
- }
-
- #z-preferences .z-prefs-nav-item {
- padding: 0.8em 0.4em 0.5em 0.4em;
- border-bottom: borderWidth borderStyle globalBorderColor;
- }
-
- #z-preferences .z-prefs-nav-item-selected {
- padding: 0.8em 0.4em 0.5em 0.4em;
- background-color: globalBackgroundColor;
- border-bottom: borderWidth borderStyle globalBorderColor;
- }
-
- #z-preferences .z-prefs-nav-item:hover {
- background-color: globalBackgroundColor;
- }
-
- #z-preferences .z-prefs-nav-item li span {
- border: 0;
- border-bottom: 1px dotted discreetColor;
- }
-
- ul.z-prefs-listing {
- margin: 0.5em 0;
- list-style: none;
- list-style-image: none;
- list-style-type: none;
- }
-
- ul.z-prefs-listing li {
- clear: both;
- margin-bottom: 0.5em;
- list-style: none;
- list-style-image: none;
- }
-
- ul.z-prefs-listing li .z-prefs-icon {
- float: left;
- padding-top: 8px;
- padding-right: 0.5em;
- height: 32px;
- }
-
- ul.z-prefs-listing li a,
- ul.z-prefs-listing li .z-cp-details a {
- color: linkColor;
- border: 0;
- border-bottom: 1px dotted discreetColor;
- text-decoration: none;
- }
-
- ul.z-prefs-listing li a:visited,
- ul.z-prefs-listing li .z-prefs-details a:visited {
- color: linkColor;
- background-color: transparent;
- }
-
- ul.z-prefs-listing li a:active,
- ul.z-prefs-listing li .z-prefs-details a:active {
- color: linkColor;
- background-color: transparent;
- }
-
- ul.z-prefs-listing li span {
- border: 0;
- border-bottom: 1px dotted discreetColor;
- }
-
- ul.z-prefs-listing li .z-prefs-details span a {
- border-bottom: 0px;
- }
-
- ul.z-prefs-listing li label {
- font-weight: bold;
- border-bottom: borderWidth dotted discreetColor;
- }
-
- ul.z-prefs-listing li {
- border: 1px solid contentBackgroundColor;
- }
-
- ul.z-prefs-listing li .z-prefs-details div {
- color: discreetColor;
- font-size: fontSmallSize;
- }
-
- ul.z-prefs-listing li ul.z-prefs-listing {
- margin-left: 1.5em;
- font-size: 110%;
- }
-
- ul.z-prefs-listing li .z-prefs-details div span {
- color: discreetColor;
- font-size: fontSmallSize;
- border: 0;
- }
-
- .z-prefs-level1 {
- padding-left: 0.8em;
- }
-
- .z-prefs-level2 {
- padding-left: 1.6em;
- }
-
- #z-preferences .z-form,
- #z-preferences .z-form-add,
- #z-preferences .z-form-edit {
- border: borderWidth borderStyle globalExtraBorderColor;
- margin-top: 0em;
- padding: 1em;
- background: contentBackgroundColor;
- }
-}
Copied: z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/styles.css (from rev 93926, z3ext.preferences/trunk/src/z3ext/preferences/browser/styles.css)
===================================================================
--- z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/styles.css (rev 0)
+++ z3ext.preferences/tags/1.4.3/src/z3ext/preferences/browser/styles.css 2008-12-12 10:59:57 UTC (rev 93935)
@@ -0,0 +1,82 @@
+/* zrt-cssregistry: */
+
+ at media all {
+
+ #z-preferences {
+ padding: 1.5em;
+ border: borderWidth borderStyle globalBorderColor;
+ background-color: globalBackgroundColor;
+ margin: 2em 1.5em 1.5em 1.5em;
+ font-size: 110%;
+ }
+
+ #z-preferences .z-prefs-title {
+ font-weight: bold;
+ }
+
+ #z-preferences h1 {
+ font-size: 130%;
+ font-weight: bold;
+ }
+
+ #z-preferences h2 {
+ font-size: 120%;
+ }
+
+ #z-preferences h2 {
+ font-size: 130%;
+ }
+
+ #z-preferences table.z-prefs-layout {
+ width: 100%;
+ }
+
+ #z-preferences table.z-prefs-layout tr {
+ vertical-align: top;
+ }
+
+ #z-preferences .z-prefs-nav-wrapper {
+ padding-right: 1em;
+ width: 200px;
+ }
+
+ .z-prefs-nav {
+ border: borderWidth borderStyle globalBorderColor;
+ border-bottom: none;
+ background: contentBackgroundColor;
+ font-size: fontSmallSize;
+ }
+
+ .z-prefs-nav a {
+ text-decoration: none;
+ }
+
+ .z-prefs-nav-item {
+ padding: 0.8em 0.4em 0.5em 0.4em;
+ border-bottom: borderWidth borderStyle globalBorderColor;
+ }
+
+ .z-prefs-nav-item-selected {
+ padding: 0.8em 0.4em 0.5em 0.4em;
+ background-color: globalBackgroundColor;
+ border-bottom: borderWidth borderStyle globalBorderColor;
+ }
+
+ .z-prefs-nav-item:hover {
+ background-color: globalBackgroundColor;
+ }
+
+ .z-prefs-nav-item li span {
+ border: 0;
+ border-bottom: 1px dotted discreetColor;
+ }
+
+ #z-preferences .z-form,
+ #z-preferences .z-form-add,
+ #z-preferences .z-form-edit {
+ border: borderWidth borderStyle globalExtraBorderColor;
+ margin-top: 0em;
+ padding: 1em;
+ background: contentBackgroundColor;
+ }
+}
More information about the Checkins
mailing list