Esempio n. 1
0
class WatchingActionAddForm(AddForm):
    form_fields = form.FormFields(IWatchingAction)
    label = _(u'Add watching action')
    description = _(u'An action which can add or remove a user '
                    u'from the watchers list')
    form_name = _p(u'Configure element')

    def create(self, data):
        a = WatchingAction()
        form.applyChanges(a, self.form_fields, data)
        return a
Esempio n. 2
0
class IWatchingAction(interface.Interface):
    """Definition of the configuration available for a watching action."""

    watching = schema.Choice(title=_(u"Change watching"),
                             vocabulary=watchingChoice)

    name = schema.ASCIILine(title=_(u"Name of your adapter"),
                            description=_(u"Leave that empty if you don't"
                                          u" know what you're doing."),
                            missing_value='',
                            required=False)
Esempio n. 3
0
class WatchingAction(SimpleItem):
    interface.implements(IWatchingAction, IRuleElementData)

    watching = 'watch'
    name = ''
    element = 'collective.watcherlist.actions.Watching'
    summary = _(u'Change if the user is in the watchers list or not.')
Esempio n. 4
0
from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm

from collective.watcherlist.i18n import _

watchingChoice = SimpleVocabulary([
    SimpleTerm('watch', 'watch', _(u'Add to watchers list')),
    SimpleTerm('unwatch', 'unwatch', _(u'Remove from watchers list')),
])
Esempio n. 5
0
class WatchingActionEditForm(EditForm):
    form_fields = form.FormFields(IWatchingAction)
    label = _(u'Edit watching action')
    description = _(u'An action which can add or remove a user '
                    u'from the watchers list')
    form_name = _p(u'Configure element')
Esempio n. 6
0
from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm

from collective.watcherlist.i18n import _


watchingChoice = SimpleVocabulary([
    SimpleTerm('watch', 'watch', _(u'Add to watchers list')),
    SimpleTerm('unwatch', 'unwatch', _(u'Remove from watchers list')),
])