class MiniHeaderForm(ControlPanelForm): """ Mini header form """ implements(IMiniHeaderForm) form_fields = form.FormFields(IMiniHeaderForm) label = _(u'Mini header settings') description = _(u'Select which contenttype will implement the mini header') form_name = _(u'')
class DocumentByLinePrefsForm(ControlPanelForm): """ The view class for the rights preferences form. """ implements(IDocumentByLinePrefsForm) form_fields = form.FormFields(IDocumentByLinePrefsForm) label = _(u'Document by line settings') description = _(u'Select which content type must show in documentbyline') form_name = _(u'')
class IMiniHeaderForm(Interface): """ Mini header form """ mini_header_for = schema.List( title=_(u'Portal types to enable mini header for'), description=_(u'header is displayed for the following portal types'), missing_value=tuple(), value_type=schema.Choice( vocabulary="plone.app.vocabularies.ReallyUserFriendlyTypes"), required=True)
class IMiniHeaderForm(Interface): """ Mini header form """ mini_header_for = schema.List( title=_(u'Portal types to enable mini header'), description=_( u'Mini header is displayed for the following portal types'), missing_value=tuple(), value_type=schema.Choice( vocabulary="plone.app.vocabularies.ReallyUserFriendlyTypes"), required=True) mini_header_light_for = schema.List( title=_(u'Portal types to enable light mini header'), description=_( u'Light header is displayed for the following portal types'), missing_value=tuple(), value_type=schema.Choice( vocabulary="plone.app.vocabularies.ReallyUserFriendlyTypes"), required=True) mini_header_light_header_image_for = schema.List( title=_(u'Portal types to enable light mini header context image'), description=_( u'Context image is displayed in the header for the following ' u'portal types'), missing_value=tuple(), value_type=schema.Choice( vocabulary="plone.app.vocabularies.ReallyUserFriendlyTypes"), required=True) mini_header_type_for = schema.List( title=_(u'Portal types to enable mini header portal type info'), description=_(u'Type is displayed for the following portal types'), missing_value=tuple(), value_type=schema.Choice( vocabulary="plone.app.vocabularies.ReallyUserFriendlyTypes"), required=True) mini_header_right_column_for = schema.List( title=_(u'Portal types to enable right column'), description=_( u'Navigation is displayed for the following portal types'), missing_value=tuple(), value_type=schema.Choice( vocabulary="plone.app.vocabularies.ReallyUserFriendlyTypes"), required=True)
def enable(self): """ Enable subfolder viewlet by providing ISubFoldersListing interface """ translations = self.context.getTranslations() for trans in translations.values(): alsoProvides(trans[0], ISubFoldersListing) trans[0].reindexObject(idxs='object_provides') self._redirect(_('SubfolderListing enabled'))
class IDocumentByLinePrefsForm(Interface): """ The view for document by line prefs form. """ metatypes_showpubdate = schema.List( title=_(u'Portal types show publication date'), description=_(u'info is displayed for the following portal types'), missing_value=tuple(), value_type=schema.Choice( vocabulary="plone.app.vocabularies.ReallyUserFriendlyTypes"), required=False) metatypes_showmoddate = schema.List( title=_(u'Portal types show modification date'), description=_(u'info is displayed for the following portal types'), missing_value=tuple(), value_type=schema.Choice( vocabulary="plone.app.vocabularies.ReallyUserFriendlyTypes"), required=False) metatypes_showcredate = schema.List( title=_(u'Portal types show creation date'), description=_(u'info is displayed for the following portal types'), missing_value=tuple(), value_type=schema.Choice( vocabulary="plone.app.vocabularies.ReallyUserFriendlyTypes"), required=False) metatypes_labeling_blacklist = schema.List( title=_(u'Portal types black list label'), description=_(u'label type is hidden for the following portal types'), missing_value=tuple(), value_type=schema.Choice( vocabulary="plone.app.vocabularies.ReallyUserFriendlyTypes"), required=False) allowed_types_rights = schema.List( title=_(u'Portal types show rights'), description=_( u'Copyright info is displayed for the following portal types'), missing_value=tuple(), value_type=schema.Choice( vocabulary="plone.app.vocabularies.ReallyUserFriendlyTypes"), required=False)
class ICaptchaSettings(Interface): """ Client settings for friendly captcha """ server = schema.TextLine( title=_(u"Captcha URL"), description=_(u"Captcha siteverify URL"), default=u"https://friendlycaptcha.com/api/v1/siteverify") username = schema.TextLine(title=_(u"Captcha API KEY"), description=(u"Captcha API KEY"), default=u"") password = schema.TextLine(title=_(u"Captcha API SECRET"), description=(u"Captcha API SECRET"), default=u"") timeout = schema.Int(title=_(u"Timeout"), description=_(u"Request timeout"), default=15)
class ControlPanelForm(controlpanel.RegistryEditForm): """ Captcha control panel""" id = "captcha" label = _(u"Captcha settings") schema = ICaptchaSettings