diff --git a/last_commit.txt b/last_commit.txt index d682e0e3f1..d058903bb5 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -1,53 +1,87 @@ -Repository: plone.app.content +Repository: plone.app.customerize Branch: refs/heads/master -Date: 2018-10-02T09:36:20+02:00 -Author: Manuel Reinhardt (reinhardt) -Commit: https://github.com/plone/plone.app.content/commit/111f1f55f22073b660b8421aa692dd51188ae267 +Date: 2018-10-02T15:50:06+02:00 +Author: Jens W. Klein (jensens) +Commit: https://github.com/plone/plone.app.customerize/commit/e9155f3cbc5ef8199d91d784fde3f78f85bc768f -Added get_objects_from_path_list to replace skin script. #1801 +optimize for new bootstrap based ZMI Files changed: M CHANGES.rst -M plone/app/content/browser/content_status_history.py -M plone/app/content/browser/templates/content_status_history.pt +M plone/app/customerize/registrations.pt -b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 4cd7d7c..96cb1fd 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -10,7 +10,8 @@ Breaking changes:\n \n New features:\n \n-- *add item here*\n+- Added get_objects_from_path_list to replace skin script. #1801\n+ [reinhardt]\n \n Bug fixes:\n \ndiff --git a/plone/app/content/browser/content_status_history.py b/plone/app/content/browser/content_status_history.py\nindex 2dce48b..efa382d 100644\n--- a/plone/app/content/browser/content_status_history.py\n+++ b/plone/app/content/browser/content_status_history.py\n@@ -119,3 +119,12 @@ def validate(self, workflow_action=None, paths=[]):\n # Set paths using orgi_paths, otherwise users are getting confused\n orig_paths = self.request.get(\'orig_paths\')\n self.request.set(\'paths\', orig_paths)\n+\n+ def get_objects_from_path_list(self, paths=[]):\n+ contents = []\n+ portal = getToolByName(self.context, \'portal_url\').getPortalObject()\n+ for path in paths:\n+ obj = portal.restrictedTraverse(str(path), None)\n+ if obj is not None:\n+ contents.append(obj)\n+ return contents\ndiff --git a/plone/app/content/browser/templates/content_status_history.pt b/plone/app/content/browser/templates/content_status_history.pt\nindex 737b048..eb2cffc 100644\n--- a/plone/app/content/browser/templates/content_status_history.pt\n+++ b/plone/app/content/browser/templates/content_status_history.pt\n@@ -39,7 +39,7 @@\n tal:define="errors view/errors;\n review_state context_state/workflow_state;\n paths python:request.get(\'paths\', [\'/\'.join(context.getPhysicalPath())]);\n- batch python:context.getObjectsFromPathList(paths, batch=False);\n+ batch python:view.get_objects_from_path_list(paths);\n folders_in_publishing python:[o.getId for o in batch if o.isPrincipiaFolderish];\n came_from python:request.get(\'HTTP_REFERER\', context.absolute_url()).split(\'?\')[0];\n dummy python:request.set(\'orig_template\', came_from);\n' +b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 3c6692d..c613369 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -15,6 +15,10 @@ New features:\n \n Bug fixes:\n \n+- make registrations.html look good in Bootstrap-ZMI,\n+ still working fine in old ZMI.\n+ [jensens]\n+\n - Fix templateViewRegistrationGroups and tests in py3.\n [pbauer]\n \ndiff --git a/plone/app/customerize/registrations.pt b/plone/app/customerize/registrations.pt\nindex e8fbce6..5ffdf77 100644\n--- a/plone/app/customerize/registrations.pt\n+++ b/plone/app/customerize/registrations.pt\n@@ -1,44 +1,35 @@\n

\n

\n \n-\n+
\n \n-
\n-

The following list shows all registered (template-based) views\n- sorted by interface. Click one of the links to see the contents\n- of the view template and possibly customize it. Views that already\n- have been customized are highlighted like\n- this.

\n-
\n+ \n \n-
\n-

ATTENTION: beware using this tool. Errors (e.g. TypeError,\n- Unauthorized etc) may popup if some kinds of\n- python: expressions are used in the template, making it\n- impossible to customize here (try z3c.jbot or regular zcml overrides\n- instead). The reason is that browser view templates are Zope 3 templates\n- while items in portal_view_customization are Zope 2 templates. The different\n- security models underlying the two implementations may break rendering of the\n- site. If that happens just delete the custom copy using the Contents tab\n- above.

\n+\n \n-
\n+

\n+ The following list shows all registered (template-based) views\n+ sorted by interface. Click one of the links to see the contents\n+ of the view template and possibly customize it. Views that already\n+ have been customized are highlighted like\n+ this.\n+

\n+\n
\n
\n
    \n@@ -54,10 +45,11 @@\n title info/zptfile;"\n tal:content="info/viewname">\n \n-
    \n+
    \n \n
\n
\n-
\n \n-

\n+

\n+\n+

\n\\ No newline at end of file\n' -Repository: plone.app.content +Repository: plone.app.customerize Branch: refs/heads/master -Date: 2018-10-02T14:14:16+02:00 +Date: 2018-10-02T15:51:18+02:00 Author: Jens W. Klein (jensens) -Commit: https://github.com/plone/plone.app.content/commit/8b51c1d49130939e4f31de4bf7c3673bd33b4ad0 +Commit: https://github.com/plone/plone.app.customerize/commit/4f8cd4f3ad820af354cb9b012b5c8a4e3e2918b4 + +isort + +Files changed: +M plone/app/customerize/registration.py +M plone/app/customerize/tests/testDocTests.py + +b'diff --git a/plone/app/customerize/registration.py b/plone/app/customerize/registration.py\nindex 02e00bb..3ad7990 100644\n--- a/plone/app/customerize/registration.py\n+++ b/plone/app/customerize/registration.py\n@@ -4,6 +4,7 @@\n from five.customerize.interfaces import IViewTemplateContainer\n from five.customerize.utils import findViewletTemplate\n from five.customerize.zpt import TTWViewTemplate\n+from operator import itemgetter\n from os.path import basename\n from plone.browserlayer.interfaces import ILocalBrowserLayerType\n from plone.portlets.interfaces import IPortletRenderer\n@@ -13,7 +14,6 @@\n from zope.component import getUtility\n from zope.publisher.interfaces.browser import IBrowserRequest\n from zope.viewlet.interfaces import IViewlet\n-from operator import itemgetter\n \n \n def getViews(type):\ndiff --git a/plone/app/customerize/tests/testDocTests.py b/plone/app/customerize/tests/testDocTests.py\nindex cd51685..98563ae 100644\n--- a/plone/app/customerize/tests/testDocTests.py\n+++ b/plone/app/customerize/tests/testDocTests.py\n@@ -1,5 +1,7 @@\n # -*- coding: utf-8 -*-\n-from plone.app.customerize.testing import PLONE_APP_CUSTOMERIZE_FUNCTIONAL_TESTING # noqa\n+from plone.app.customerize.testing import (\n+ PLONE_APP_CUSTOMERIZE_FUNCTIONAL_TESTING # noqa\n+)\n from plone.testing import layered\n from unittest import TestSuite\n \n' -Merge pull request #162 from plone/1801-get-from-paths +Repository: plone.app.customerize -Added get_objects_from_path_list + +Branch: refs/heads/master +Date: 2018-10-02T15:53:33+02:00 +Author: Jens W. Klein (jensens) +Commit: https://github.com/plone/plone.app.customerize/commit/157a066561edae8f46c36679f07fd0deb91f0fa6 + +pep8 Files changed: -M CHANGES.rst -M plone/app/content/browser/content_status_history.py -M plone/app/content/browser/templates/content_status_history.pt +M plone/app/customerize/tests/testDocTests.py +M plone/app/customerize/tool.py -b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 4cd7d7c..96cb1fd 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -10,7 +10,8 @@ Breaking changes:\n \n New features:\n \n-- *add item here*\n+- Added get_objects_from_path_list to replace skin script. #1801\n+ [reinhardt]\n \n Bug fixes:\n \ndiff --git a/plone/app/content/browser/content_status_history.py b/plone/app/content/browser/content_status_history.py\nindex 2dce48b..efa382d 100644\n--- a/plone/app/content/browser/content_status_history.py\n+++ b/plone/app/content/browser/content_status_history.py\n@@ -119,3 +119,12 @@ def validate(self, workflow_action=None, paths=[]):\n # Set paths using orgi_paths, otherwise users are getting confused\n orig_paths = self.request.get(\'orig_paths\')\n self.request.set(\'paths\', orig_paths)\n+\n+ def get_objects_from_path_list(self, paths=[]):\n+ contents = []\n+ portal = getToolByName(self.context, \'portal_url\').getPortalObject()\n+ for path in paths:\n+ obj = portal.restrictedTraverse(str(path), None)\n+ if obj is not None:\n+ contents.append(obj)\n+ return contents\ndiff --git a/plone/app/content/browser/templates/content_status_history.pt b/plone/app/content/browser/templates/content_status_history.pt\nindex 737b048..eb2cffc 100644\n--- a/plone/app/content/browser/templates/content_status_history.pt\n+++ b/plone/app/content/browser/templates/content_status_history.pt\n@@ -39,7 +39,7 @@\n tal:define="errors view/errors;\n review_state context_state/workflow_state;\n paths python:request.get(\'paths\', [\'/\'.join(context.getPhysicalPath())]);\n- batch python:context.getObjectsFromPathList(paths, batch=False);\n+ batch python:view.get_objects_from_path_list(paths);\n folders_in_publishing python:[o.getId for o in batch if o.isPrincipiaFolderish];\n came_from python:request.get(\'HTTP_REFERER\', context.absolute_url()).split(\'?\')[0];\n dummy python:request.set(\'orig_template\', came_from);\n' +b"diff --git a/plone/app/customerize/tests/testDocTests.py b/plone/app/customerize/tests/testDocTests.py\nindex 98563ae..3e18c65 100644\n--- a/plone/app/customerize/tests/testDocTests.py\n+++ b/plone/app/customerize/tests/testDocTests.py\n@@ -20,7 +20,7 @@ def check_output(self, want, got, optionflags):\n \n def test_suite():\n suite = TestSuite()\n- OPTIONFLAGS = (doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE)\n+ OPTIONFLAGS = doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE\n for testfile in ('testBrowserLayers.txt', 'testCustomizeView.txt'):\n suite.addTest(\n layered(\n@@ -30,7 +30,7 @@ def test_suite():\n package='plone.app.customerize.tests',\n checker=Py23DocChecker(),\n ),\n- layer=PLONE_APP_CUSTOMERIZE_FUNCTIONAL_TESTING\n+ layer=PLONE_APP_CUSTOMERIZE_FUNCTIONAL_TESTING,\n )\n )\n return suite\ndiff --git a/plone/app/customerize/tool.py b/plone/app/customerize/tool.py\nindex 3c8a7ba..dbeb642 100644\n--- a/plone/app/customerize/tool.py\n+++ b/plone/app/customerize/tool.py\n@@ -19,8 +19,10 @@ class ViewTemplateContainer(Folder):\n security = ClassSecurityInfo()\n \n manage_options = (\n- dict(label='Registrations', action='registrations.html'),\n- ) + Folder.manage_options[0:1] + Folder.manage_options[2:]\n+ (dict(label='Registrations', action='registrations.html'),) +\n+ Folder.manage_options[0:1] +\n+ Folder.manage_options[2:]\n+ )\n \n @security.protected(ManagePortal)\n def addTemplate(self, id, template):\n@@ -28,4 +30,5 @@ def addTemplate(self, id, template):\n self._setObject(id, template)\n return getattr(self, id)\n \n+\n InitializeClass(ViewTemplateContainer)\n" -Repository: plone.app.content +Repository: plone.app.customerize Branch: refs/heads/master -Date: 2018-10-02T17:44:41+02:00 +Date: 2018-10-02T15:59:35+02:00 Author: Jens W. Klein (jensens) -Commit: https://github.com/plone/plone.app.content/commit/8f0e691870d9bb6166d1050bcc0aaa067eee85f8 +Commit: https://github.com/plone/plone.app.customerize/commit/7b57cc3644ef9f730481d3ff2f5e5db2113907b8 -Merge branch 'python3' +cleanup namespace imports Files changed: -M CHANGES.rst -M plone/app/content/browser/content_status_history.py -M plone/app/content/browser/templates/content_status_history.pt +M plone/__init__.py +M plone/app/__init__.py -b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 32cee5e..8384646 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -18,6 +18,8 @@ New features:\n Bug fixes:\n \n - *add item here*\n+- Added get_objects_from_path_list to replace skin script. #1801\n+ [reinhardt]\n \n \n 3.5.4 (2018-09-23)\ndiff --git a/plone/app/content/browser/content_status_history.py b/plone/app/content/browser/content_status_history.py\nindex 2dce48b..efa382d 100644\n--- a/plone/app/content/browser/content_status_history.py\n+++ b/plone/app/content/browser/content_status_history.py\n@@ -119,3 +119,12 @@ def validate(self, workflow_action=None, paths=[]):\n # Set paths using orgi_paths, otherwise users are getting confused\n orig_paths = self.request.get(\'orig_paths\')\n self.request.set(\'paths\', orig_paths)\n+\n+ def get_objects_from_path_list(self, paths=[]):\n+ contents = []\n+ portal = getToolByName(self.context, \'portal_url\').getPortalObject()\n+ for path in paths:\n+ obj = portal.restrictedTraverse(str(path), None)\n+ if obj is not None:\n+ contents.append(obj)\n+ return contents\ndiff --git a/plone/app/content/browser/templates/content_status_history.pt b/plone/app/content/browser/templates/content_status_history.pt\nindex 737b048..eb2cffc 100644\n--- a/plone/app/content/browser/templates/content_status_history.pt\n+++ b/plone/app/content/browser/templates/content_status_history.pt\n@@ -39,7 +39,7 @@\n tal:define="errors view/errors;\n review_state context_state/workflow_state;\n paths python:request.get(\'paths\', [\'/\'.join(context.getPhysicalPath())]);\n- batch python:context.getObjectsFromPathList(paths, batch=False);\n+ batch python:view.get_objects_from_path_list(paths);\n folders_in_publishing python:[o.getId for o in batch if o.isPrincipiaFolderish];\n came_from python:request.get(\'HTTP_REFERER\', context.absolute_url()).split(\'?\')[0];\n dummy python:request.set(\'orig_template\', came_from);\n' +b"diff --git a/plone/__init__.py b/plone/__init__.py\nindex 85880ef..68c04af 100644\n--- a/plone/__init__.py\n+++ b/plone/__init__.py\n@@ -1,7 +1,2 @@\n # -*- coding: utf-8 -*-\n-# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages\n-try:\n- __import__('pkg_resources').declare_namespace(__name__)\n-except ImportError:\n- from pkgutil import extend_path\n- __path__ = extend_path(__path__, __name__)\n+__import__('pkg_resources').declare_namespace(__name__)\ndiff --git a/plone/app/__init__.py b/plone/app/__init__.py\nindex 85880ef..68c04af 100644\n--- a/plone/app/__init__.py\n+++ b/plone/app/__init__.py\n@@ -1,7 +1,2 @@\n # -*- coding: utf-8 -*-\n-# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages\n-try:\n- __import__('pkg_resources').declare_namespace(__name__)\n-except ImportError:\n- from pkgutil import extend_path\n- __path__ = extend_path(__path__, __name__)\n+__import__('pkg_resources').declare_namespace(__name__)\n" + +Repository: plone.app.customerize + + +Branch: refs/heads/master +Date: 2018-10-03T02:11:17+02:00 +Author: Jens W. Klein (jensens) +Commit: https://github.com/plone/plone.app.customerize/commit/cda0dbec35dd4f8419fe5f449ab5a5ba5faea582 + +Merge pull request #16 from plone/bootstrap-zmi + +optimize for new bootstrap based ZMI + +Files changed: +M CHANGES.rst +M plone/__init__.py +M plone/app/__init__.py +M plone/app/customerize/registration.py +M plone/app/customerize/registrations.pt +M plone/app/customerize/tests/testDocTests.py +M plone/app/customerize/tool.py + +b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 3c6692d..c613369 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -15,6 +15,10 @@ New features:\n \n Bug fixes:\n \n+- make registrations.html look good in Bootstrap-ZMI,\n+ still working fine in old ZMI.\n+ [jensens]\n+\n - Fix templateViewRegistrationGroups and tests in py3.\n [pbauer]\n \ndiff --git a/plone/__init__.py b/plone/__init__.py\nindex 85880ef..68c04af 100644\n--- a/plone/__init__.py\n+++ b/plone/__init__.py\n@@ -1,7 +1,2 @@\n # -*- coding: utf-8 -*-\n-# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages\n-try:\n- __import__(\'pkg_resources\').declare_namespace(__name__)\n-except ImportError:\n- from pkgutil import extend_path\n- __path__ = extend_path(__path__, __name__)\n+__import__(\'pkg_resources\').declare_namespace(__name__)\ndiff --git a/plone/app/__init__.py b/plone/app/__init__.py\nindex 85880ef..68c04af 100644\n--- a/plone/app/__init__.py\n+++ b/plone/app/__init__.py\n@@ -1,7 +1,2 @@\n # -*- coding: utf-8 -*-\n-# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages\n-try:\n- __import__(\'pkg_resources\').declare_namespace(__name__)\n-except ImportError:\n- from pkgutil import extend_path\n- __path__ = extend_path(__path__, __name__)\n+__import__(\'pkg_resources\').declare_namespace(__name__)\ndiff --git a/plone/app/customerize/registration.py b/plone/app/customerize/registration.py\nindex 02e00bb..3ad7990 100644\n--- a/plone/app/customerize/registration.py\n+++ b/plone/app/customerize/registration.py\n@@ -4,6 +4,7 @@\n from five.customerize.interfaces import IViewTemplateContainer\n from five.customerize.utils import findViewletTemplate\n from five.customerize.zpt import TTWViewTemplate\n+from operator import itemgetter\n from os.path import basename\n from plone.browserlayer.interfaces import ILocalBrowserLayerType\n from plone.portlets.interfaces import IPortletRenderer\n@@ -13,7 +14,6 @@\n from zope.component import getUtility\n from zope.publisher.interfaces.browser import IBrowserRequest\n from zope.viewlet.interfaces import IViewlet\n-from operator import itemgetter\n \n \n def getViews(type):\ndiff --git a/plone/app/customerize/registrations.pt b/plone/app/customerize/registrations.pt\nindex e8fbce6..5ffdf77 100644\n--- a/plone/app/customerize/registrations.pt\n+++ b/plone/app/customerize/registrations.pt\n@@ -1,44 +1,35 @@\n

\n

\n \n-\n+
\n \n-
\n-

The following list shows all registered (template-based) views\n- sorted by interface. Click one of the links to see the contents\n- of the view template and possibly customize it. Views that already\n- have been customized are highlighted like\n- this.

\n-
\n+ \n \n-
\n-

ATTENTION: beware using this tool. Errors (e.g. TypeError,\n- Unauthorized etc) may popup if some kinds of\n- python: expressions are used in the template, making it\n- impossible to customize here (try z3c.jbot or regular zcml overrides\n- instead). The reason is that browser view templates are Zope 3 templates\n- while items in portal_view_customization are Zope 2 templates. The different\n- security models underlying the two implementations may break rendering of the\n- site. If that happens just delete the custom copy using the Contents tab\n- above.

\n+\n \n-
\n+

\n+ The following list shows all registered (template-based) views\n+ sorted by interface. Click one of the links to see the contents\n+ of the view template and possibly customize it. Views that already\n+ have been customized are highlighted like\n+ this.\n+

\n+\n
\n
\n
    \n@@ -54,10 +45,11 @@\n title info/zptfile;"\n tal:content="info/viewname">\n \n-
    \n+
    \n \n
\n
\n-
\n \n-

\n+

\n+\n+

\n\\ No newline at end of file\ndiff --git a/plone/app/customerize/tests/testDocTests.py b/plone/app/customerize/tests/testDocTests.py\nindex cd51685..3e18c65 100644\n--- a/plone/app/customerize/tests/testDocTests.py\n+++ b/plone/app/customerize/tests/testDocTests.py\n@@ -1,5 +1,7 @@\n # -*- coding: utf-8 -*-\n-from plone.app.customerize.testing import PLONE_APP_CUSTOMERIZE_FUNCTIONAL_TESTING # noqa\n+from plone.app.customerize.testing import (\n+ PLONE_APP_CUSTOMERIZE_FUNCTIONAL_TESTING # noqa\n+)\n from plone.testing import layered\n from unittest import TestSuite\n \n@@ -18,7 +20,7 @@ def check_output(self, want, got, optionflags):\n \n def test_suite():\n suite = TestSuite()\n- OPTIONFLAGS = (doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE)\n+ OPTIONFLAGS = doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE\n for testfile in (\'testBrowserLayers.txt\', \'testCustomizeView.txt\'):\n suite.addTest(\n layered(\n@@ -28,7 +30,7 @@ def test_suite():\n package=\'plone.app.customerize.tests\',\n checker=Py23DocChecker(),\n ),\n- layer=PLONE_APP_CUSTOMERIZE_FUNCTIONAL_TESTING\n+ layer=PLONE_APP_CUSTOMERIZE_FUNCTIONAL_TESTING,\n )\n )\n return suite\ndiff --git a/plone/app/customerize/tool.py b/plone/app/customerize/tool.py\nindex 3c8a7ba..dbeb642 100644\n--- a/plone/app/customerize/tool.py\n+++ b/plone/app/customerize/tool.py\n@@ -19,8 +19,10 @@ class ViewTemplateContainer(Folder):\n security = ClassSecurityInfo()\n \n manage_options = (\n- dict(label=\'Registrations\', action=\'registrations.html\'),\n- ) + Folder.manage_options[0:1] + Folder.manage_options[2:]\n+ (dict(label=\'Registrations\', action=\'registrations.html\'),) +\n+ Folder.manage_options[0:1] +\n+ Folder.manage_options[2:]\n+ )\n \n @security.protected(ManagePortal)\n def addTemplate(self, id, template):\n@@ -28,4 +30,5 @@ def addTemplate(self, id, template):\n self._setObject(id, template)\n return getattr(self, id)\n \n+\n InitializeClass(ViewTemplateContainer)\n'