From 31a0268641b4e2b47caf8b5df4f47232d8e43cd3 Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Tue, 14 Aug 2012 16:05:02 +0200 Subject: [PATCH] [gen] Do not generate base label for a workflow transition if transition.show is False; added an alternative predefined layout for pages (including summary, which is absent by default); [pod] added a default POD style 'podPageBreak' allowing to include page breaks via do... from... statements. --- gen/generator.py | 9 +++++---- gen/layout.py | 8 +++++++- pod/styles.in.content.xml | 3 +++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/gen/generator.py b/gen/generator.py index 8adc831..3853d94 100644 --- a/gen/generator.py +++ b/gen/generator.py @@ -943,10 +943,11 @@ class ZopeGenerator(Generator): for name in dir(wfDescr.klass): transition = getattr(wfDescr.klass, name) if not isinstance(transition, gen.Transition): continue - poMsg = PoMessage('%s_%s' % (wfName, name), '', name) - poMsg.produceNiceDefault() - self.labels.append(poMsg) - if transition.confirm: + if transition.show: + poMsg = PoMessage('%s_%s' % (wfName, name), '', name) + poMsg.produceNiceDefault() + self.labels.append(poMsg) + if transition.show and transition.confirm: # We need to generate a label for the message that will be shown # in the confirm popup. label = '%s_%s_confirm' % (wfName, name) diff --git a/gen/layout.py b/gen/layout.py index f5a8af0..d1e03af 100644 --- a/gen/layout.py +++ b/gen/layout.py @@ -214,9 +214,15 @@ class Table(LayoutElement): if macroToRemove in cell['content']: cell['content'].remove(macroToRemove) -# ------------------------------------------------------------------------------ +# Some base layouts to use, for fields and pages ------------------------------- +# The default layouts for pages defaultPageLayouts = { 'view': Table('n!-w|-b|', align="center"), 'edit': Table('w|-b|', width=None)} +# A layout for pages, containing the page summary. +summaryPageLayouts = {'view': Table('s-n!-w|-b|', align="center"), + 'edit': Table('w|-b|', width=None)} +# The default layout for fields. Alternative layouts may exist and are declared +# as static attributes of the concerned Type subclass. defaultFieldLayouts = {'edit': 'lrv-f'} # ------------------------------------------------------------------------------ diff --git a/pod/styles.in.content.xml b/pod/styles.in.content.xml index fa34a1c..7697e1d 100644 --- a/pod/styles.in.content.xml +++ b/pod/styles.in.content.xml @@ -29,6 +29,9 @@ <@style@:style @style@:name="podSub" @style@:family="text"> <@style@:text-properties @style@:text-position="sub 58%"/> +<@style@:style @style@:name="podPageBreak" @style@:family="paragraph"> + <@style@:paragraph-properties @fo@:break-before="page"/> + <@style@:style @style@:name="podBulletItem" @style@:family="paragraph" @style@:list-style-name="podBulletedList"/> <@style@:style @style@:name="podNumberItem" @style@:family="paragraph" @style@:list-style-name="podNumberedList"/> <@style@:style @style@:name="podBulletItemKeepWithNext" @style@:family="paragraph"