-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Branch: refs/heads/master Date: 2019-04-11T21:56:04+02:00 Author: Jens W. Klein (jensens) <[email protected]> Commit: plone/plone.dexterity@7d1c83f easier container selection in subclasses Files changed: A news/101.feature M plone/dexterity/browser/add.py Repository: plone.dexterity Branch: refs/heads/master Date: 2019-04-12T09:18:34+02:00 Author: agitator (agitator) <[email protected]> Commit: plone/plone.dexterity@b49ceee Merge pull request #101 from plone/jensens/better-subclassing-capabilities easier container selection in subclasses Files changed: A news/101.feature M plone/dexterity/browser/add.py
- Loading branch information
Showing
1 changed file
with
17 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
Repository: plone.app.multilingual | ||
Repository: plone.dexterity | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2019-04-11T14:23:42+02:00 | ||
Author: Peter Holzer (agitator) <[email protected]> | ||
Commit: https://github.com/plone/plone.app.multilingual/commit/d079a05d33da49df736d4d14aba980523a2cd87b | ||
Date: 2019-04-11T21:56:04+02:00 | ||
Author: Jens W. Klein (jensens) <[email protected]> | ||
Commit: https://github.com/plone/plone.dexterity/commit/7d1c83f637a84f20b870494eed9ffaf4e8cf4b00 | ||
|
||
Fix toolbar icon | ||
easier container selection in subclasses | ||
|
||
Files changed: | ||
A news/338.bugfix | ||
M src/plone/app/multilingual/browser/stylesheet/multilingual.css | ||
A news/101.feature | ||
M plone/dexterity/browser/add.py | ||
|
||
b"diff --git a/news/338.bugfix b/news/338.bugfix\nnew file mode 100644\nindex 00000000..4e80877c\n--- /dev/null\n+++ b/news/338.bugfix\n@@ -0,0 +1,2 @@\n+Fix toolbar icon\n+[agitator]\n\\ No newline at end of file\ndiff --git a/src/plone/app/multilingual/browser/stylesheet/multilingual.css b/src/plone/app/multilingual/browser/stylesheet/multilingual.css\nindex a737487c..0cf9f640 100644\n--- a/src/plone/app/multilingual/browser/stylesheet/multilingual.css\n+++ b/src/plone/app/multilingual/browser/stylesheet/multilingual.css\n@@ -71,7 +71,7 @@ a.contentmenuflags img {\n margin-bottom: 2pt;\n }\n \n-.plone-icon-contentmenu-multilingual:before { content: '\\e81A'; } /* '\xee\xa0\xa0' */\n+.toolbar-menu-icon.icon-plone-contentmenu-multilingual:before { content: '\\E81A'; } /* '\xee\xa0\xb6' */\n \n #translations-overview td {\n line-height: 1;\n" | ||
b'diff --git a/news/101.feature b/news/101.feature\nnew file mode 100644\nindex 0000000..cee7125\n--- /dev/null\n+++ b/news/101.feature\n@@ -0,0 +1 @@\n+Add container property to ``AddForm`` to simplify target container selection in subclasses. [jensens]\ndiff --git a/plone/dexterity/browser/add.py b/plone/dexterity/browser/add.py\nindex 6fe0750..0c05d86 100644\n--- a/plone/dexterity/browser/add.py\n+++ b/plone/dexterity/browser/add.py\n@@ -50,12 +50,20 @@ def __init__(self, context, request, ti=None):\n def additionalSchemata(self):\n return getAdditionalSchemata(portal_type=self.portal_type)\n \n- # API\n+ @property\n+ def container(self):\n+ """find container\n+\n+ return container object.\n \n+ In subclasses this could be used to point to a different container.\n+ """\n+ return aq_inner(self.context)\n+\n+ # API\n def create(self, data):\n fti = getUtility(IDexterityFTI, name=self.portal_type)\n \n- container = aq_inner(self.context)\n content = createObject(fti.factory)\n \n # Note: The factory may have done this already, but we want to be sure\n@@ -69,7 +77,7 @@ def create(self, data):\n # Acquisition wrap temporarily to satisfy things like vocabularies\n # depending on tools\n if IAcquirer.providedBy(content):\n- content = content.__of__(container)\n+ content = content.__of__(self.container)\n \n _applyChanges(self, content, data, force=True)\n for group in self.groups:\n@@ -80,16 +88,15 @@ def create(self, data):\n def add(self, object):\n \n fti = getUtility(IDexterityFTI, name=self.portal_type)\n- container = aq_inner(self.context)\n- new_object = addContentToContainer(container, object)\n+ new_object = addContentToContainer(self.container, object)\n \n if fti.immediate_view:\n self.immediate_view = "/".join(\n- [container.absolute_url(), new_object.id, fti.immediate_view]\n+ [self.container.absolute_url(), new_object.id, fti.immediate_view]\n )\n else:\n self.immediate_view = "/".join(\n- [container.absolute_url(), new_object.id]\n+ [self.container.absolute_url(), new_object.id]\n )\n \n def nextURL(self):\n' | ||
|
||
Repository: plone.app.multilingual | ||
Repository: plone.dexterity | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2019-04-11T14:25:27+02:00 | ||
Author: Jens W. Klein (jensens) <[email protected]> | ||
Commit: https://github.com/plone/plone.app.multilingual/commit/f80b2ba9689c21e1282715b77a6873a4bf631fed | ||
Date: 2019-04-12T09:18:34+02:00 | ||
Author: agitator (agitator) <[email protected]> | ||
Commit: https://github.com/plone/plone.dexterity/commit/b49ceee681b4ffb5e8c440ea2de5a50bd5590ec7 | ||
|
||
Merge pull request #338 from plone/fix-toolbar-icon | ||
Merge pull request #101 from plone/jensens/better-subclassing-capabilities | ||
|
||
Fix toolbar icon | ||
easier container selection in subclasses | ||
|
||
Files changed: | ||
A news/338.bugfix | ||
M src/plone/app/multilingual/browser/stylesheet/multilingual.css | ||
A news/101.feature | ||
M plone/dexterity/browser/add.py | ||
|
||
b"diff --git a/news/338.bugfix b/news/338.bugfix\nnew file mode 100644\nindex 00000000..4e80877c\n--- /dev/null\n+++ b/news/338.bugfix\n@@ -0,0 +1,2 @@\n+Fix toolbar icon\n+[agitator]\n\\ No newline at end of file\ndiff --git a/src/plone/app/multilingual/browser/stylesheet/multilingual.css b/src/plone/app/multilingual/browser/stylesheet/multilingual.css\nindex a737487c..0cf9f640 100644\n--- a/src/plone/app/multilingual/browser/stylesheet/multilingual.css\n+++ b/src/plone/app/multilingual/browser/stylesheet/multilingual.css\n@@ -71,7 +71,7 @@ a.contentmenuflags img {\n margin-bottom: 2pt;\n }\n \n-.plone-icon-contentmenu-multilingual:before { content: '\\e81A'; } /* '\xee\xa0\xa0' */\n+.toolbar-menu-icon.icon-plone-contentmenu-multilingual:before { content: '\\E81A'; } /* '\xee\xa0\xb6' */\n \n #translations-overview td {\n line-height: 1;\n" | ||
b'diff --git a/news/101.feature b/news/101.feature\nnew file mode 100644\nindex 0000000..cee7125\n--- /dev/null\n+++ b/news/101.feature\n@@ -0,0 +1 @@\n+Add container property to ``AddForm`` to simplify target container selection in subclasses. [jensens]\ndiff --git a/plone/dexterity/browser/add.py b/plone/dexterity/browser/add.py\nindex 6fe0750..0c05d86 100644\n--- a/plone/dexterity/browser/add.py\n+++ b/plone/dexterity/browser/add.py\n@@ -50,12 +50,20 @@ def __init__(self, context, request, ti=None):\n def additionalSchemata(self):\n return getAdditionalSchemata(portal_type=self.portal_type)\n \n- # API\n+ @property\n+ def container(self):\n+ """find container\n+\n+ return container object.\n \n+ In subclasses this could be used to point to a different container.\n+ """\n+ return aq_inner(self.context)\n+\n+ # API\n def create(self, data):\n fti = getUtility(IDexterityFTI, name=self.portal_type)\n \n- container = aq_inner(self.context)\n content = createObject(fti.factory)\n \n # Note: The factory may have done this already, but we want to be sure\n@@ -69,7 +77,7 @@ def create(self, data):\n # Acquisition wrap temporarily to satisfy things like vocabularies\n # depending on tools\n if IAcquirer.providedBy(content):\n- content = content.__of__(container)\n+ content = content.__of__(self.container)\n \n _applyChanges(self, content, data, force=True)\n for group in self.groups:\n@@ -80,16 +88,15 @@ def create(self, data):\n def add(self, object):\n \n fti = getUtility(IDexterityFTI, name=self.portal_type)\n- container = aq_inner(self.context)\n- new_object = addContentToContainer(container, object)\n+ new_object = addContentToContainer(self.container, object)\n \n if fti.immediate_view:\n self.immediate_view = "/".join(\n- [container.absolute_url(), new_object.id, fti.immediate_view]\n+ [self.container.absolute_url(), new_object.id, fti.immediate_view]\n )\n else:\n self.immediate_view = "/".join(\n- [container.absolute_url(), new_object.id]\n+ [self.container.absolute_url(), new_object.id]\n )\n \n def nextURL(self):\n' | ||
|