예제 #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
예제 #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)
예제 #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.')
예제 #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')),
])
예제 #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')
예제 #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')),
])