class ImpressControlPanelForm(RegistryEditForm): schema = IImpressControlPanel schema_prefix = "senaite.impress" label = _("SENAITE IMPRESS Settings")
def __call__(self, context): items = [] for format in ["portrait", "landscape"]: items.append(SimpleTerm(format, format, _(format))) return SimpleVocabulary(items)
class IImpressControlPanel(Interface): """Controlpanel Settings """ default_template = schema.Choice( title=_(u"Default Template"), description=_("Initially loaded report template"), vocabulary="senaite.impress.vocabularies.Templates", default="senaite.impress:MultiDefault.pt", required=True, ) default_paperformat = schema.Choice( title=_(u"Default Paper Format"), description=_("Initially loaded paper format"), vocabulary="senaite.impress.vocabularies.Paperformats", default="A4", required=True, ) default_orientation = schema.Choice( title=_(u"Default Orientation"), description=_("Initially loaded orientation"), vocabulary="senaite.impress.vocabularies.Orientations", default="portrait", required=True, ) store_multireports_individually = schema.Bool( title=_(u"Store Multi-Report PDFs Individually"), description=_("Store generated multi-report PDFs individually. " "Turn off to store the multi-report PDF only for the " "primary item of the report"), default=True, required=False, ) footer = schema.Text( title=_(u"Footer Text"), description=_("The footer text will be rendered on every PDF page " "and may contain arbitrary HTML"), default=u"", required=False, ) developer_mode = schema.Bool( title=_(u"Developer Mode"), description=_("Returns the raw HTML in the report preview."), default=False, required=False, )