File tree Expand file tree Collapse file tree 8 files changed +40
-10
lines changed Expand file tree Collapse file tree 8 files changed +40
-10
lines changed Original file line number Diff line number Diff line change
1
+ Introduce the ajax_load theme parameter and skip diazo theming, if set.
Original file line number Diff line number Diff line change 7
7
8
8
<include package =" plone.resource" />
9
9
<include package =" plone.app.theming" />
10
+ <include package =" .upgrades" />
10
11
11
12
<!-- Diazo themes -->
12
13
<plone : static
23
24
directory =" profiles/default"
24
25
/>
25
26
26
- <!-- upgrade step -->
27
- <genericsetup : upgradeDepends
28
- title =" Upgrade registry"
29
- profile =" plonetheme.barceloneta:default"
30
- source =" 1"
31
- destination =" 2"
32
- import_steps =" plone.app.registry"
33
- />
34
-
35
27
</configure >
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
2
<metadata >
3
- <version >2 </version >
3
+ <version >3 </version >
4
4
<dependencies >
5
5
<dependency >profile-plone.app.theming:default</dependency >
6
6
</dependencies >
Original file line number Diff line number Diff line change @@ -16,4 +16,5 @@ development-js =
16
16
production-js =
17
17
18
18
[theme:parameters]
19
+ ajax_load = python:request.get(' ajax_load' )
19
20
portal_url = portal_state/portal_url
Original file line number Diff line number Diff line change 9
9
<!-- <xi:include href="++theme++barceloneta/grid-col-marker.xml"/> -->
10
10
11
11
<theme href =" index.html" />
12
+ <notheme if =" $ajax_load" /><!-- don't theme ajax requests -->
12
13
<notheme css : if-not-content =" #visual-portal-wrapper" />
13
14
<notheme css : if-content =" .template-manage-viewlets" />
14
15
Original file line number Diff line number Diff line change
1
+ <configure
2
+ xmlns =" http://namespaces.zope.org/zope"
3
+ xmlns : genericsetup =" http://namespaces.zope.org/genericsetup"
4
+ >
5
+
6
+ <genericsetup : upgradeDepends
7
+ title =" Upgrade registry"
8
+ profile =" plonetheme.barceloneta:default"
9
+ source =" 1"
10
+ destination =" 2"
11
+ import_steps =" plone.app.registry"
12
+ />
13
+
14
+ <genericsetup : upgradeStep
15
+ title =" Add ajax_load theme parameter."
16
+ profile =" plonetheme.barceloneta:default"
17
+ source =" 2"
18
+ destination =" 3"
19
+ handler =" .upgrades.reload_theme"
20
+ />
21
+
22
+ </configure >
Original file line number Diff line number Diff line change
1
+ from plone .app .theming import utils as theme_utils
2
+
3
+ import logging
4
+
5
+ logger = logging .getLogger (__name__ )
6
+
7
+
8
+ def reload_theme (context ):
9
+ # Reload theme to add ajax_load theme parameter.
10
+ if theme_utils .getCurrentTheme () == "barceloneta" :
11
+ theme = theme_utils .getTheme ("barceloneta" )
12
+ theme_utils .applyTheme (theme )
13
+ logger .info ("Reloaded Barceloneta." )
You can’t perform that action at this time.
0 commit comments