--- a/src/pyams_default_theme/component/paragraph/milestone.py Wed Nov 14 09:52:13 2018 +0100
+++ b/src/pyams_default_theme/component/paragraph/milestone.py Thu Nov 15 17:55:49 2018 +0100
@@ -12,7 +12,9 @@
__docformat__ = 'restructuredtext'
-from pyams_content.component.paragraph.interfaces.milestone import IMilestoneParagraph
+from pyramid.decorator import reify
+
+from pyams_content.component.paragraph.interfaces.milestone import IMilestoneParagraph, IMilestoneContainer
from pyams_content.features.renderer.interfaces import IContentRenderer
from pyams_default_theme.features.renderer import BaseContentRenderer
from pyams_skin.layer import IPyAMSLayer
@@ -35,3 +37,14 @@
weight = 1
i18n_context_attrs = ('title', 'body')
+
+ @reify
+ def milestones(self):
+ return IMilestoneContainer(self.context)
+
+ @property
+ def has_anchors(self):
+ for milestone in self.milestones.values():
+ if milestone.anchor is not None:
+ return True
+ return False