diff --git a/last_commit.txt b/last_commit.txt index 81d0beb1dd..ee5e7b1e13 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -1,92 +1,95 @@ -Repository: plone.app.theming +Repository: plone.app.discussion Branch: refs/heads/master -Date: 2016-03-11T13:55:15+01:00 +Date: 2016-03-11T14:16:22+01:00 Author: Johannes Raggam (thet) -Commit: https://github.com/plone/plone.app.theming/commit/4e088e46e30f2ddfd4a71d751fdafb7cf3e2dfde +Commit: https://github.com/plone/plone.app.discussion/commit/ec7fe25b6cc246aad07a3b892ae8b518f6851ef6 Use ``getSite()`` instead of portal url -Change base URLs from portal URL to what getSite returns, but don't change the theming controlpanel context binding. +For the discussion controlpanel, change base URLs from portal URL to what getSite returns, but don't change the controlpanels context binding. This allows for more flexibility when configuring it to be allowed on a sub site with a local registry. Files changed: M CHANGES.rst -M src/plone/app/theming/browser/controlpanel.pt -M src/plone/app/theming/browser/controlpanel.py +M plone/app/discussion/browser/controlpanel.pt +M plone/app/discussion/browser/controlpanel.py diff --git a/CHANGES.rst b/CHANGES.rst -index 4a849cb..d2600af 100644 +index f7cb874..011a53a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst -@@ -10,7 +10,9 @@ Incompatibilities: +@@ -6,7 +6,9 @@ Changelog New: -- *add item here* -+- Change base URLs from portal URL to what getSite returns, but don't change the theming controlpanel context binding. ++- For the discussion controlpanel, change base URLs from portal URL to what getSite returns, but don't change the controlpanels context binding. + This allows for more flexibility when configuring it to be allowed on a sub site with a local registry. + [thet] Fixes: -diff --git a/src/plone/app/theming/browser/controlpanel.pt b/src/plone/app/theming/browser/controlpanel.pt -index f1e7b6a..7f1c45f 100644 ---- a/src/plone/app/theming/browser/controlpanel.pt -+++ b/src/plone/app/theming/browser/controlpanel.pt -@@ -12,7 +12,8 @@ - view nocall:view | nocall: plone_view; - portal_url portal_state/portal_url; - ajax_load python:False; -- dummy python: request.set('disable_toolbar', True);" -+ dummy python: request.set('disable_toolbar', True); -+ site_url view/site_url" - tal:attributes="lang lang;"> - - -@@ -72,9 +73,9 @@ - i18n:translate="heading_theme_settings">Theme settings - - -- Up to Site Setup -+ tal:attributes="href string:$site_url/@@overview-controlpanel" -+ i18n:translate=""> -+ Site Setup - - - -@@ -100,12 +101,12 @@ - data-pat-plone-modal="width: 80%" - i18n:translate="">Upload Zip file - -- Test Styles - -- + Mail control panel + + to fix this. +@@ -42,7 +42,7 @@ + + Types control panel + + to choose a workflow for the 'Discussion Item' type. +@@ -61,7 +61,7 @@ + + migrate your comments + + to fix this. +@@ -73,9 +73,9 @@ + + + +- Site Setup ++ tal:attributes="href string:${view/site_url}/@@overview-controlpanel" ++ i18n:translate=""> ++ Site Setup + + +

View Title

+@@ -87,7 +87,7 @@ + + + + + +diff --git a/plone/app/discussion/browser/controlpanel.py b/plone/app/discussion/browser/controlpanel.py +index 4f19619..b21a6dc 100644 +--- a/plone/app/discussion/browser/controlpanel.py ++++ b/plone/app/discussion/browser/controlpanel.py +@@ -104,6 +104,13 @@ class DiscussionSettingsControlPanel(controlpanel.ControlPanelFormWrapper): + form = DiscussionSettingsEditForm + index = ViewPageTemplateFile('controlpanel.pt') + @property + def site_url(self): @@ -95,196 +98,103 @@ index 46cd766..4bf8798 100644 + """ + return getSite().absolute_url() + - def __call__(self): - self.pskin = getToolByName(self.context, 'portal_skins') - -@@ -102,10 +110,7 @@ def update(self): - - if 'form.button.Cancel' in form: - IStatusMessage(self.request).add(_(u"Changes cancelled")) -- -- portalUrl = getToolByName(self.context, 'portal_url')() -- self.redirect("{0:s}/@@overview-controlpanel".format(portalUrl)) -- -+ self.redirect("{0}/@@overview-controlpanel".format(self.site_url)) - return False - - if 'form.button.Enable' in form: -@@ -310,10 +315,9 @@ def update(self): - self.theme_settings.enabled = True - - if not self.errors: -- portalUrl = getToolByName(self.context, 'portal_url')() - self.redirect( - "{0}/++theme++{1}/@@theming-controlpanel-mapper".format( -- portalUrl, -+ self.site_url, - themeData.__name__ - ) - ) -@@ -366,10 +370,9 @@ def update(self): - applyTheme(themeData) - self.theme_settings.enabled = True - -- portalUrl = getToolByName(self.context, 'portal_url')() - self.redirect( - "{0}/++theme++{1}/@@theming-controlpanel-mapper".format( -- portalUrl, -+ self.site_url, - name - ) - ) -@@ -414,9 +417,7 @@ def themeList(self): - themes = [] - zodbNames = [t.__name__ for t in self.zodbThemes] - -- portalUrl = getToolByName(self.context, 'portal_url')() -- -- complete = []; -+ complete = [] - active_theme = None - - for theme in self.availableThemes: -@@ -448,7 +449,7 @@ def themeList(self): - 'description': theme.description, - 'override': override, - 'editable': theme.__name__ in zodbNames, -- 'preview': "{0}/{1}".format(portalUrl, previewUrl), -+ 'preview': "{0}/{1}".format(self.site_url, previewUrl), - 'selected': theme.__name__ == self.selectedTheme, - } - if theme.__name__ == self.selectedTheme: -@@ -465,10 +466,9 @@ def themeList(self): - return themes - - def redirectToFieldset(self, fieldset): -- portalUrl = getToolByName(self.context, 'portal_url')() - self.redirect( - "{0}/{1}#fieldsetlegend-{2}".format( -- portalUrl, -+ self.site_url, - self.__name__, - fieldset - ) - - -Repository: plone.app.theming - - -Branch: refs/heads/master -Date: 2016-03-11T14:10:16+01:00 -Author: Johannes Raggam (thet) -Commit: https://github.com/plone/plone.app.theming/commit/2d36d66858e96b41d481d128344b57bb6652e344 - -typo - -Files changed: -M CHANGES.rst - -diff --git a/CHANGES.rst b/CHANGES.rst -index d2600af..9b9f97d 100644 ---- a/CHANGES.rst -+++ b/CHANGES.rst -@@ -10,7 +10,7 @@ Incompatibilities: - - New: - --- Change base URLs from portal URL to what getSite returns, but don't change the theming controlpanel context binding. -+- For the theming controlpanel, change base URLs from portal URL to what getSite returns, but don't change the controlpanels context binding. - This allows for more flexibility when configuring it to be allowed on a sub site with a local registry. - [thet] - + def settings(self): + """Compose a string that contains all registry settings that are + needed for the discussion control panel. -Repository: plone.app.theming +Repository: plone.app.discussion Branch: refs/heads/master -Date: 2016-03-14T11:06:33+01:00 +Date: 2016-03-14T11:06:43+01:00 Author: Jens W. Klein (jensens) -Commit: https://github.com/plone/plone.app.theming/commit/a075790856c1e1c478e57fb4192e3a671104c763 +Commit: https://github.com/plone/plone.app.discussion/commit/12d5347ca82e8f0aee91f1652cadeb80b6552f8a -Merge pull request #100 from plone/thet_site_url +Merge pull request #87 from plone/thet-control-panel-url Use ``getSite()`` instead of portal url Files changed: M CHANGES.rst -M src/plone/app/theming/browser/controlpanel.pt -M src/plone/app/theming/browser/controlpanel.py +M plone/app/discussion/browser/controlpanel.pt +M plone/app/discussion/browser/controlpanel.py diff --git a/CHANGES.rst b/CHANGES.rst -index 4a849cb..9b9f97d 100644 +index f7cb874..011a53a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst -@@ -10,7 +10,9 @@ Incompatibilities: +@@ -6,7 +6,9 @@ Changelog New: -- *add item here* -+- For the theming controlpanel, change base URLs from portal URL to what getSite returns, but don't change the controlpanels context binding. ++- For the discussion controlpanel, change base URLs from portal URL to what getSite returns, but don't change the controlpanels context binding. + This allows for more flexibility when configuring it to be allowed on a sub site with a local registry. + [thet] Fixes: -diff --git a/src/plone/app/theming/browser/controlpanel.pt b/src/plone/app/theming/browser/controlpanel.pt -index f1e7b6a..7f1c45f 100644 ---- a/src/plone/app/theming/browser/controlpanel.pt -+++ b/src/plone/app/theming/browser/controlpanel.pt -@@ -12,7 +12,8 @@ - view nocall:view | nocall: plone_view; - portal_url portal_state/portal_url; - ajax_load python:False; -- dummy python: request.set('disable_toolbar', True);" -+ dummy python: request.set('disable_toolbar', True); -+ site_url view/site_url" - tal:attributes="lang lang;"> - - -@@ -72,9 +73,9 @@ - i18n:translate="heading_theme_settings">Theme settings - - -- Up to Site Setup -+ tal:attributes="href string:$site_url/@@overview-controlpanel" -+ i18n:translate=""> -+ Site Setup - - - -@@ -100,12 +101,12 @@ - data-pat-plone-modal="width: 80%" - i18n:translate="">Upload Zip file - -- Test Styles - -- + Mail control panel + + to fix this. +@@ -42,7 +42,7 @@ + + Types control panel + + to choose a workflow for the 'Discussion Item' type. +@@ -61,7 +61,7 @@ + + migrate your comments + + to fix this. +@@ -73,9 +73,9 @@ + + + +- Site Setup ++ tal:attributes="href string:${view/site_url}/@@overview-controlpanel" ++ i18n:translate=""> ++ Site Setup + + +

View Title

+@@ -87,7 +87,7 @@ + + + + + +diff --git a/plone/app/discussion/browser/controlpanel.py b/plone/app/discussion/browser/controlpanel.py +index 4f19619..b21a6dc 100644 +--- a/plone/app/discussion/browser/controlpanel.py ++++ b/plone/app/discussion/browser/controlpanel.py +@@ -104,6 +104,13 @@ class DiscussionSettingsControlPanel(controlpanel.ControlPanelFormWrapper): + form = DiscussionSettingsEditForm + index = ViewPageTemplateFile('controlpanel.pt') + @property + def site_url(self): @@ -293,76 +203,8 @@ index 46cd766..4bf8798 100644 + """ + return getSite().absolute_url() + - def __call__(self): - self.pskin = getToolByName(self.context, 'portal_skins') - -@@ -102,10 +110,7 @@ def update(self): - - if 'form.button.Cancel' in form: - IStatusMessage(self.request).add(_(u"Changes cancelled")) -- -- portalUrl = getToolByName(self.context, 'portal_url')() -- self.redirect("{0:s}/@@overview-controlpanel".format(portalUrl)) -- -+ self.redirect("{0}/@@overview-controlpanel".format(self.site_url)) - return False - - if 'form.button.Enable' in form: -@@ -310,10 +315,9 @@ def update(self): - self.theme_settings.enabled = True - - if not self.errors: -- portalUrl = getToolByName(self.context, 'portal_url')() - self.redirect( - "{0}/++theme++{1}/@@theming-controlpanel-mapper".format( -- portalUrl, -+ self.site_url, - themeData.__name__ - ) - ) -@@ -366,10 +370,9 @@ def update(self): - applyTheme(themeData) - self.theme_settings.enabled = True - -- portalUrl = getToolByName(self.context, 'portal_url')() - self.redirect( - "{0}/++theme++{1}/@@theming-controlpanel-mapper".format( -- portalUrl, -+ self.site_url, - name - ) - ) -@@ -414,9 +417,7 @@ def themeList(self): - themes = [] - zodbNames = [t.__name__ for t in self.zodbThemes] - -- portalUrl = getToolByName(self.context, 'portal_url')() -- -- complete = []; -+ complete = [] - active_theme = None - - for theme in self.availableThemes: -@@ -448,7 +449,7 @@ def themeList(self): - 'description': theme.description, - 'override': override, - 'editable': theme.__name__ in zodbNames, -- 'preview': "{0}/{1}".format(portalUrl, previewUrl), -+ 'preview': "{0}/{1}".format(self.site_url, previewUrl), - 'selected': theme.__name__ == self.selectedTheme, - } - if theme.__name__ == self.selectedTheme: -@@ -465,10 +466,9 @@ def themeList(self): - return themes - - def redirectToFieldset(self, fieldset): -- portalUrl = getToolByName(self.context, 'portal_url')() - self.redirect( - "{0}/{1}#fieldsetlegend-{2}".format( -- portalUrl, -+ self.site_url, - self.__name__, - fieldset - ) + def settings(self): + """Compose a string that contains all registry settings that are + needed for the discussion control panel.