class SetEffectiveDateEditForm(EditForm): """An edit form for the action """ label = _(u"Edit Set effective/publishing date action") description = _(u"Set effective/publishing date if missing; " + u"add an entry in object's workflow history") form_name = _(u"Configure action") form_fields = form.FormFields(ISetEffectiveDateAction)
class ExcludeFromNavEditForm(EditForm): """ An edit form for the exclude from navigation contentrules action """ form_fields = form.FormFields(IExcludeFromNavAction) label = _(u"Edit an exclude from navigation content rules action") description = FORM_DESC form_name = FORM_NAME
class MailEditForm(EditForm): """ An edit form for the mail action """ form_fields = form.FormFields(IMailAction) label = _(u"Edit Templated Mail Action") description = _(u"Email using template variables.") form_name = _(u"Configure element")
class VCGEEditForm(EditForm): """ Formulario de edicao para condicoes de VCGE """ form_fields = form.FormFields(IVCGECondition) label = _(u"Editar condição VCGE") description = FORM_DESC form_name = FORM_NAME
class MoveToFieldEditForm(EditForm): """An edit form for local roles action. """ form_fields = form.FormFields(IMoveToFieldAction) label = _(u"Edit a Move to Field Action") description = _(u"An action that moves content to a folder defined by a " u"field.") schema = IMoveToFieldAction
class PDFControlPanel(ControlPanelForm): label = _(u'label_controlpanel', default=u"PDF book settings") description = _(u'help_controlpanel', default=u"Your site wide options for PDF book") form_name = label form_fields = form.FormFields(IPDFOptions)
class TalesExpressionEditForm(EditForm): """An edit form for TALES expression condition """ form_fields = form.FormFields(ITalesExpressionCondition) label = _(u"Edit TALES Expression Condition") description = _(u"A TALES expression condition makes the rule apply " "only if TALES expression is not False in context.") form_name = _(u"Configure element")
class PingCREditForm(EditForm): """ Ping action editform """ form_fields = form.FormFields(IPingCRAction) schema = IPingCRAction label = u"Edit Ping CR Action" description = u"A ping cr action." form_name = u"Configure element"
class GroupEditForm(EditForm): """An edit form for group conditions """ form_fields = form.FormFields(IGroupCondition) label = _(u"Edit Group Condition") description = _(u"A group condition can prevent a rule from executing " "unless the current user is a member of a particular group.") form_name = _(u"Configure element")
class ExternalEditorControlPanel(ControlPanelForm): """ """ form_fields = form.FormFields(IExternalEditorSchema) label = _("External Editor settings") description = _("External Editor settings.") form_name = _("External Editor settings")
class OrganizeEditForm(EditForm): """An edit form for move rule actions. Formlib does all the magic here. """ form_fields = form.FormFields(IOrganizeAction) label = u"Edit Organize Action" description = u"A move action can organize objects in your site." form_name = u"Configure element"
class LanguageEditForm(EditForm): """ An edit form for the set Language contentrules action """ form_fields = form.FormFields(ILanguageAction) label = _(u"Edit the set Language content rules action") description = FORM_DESC form_name = FORM_NAME
class EDRNSiteCollaborationsMailEditForm(MailEditForm): '''Form to show when editing an EDRN Site Collaborations mail action.''' form_fields = form.FormFields(IEDRNSiteCollaborationsMailAction) label = _(u'Edit EDRN Collaborations Mail Action') description = _( u'A mail action for EDRN collaborative groups that ignores transmission errors.' ) form_name = _(u'Configure EDRN Site Collaborations element')
class EventView(EventViewMixin, DisplayFormBase): """View for IEvent. """ template = ViewPageTemplateFile('templates/event_view.pt') form_fields = form.FormFields(IEventSchema)
class MailEditForm(EditForm): """ An edit form for the mail action """ form_fields = form.FormFields(IMailAction) label = _(u"Edit Mail Action") description = _(u"A mail action can mail different recipient.") form_name = _(u"Configure element")
def form_fields(self): form_fields = form.FormFields(ISearchSchema) form_fields['review_state'].custom_widget = ChoiceMultiSelectWidget form_fields['Subject'].custom_widget = ChoiceMultiSelectWidget form_fields['portal_type'].custom_widget = ChoiceMultiSelectWidget if not self._checkPermission(ReviewPortalContent): form_fields = form_fields.omit('review_state') return form_fields
class SetFieldEditForm(EditForm): """An edit form for local roles action.""" form_fields = form.FormFields(ISetFieldAction) label = _(u"Edit a Set Field Action") description = _(u"An action for setting the value of a field on an object." ) # noqa: E501 schema = ISetFieldAction
class MovedPrenotazioneEditForm(EditForm): """ An edit form for the mail action """ form_fields = form.FormFields(IMovedPrenotazioneAction) label = _(u"Edit moved booking Mail Action") description = _(u"A mail action that sends email notify when a booking is moved in an other slot.") form_name = _(u"Configure element")
class CreatorsEditForm(EditForm): """ An edit form for the set Creators contentrules action """ form_fields = form.FormFields(ICreatorsAction) label = _(u"Edit the set Creators content rules action") description = FORM_DESC form_name = FORM_NAME
class MailGroupEditForm(EditForm): """ An edit form for the mail action """ form_fields = form.FormFields(IMailGroupAction) label = _(u'Edit Mail group Action') description = _(u'A mail action can mail different recipient.') form_name = _(u'Configure element') form_fields['groups'].custom_widget = UberMultiSelectionWidget form_fields['members'].custom_widget = UberMultiSelectionWidget
class SubjectEditForm(EditForm): """ An edit form for the set Tags contentrules action """ form_fields = form.FormFields(ISubjectAction) label = _(u"Edit the set Tags content rules action") description = FORM_DESC form_name = FORM_NAME
class RelatedItemsEditForm(EditForm): """ An add form for the related items action """ form_fields = form.FormFields(IRelatedItemsAction) label = _(u"Add Related Items Action") description = _(u"Change workflow state for related items.") form_name = _(u"Configure element")
class NewsMailEditForm(EditForm): """ An edit form for the mail action """ form_fields = form.FormFields(INewsMailAction) label = _(u"Edit Mail Action") description = _(u"Send the item by email to different recipient.") form_name = _(u"Configure element")
class EventEditView(EventViewMixin, ContentEditFormBase): """Edit view for IMutableEvent. """ form_fields = form.FormFields(IEventSchema) form_fields['start_date'].custom_widget = DatetimeI18nWidget form_fields['stop_date'].custom_widget = DatetimeI18nWidget
class MustReadEditForm(EditForm): """ An edit form for the mail action """ form_fields = form.FormFields(IMustReadAction) label = _(u'title_editform', default=u"Edit MustRead Action") description = form_description form_name = _p(u"Configure element")
class Site(SettingsEditFormBase): """Enable or disable syndication for a site.""" form_fields = form.FormFields(ISyndicationInfo).omit('enabled') label = _(u"Configure Portal Syndication") actions = form.Actions( form.Action( name="enable", label=_(u"Enable Syndication"), condition="disabled", success="handle_enable", ), form.Action( name="change", label=_(u"Change"), condition="enabled", success="handle_change", ), form.Action( name="disable", label=_(u"Disable Syndication"), condition="enabled", success="handle_disable" ) ) redirect = ("portal_actions", "global/syndication") @memoize def getContent(self): syndtool = getUtility(ISyndicationTool) return syndtool @memoize def enabled(self, action=None): return self.getContent().enabled @memoize def disabled(self, action=None): return not self.getContent().enabled def handle_enable(self, action, data): self.getContent().enable() self._handle_success(action, data) self.status = _(u"Syndication enabled.") self._setRedirect(*self.redirect) def handle_change(self, action, data): self._handle_success(action, data) self.status = _(u"Syndication settings changed.") self._setRedirect(*self.redirect) def handle_disable(self, action, data): self.getContent().disable() self.status = _(u"Syndication disabled.") self._setRedirect(*self.redirect)
class ChannelEditForm(EditForm): """ An edit form for the mail action """ form_fields = form.FormFields(IChannelAction) label = _(u'Edit S&D Newsletter Action') description = _( u'A S&D Newsletter action can send an item as a newsletter') form_name = _(u'Configure element')
class MarscatSettingsControlPanel(ControlPanelForm): """A simple form to manage mars categories.""" form_fields = form.FormFields(IMarscatSettings) form_fields['fields'].custom_widget = fields_widget label = _(u'Mars Categories Settings') description = _(u"Fields to Mars Categories to fields mappings.") form_name = _(u'Categories Settings')
class SiteControlPanel(ControlPanelForm): form_fields = form.FormFields(ISiteSchema) form_fields['site_description'].custom_widget = MiniTextAreaWidget form_fields['webstats_js'].custom_widget = SmallTextAreaWidget label = _('Site settings') description = _('Site-wide settings.') form_name = _('Site settings')
def content_fields(self): """Create content field objects only for batched items""" f = IFolderItem['select'] contents = [] b_start = self._getBatchStart() key, reverse = self._get_sorting() fields = form.FormFields() for idx, item in enumerate(self._getBatchObj()): field = form.FormField(f, 'select', item.id) fields += form.FormFields(field) content = ContentProxy(item) if key == 'position': content.position = b_start + idx + 1 else: content.position = '...' contents.append(content) self.listBatchItems = contents return fields