Skip to content

Commit 4d85cef

Browse files
committed
Added control panel option to choose page break type for publipostage
1 parent 4ba3217 commit 4d85cef

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/collective/documentgenerator/browser/controlpanel.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,17 @@ class IDocumentGeneratorControlPanelSchema(Interface):
104104
description=_(u'If enabled, this will automatically apply the default page style on the firstparagraph'
105105
u'of a POD template using the "mailing" attribute (if no page style was set).'),
106106
required=False,
107-
default=False
107+
default=False,
108+
)
109+
110+
page_break_type = schema.Choice(
111+
title=_(u"Page break type"),
112+
description=_(
113+
u"Type of page break to use in the document. 'duplex' for recto/verso printing, 'simplex' otherwise."
114+
),
115+
vocabulary="collective.documentgenerator.PageBreakType",
116+
required=True,
117+
default="duplex",
108118
)
109119

110120

src/collective/documentgenerator/helper/dexterity.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ def get_relations(self, context=None, attribute=None, backrefs=False, as_obj=Fal
157157
context = self.real_context
158158
return ih_get_relations(context, attribute=attribute, backrefs=backrefs, as_obj=as_obj)
159159

160+
@property
161+
def page_break_type(self):
162+
registry = api.portal.get_tool(name="portal_registry")
163+
return registry[
164+
"collective.documentgenerator.browser.controlpanel.IDocumentGeneratorControlPanelSchema.page_break_type"
165+
]
166+
160167

161168
class DXDisplayProxyObject(DisplayProxyObject):
162169

0 commit comments

Comments
 (0)