Skip to content

Commit

Permalink
Merge pull request #124 from plone/thet-patternslibcompat
Browse files Browse the repository at this point in the history
Let the pattern configuration of the thememapper be in JSON format.
  • Loading branch information
agitator committed Apr 6, 2017
2 parents 39711e3 + 4e036e9 commit 67e7af2
Show file tree
Hide file tree
Showing 9 changed files with 8,515 additions and 6,816 deletions.
11 changes: 7 additions & 4 deletions CHANGES.rst
@@ -1,20 +1,23 @@
Changelog
=========

1.3.7 (unreleased)
------------------
1.4 (unreleased)
----------------

Breaking changes:

- *add item here*
- Let the pattern configuration of the thememapper be in JSON format.
Fixes problems of thememapper working together with latest patternslib (2.1.0).
[thet]

New features:

- *add item here*

Bug fixes:

- *add item here*
- Fix thememapper pattern handling of buttons (via mockup update).
[thet]


1.3.6 (2017-03-28)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -5,7 +5,7 @@
import os


version = '1.3.7.dev0'
version = '1.4.dev0'

longdescription = open("README.rst").read()
longdescription += "\n\n"
Expand Down
10 changes: 1 addition & 9 deletions src/plone/app/theming/browser/mapper.pt
Expand Up @@ -104,15 +104,7 @@

<section id="content-core">
<input tal:replace="structure context/@@authenticator/authenticator" />
<div class="pat-thememapper" data-pat-thememapper='themeUrl: ${view/resourceUrl};
editable: ${view/editable};
lessUrl: ${view/lessUrl};
lessVariables: ${view/lessVariables};
filemanagerConfig:{"actionUrl":"${view/themeBaseUrl}/@@plone.resourceeditor.filemanager-actions"};
mockupUrl:${view/themeBaseUrl}/@@theming-controlpanel-mapper-getframe?path=/${view/themeBasePathEncoded}/${view/defaultThemeFile}&amp;theme=off;
unthemedUrl:${view/themeBaseUrl}/@@theming-controlpanel-mapper-getframe?path=/&amp;diazo.off=1;
previewUrl:${view/portalUrl}/++theme++${view/name}/@@theming-controlpanel-mapper-getframe?path=/&amp;theme=apply&amp;forms=disable&amp;links=replace&amp;title=Preview:+${view/title};
helpUrl:http://docs.diazo.org/en/latest'></div>
<div class="pat-thememapper" data-pat-thememapper='${view/get_thememapper_config}'></div>
</section>
</article>
</div>
Expand Down
29 changes: 29 additions & 0 deletions src/plone/app/theming/browser/mapper.py
Expand Up @@ -27,6 +27,7 @@
from zope.component.hooks import getSite
from zope.publisher.browser import BrowserView

import json
import lxml.etree
import lxml.html
import lxml.html.builder
Expand Down Expand Up @@ -117,6 +118,34 @@ def update(self):

return True

def get_thememapper_config(self):
config = {
'themeUrl': self.resourceUrl,
'editable': self.editable,
'lessUrl': self.lessUrl,
'lessVariables': self.lessVariables,
'filemanagerConfig': {
'actionUrl': '{0}/@@plone.resourceeditor.filemanager-actions'.format( # noqa
self.themeBaseUrl
),
},
'mockupUrl': '{0}/@@theming-controlpanel-mapper-getframe?path=/{1}/{2}&theme=off'.format( # noqa
self.themeBaseUrl,
self.themeBasePathEncoded,
self.defaultThemeFile
),
'unthemedUrl': '{0}/@@theming-controlpanel-mapper-getframe?path=/&diazo.off=1'.format( # noqa
self.themeBaseUrl
),
'previewUrl': '{0}/++theme++{1}/@@theming-controlpanel-mapper-getframe?path=/&theme=apply&forms=disable&links=replace&title=Preview:+{2}'.format( # noqa
self.portalUrl,
self.name,
self.title
),
'helpUrl': 'http://docs.diazo.org/en/latest'
}
return json.dumps(config)

def authorize(self):
authenticator = getMultiAdapter((self.context, self.request),
name=u"authenticator")
Expand Down
222 changes: 106 additions & 116 deletions src/plone/app/theming/browser/resources/thememapper-compiled.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 67e7af2

Please sign in to comment.