diff --git a/src/collective/documentgenerator/browser/controlpanel.py b/src/collective/documentgenerator/browser/controlpanel.py index 0e75df1c..d1352c74 100644 --- a/src/collective/documentgenerator/browser/controlpanel.py +++ b/src/collective/documentgenerator/browser/controlpanel.py @@ -104,7 +104,17 @@ class IDocumentGeneratorControlPanelSchema(Interface): description=_(u'If enabled, this will automatically apply the default page style on the firstparagraph' u'of a POD template using the "mailing" attribute (if no page style was set).'), required=False, - default=False + default=False, + ) + + page_break_type = schema.Choice( + title=_(u"Page break type"), + description=_( + u"Type of page break to use in the document. 'duplex' for recto/verso printing, 'simplex' otherwise." + ), + vocabulary="collective.documentgenerator.PageBreakType", + required=True, + default="duplex", ) diff --git a/src/collective/documentgenerator/content/vocabulary.py b/src/collective/documentgenerator/content/vocabulary.py index 2d3446ef..a035dffb 100644 --- a/src/collective/documentgenerator/content/vocabulary.py +++ b/src/collective/documentgenerator/content/vocabulary.py @@ -23,6 +23,21 @@ from zope.schema.vocabulary import SimpleVocabulary +class PageBreakTypeVocabularyFactory(object): + """ + Vocabulary factory for 'page_break_type' field. + """ + + def __call__(self, context): + vocabulary = SimpleVocabulary( + [ + SimpleTerm("simplex", "simplex", "simplex"), + SimpleTerm("duplex", "duplex", "duplex"), + ] + ) + return vocabulary + + class FormatsVocabularyFactory(object): """ Vocabulary factory for 'pod_formats' field. diff --git a/src/collective/documentgenerator/content/vocabulary.zcml b/src/collective/documentgenerator/content/vocabulary.zcml index 7e241044..2748ca1c 100644 --- a/src/collective/documentgenerator/content/vocabulary.zcml +++ b/src/collective/documentgenerator/content/vocabulary.zcml @@ -2,6 +2,13 @@ xmlns="http://namespaces.zope.org/zope" i18n_domain="collective.documentgenerator"> + + + + + + + diff --git a/src/collective/documentgenerator/profiles/demo/templates/mailing.odt b/src/collective/documentgenerator/profiles/demo/templates/mailing.odt index 0a766fc1..ec51f18e 100644 Binary files a/src/collective/documentgenerator/profiles/demo/templates/mailing.odt and b/src/collective/documentgenerator/profiles/demo/templates/mailing.odt differ