--- a/src/pyams_content/shared/view/theme.py Fri Nov 13 13:08:48 2020 +0100
+++ b/src/pyams_content/shared/view/theme.py Fri Nov 13 13:11:29 2020 +0100
@@ -10,8 +10,6 @@
# FOR A PARTICULAR PURPOSE.
#
-__docformat__ = 'restructuredtext'
-
from hypatia.interfaces import ICatalog
from hypatia.query import Any
from persistent import Persistent
@@ -32,6 +30,9 @@
from pyams_utils.registry import get_utility, query_utility
+__docformat__ = 'restructuredtext'
+
+
#
# Tags management
#
@@ -118,6 +119,7 @@
select_context_themes = FieldProperty(IViewThemesSettings['select_context_themes'])
themes = FieldProperty(IViewThemesSettings['themes'])
+ include_subthemes = FieldProperty(IViewThemesSettings['include_subthemes'])
@property
def is_using_context(self):
@@ -131,6 +133,9 @@
themes |= set(themes_info.themes or ())
if self.themes:
themes |= set(self.themes)
+ if self.include_subthemes:
+ for theme in themes.copy():
+ themes |= set(theme.gel_all_childs())
return themes
def get_themes_index(self, context):