-
-
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: 2015-09-17T18:47:58+02:00 Author: esteele (esteele) <eric@esteele.net> Commit: plone/plone.locking@e628817 Use registry lookup for types_use_view_action_in_listings Files changed: M CHANGES.rst M plone/locking/browser/locking.py Repository: plone.locking Branch: refs/heads/master Date: 2015-09-18T09:52:52+02:00 Author: esteele (esteele) <eric@esteele.net> Commit: plone/plone.locking@f18ec0c Fix registry id Files changed: M plone/locking/browser/locking.py Repository: plone.locking Branch: refs/heads/master Date: 2015-09-20T17:29:45+02:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: plone/plone.locking@532a94e Merge pull request #8 from plone/portal-properties-cleanup Portal properties cleanup Files changed: M CHANGES.rst M plone/locking/browser/locking.py
- Loading branch information
Showing
1 changed file
with
123 additions
and
61 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,116 +1,178 @@ | ||
Repository: plone.portlet.collection | ||
Repository: plone.locking | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2015-09-17T18:51:20+02:00 | ||
Date: 2015-09-17T18:47:58+02:00 | ||
Author: esteele (esteele) <eric@esteele.net> | ||
Commit: https://github.com/plone/plone.portlet.collection/commit/f008aca65a72ddb5d7fba86302de2898656c6866 | ||
Commit: https://github.com/plone/plone.locking/commit/e628817a86afd18ee7a23cd0e2f7189c69e6808f | ||
|
||
Use registry lookup for types_use_view_action_in_listings | ||
|
||
Files changed: | ||
M CHANGES.rst | ||
M plone/portlet/collection/collection.pt | ||
M plone/locking/browser/locking.py | ||
|
||
diff --git a/CHANGES.rst b/CHANGES.rst | ||
index ded20c0..c84e2aa 100644 | ||
index cc9a64e..4f49fa6 100644 | ||
--- a/CHANGES.rst | ||
+++ b/CHANGES.rst | ||
@@ -4,7 +4,8 @@ Changelog | ||
3.0.5 (unreleased) | ||
@@ -4,13 +4,15 @@ Changelog | ||
2.1.1 (unreleased) | ||
------------------ | ||
|
||
-- Nothing changed yet. | ||
+- Use registry lookup for types_use_view_action_in_listings | ||
+ [esteele] | ||
|
||
|
||
3.0.4 (2015-09-07) | ||
diff --git a/plone/portlet/collection/collection.pt b/plone/portlet/collection/collection.pt | ||
index bc42e2f..e28de26 100644 | ||
--- a/plone/portlet/collection/collection.pt | ||
+++ b/plone/portlet/collection/collection.pt | ||
@@ -3,7 +3,7 @@ | ||
tal:define="collection_url view/collection_url; | ||
plone_view context/@@plone; | ||
toLocalizedTime nocall:plone_view/toLocalizedTime; | ||
- viewActions here/portal_properties/site_properties/typesUseViewActionInListings|python:();" | ||
+ viewActions python:context.portal_registry.get('plone.types_view_action_in_listings', []);" | ||
tal:attributes="class string:portlet portletCollection ${view/css_class}"><header class="portletHeader"> | ||
<span class="portletTopLeft"></span> | ||
<a tal:attributes="href collection_url" tal:omit-tag="not:view/data/show_more"> | ||
2.1.0 (2015-09-07) | ||
------------------ | ||
|
||
-- Pull lock_on_ttw_edit setting from | ||
+- Pull lock_on_ttw_edit setting from the configuration registry | ||
+ [esteele] | ||
|
||
|
||
2.0.8 (2015-07-20) | ||
diff --git a/plone/locking/browser/locking.py b/plone/locking/browser/locking.py | ||
index 0a48808..9910c83 100644 | ||
--- a/plone/locking/browser/locking.py | ||
+++ b/plone/locking/browser/locking.py | ||
@@ -1,5 +1,6 @@ | ||
|
||
from Acquisition import aq_inner | ||
+from zope.component import getUtility | ||
from Products.Five import BrowserView | ||
from Products.CMFCore.utils import getToolByName | ||
|
||
@@ -7,6 +8,7 @@ | ||
from datetime import timedelta | ||
|
||
from plone.locking.interfaces import ILockable, IRefreshableLockable | ||
+from plone.registry.interfaces import IRegistry | ||
from zope.i18nmessageid import MessageFactory | ||
|
||
_ = MessageFactory('plone') | ||
@@ -26,11 +28,11 @@ def force_unlock(self, redirect=True): | ||
lockable.unlock() | ||
if redirect: | ||
url = self.context.absolute_url() | ||
- props_tool = getToolByName(self.context, 'portal_properties') | ||
- if props_tool: | ||
- types_use_view = props_tool.site_properties.typesUseViewActionInListings | ||
- if self.context.portal_type in types_use_view: | ||
- url += '/view' | ||
+ registry = getUtility(IRegistry) | ||
+ types_use_view = registry.get( | ||
+ 'plone.types_view_action_in_listings', []) | ||
+ if self.context.portal_type in types_use_view: | ||
+ url += '/view' | ||
|
||
self.request.RESPONSE.redirect(url) | ||
|
||
|
||
|
||
Repository: plone.portlet.collection | ||
Repository: plone.locking | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2015-09-18T09:53:02+02:00 | ||
Date: 2015-09-18T09:52:52+02:00 | ||
Author: esteele (esteele) <eric@esteele.net> | ||
Commit: https://github.com/plone/plone.portlet.collection/commit/55aacdd27eb6b776abc1463fe17ceaae8a62df1d | ||
Commit: https://github.com/plone/plone.locking/commit/f18ec0c43dfdbdf948ff8f2bd385c25e4c724ef3 | ||
|
||
Fix registry id | ||
|
||
Files changed: | ||
M plone/portlet/collection/collection.pt | ||
|
||
diff --git a/plone/portlet/collection/collection.pt b/plone/portlet/collection/collection.pt | ||
index e28de26..16eeb51 100644 | ||
--- a/plone/portlet/collection/collection.pt | ||
+++ b/plone/portlet/collection/collection.pt | ||
@@ -3,7 +3,7 @@ | ||
tal:define="collection_url view/collection_url; | ||
plone_view context/@@plone; | ||
toLocalizedTime nocall:plone_view/toLocalizedTime; | ||
- viewActions python:context.portal_registry.get('plone.types_view_action_in_listings', []);" | ||
+ viewActions python:context.portal_registry.get('plone.types_use_view_action_in_listings', []);" | ||
tal:attributes="class string:portlet portletCollection ${view/css_class}"><header class="portletHeader"> | ||
<span class="portletTopLeft"></span> | ||
<a tal:attributes="href collection_url" tal:omit-tag="not:view/data/show_more"> | ||
M plone/locking/browser/locking.py | ||
|
||
diff --git a/plone/locking/browser/locking.py b/plone/locking/browser/locking.py | ||
index 9910c83..4832f36 100644 | ||
--- a/plone/locking/browser/locking.py | ||
+++ b/plone/locking/browser/locking.py | ||
@@ -30,7 +30,7 @@ def force_unlock(self, redirect=True): | ||
url = self.context.absolute_url() | ||
registry = getUtility(IRegistry) | ||
types_use_view = registry.get( | ||
- 'plone.types_view_action_in_listings', []) | ||
+ 'plone.types_use_view_action_in_listings', []) | ||
if self.context.portal_type in types_use_view: | ||
url += '/view' | ||
|
||
|
||
|
||
Repository: plone.portlet.collection | ||
Repository: plone.locking | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2015-09-20T17:29:27+02:00 | ||
Date: 2015-09-20T17:29:45+02:00 | ||
Author: Philip Bauer (pbauer) <bauer@starzel.de> | ||
Commit: https://github.com/plone/plone.portlet.collection/commit/ed93dbf8961dca89b1b19a54d96962804c6b0357 | ||
Commit: https://github.com/plone/plone.locking/commit/532a94ec445addbefa28b877ac685c962805250f | ||
|
||
Merge pull request #9 from plone/portal-properties-cleanup | ||
Merge pull request #8 from plone/portal-properties-cleanup | ||
|
||
Portal properties cleanup | ||
|
||
Files changed: | ||
M CHANGES.rst | ||
M plone/portlet/collection/collection.pt | ||
M plone/locking/browser/locking.py | ||
|
||
diff --git a/CHANGES.rst b/CHANGES.rst | ||
index ded20c0..c84e2aa 100644 | ||
index cc9a64e..4f49fa6 100644 | ||
--- a/CHANGES.rst | ||
+++ b/CHANGES.rst | ||
@@ -4,7 +4,8 @@ Changelog | ||
3.0.5 (unreleased) | ||
@@ -4,13 +4,15 @@ Changelog | ||
2.1.1 (unreleased) | ||
------------------ | ||
|
||
-- Nothing changed yet. | ||
+- Use registry lookup for types_use_view_action_in_listings | ||
+ [esteele] | ||
|
||
|
||
3.0.4 (2015-09-07) | ||
diff --git a/plone/portlet/collection/collection.pt b/plone/portlet/collection/collection.pt | ||
index bc42e2f..16eeb51 100644 | ||
--- a/plone/portlet/collection/collection.pt | ||
+++ b/plone/portlet/collection/collection.pt | ||
@@ -3,7 +3,7 @@ | ||
tal:define="collection_url view/collection_url; | ||
plone_view context/@@plone; | ||
toLocalizedTime nocall:plone_view/toLocalizedTime; | ||
- viewActions here/portal_properties/site_properties/typesUseViewActionInListings|python:();" | ||
+ viewActions python:context.portal_registry.get('plone.types_use_view_action_in_listings', []);" | ||
tal:attributes="class string:portlet portletCollection ${view/css_class}"><header class="portletHeader"> | ||
<span class="portletTopLeft"></span> | ||
<a tal:attributes="href collection_url" tal:omit-tag="not:view/data/show_more"> | ||
2.1.0 (2015-09-07) | ||
------------------ | ||
|
||
-- Pull lock_on_ttw_edit setting from | ||
+- Pull lock_on_ttw_edit setting from the configuration registry | ||
+ [esteele] | ||
|
||
|
||
2.0.8 (2015-07-20) | ||
diff --git a/plone/locking/browser/locking.py b/plone/locking/browser/locking.py | ||
index 0a48808..4832f36 100644 | ||
--- a/plone/locking/browser/locking.py | ||
+++ b/plone/locking/browser/locking.py | ||
@@ -1,5 +1,6 @@ | ||
|
||
from Acquisition import aq_inner | ||
+from zope.component import getUtility | ||
from Products.Five import BrowserView | ||
from Products.CMFCore.utils import getToolByName | ||
|
||
@@ -7,6 +8,7 @@ | ||
from datetime import timedelta | ||
|
||
from plone.locking.interfaces import ILockable, IRefreshableLockable | ||
+from plone.registry.interfaces import IRegistry | ||
from zope.i18nmessageid import MessageFactory | ||
|
||
_ = MessageFactory('plone') | ||
@@ -26,11 +28,11 @@ def force_unlock(self, redirect=True): | ||
lockable.unlock() | ||
if redirect: | ||
url = self.context.absolute_url() | ||
- props_tool = getToolByName(self.context, 'portal_properties') | ||
- if props_tool: | ||
- types_use_view = props_tool.site_properties.typesUseViewActionInListings | ||
- if self.context.portal_type in types_use_view: | ||
- url += '/view' | ||
+ registry = getUtility(IRegistry) | ||
+ types_use_view = registry.get( | ||
+ 'plone.types_use_view_action_in_listings', []) | ||
+ if self.context.portal_type in types_use_view: | ||
+ url += '/view' | ||
|
||
self.request.RESPONSE.redirect(url) | ||
|
||
|
||
|