notification enabled field added to discussion control panel.

svn path=/plone.app.discussion/branches/notification/; revision=33869
This commit is contained in:
Timo Stollenwerk
2010-02-08 15:02:17 +00:00
parent de3bb53c13
commit 26031cd1f4
3 changed files with 18 additions and 1 deletions
+5 -1
View File
@@ -62,12 +62,16 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
def updateWidgets(self):
super(CommentForm, self).updateWidgets()
self.widgets['in_reply_to'].mode = interfaces.HIDDEN_MODE
portal_membership = getToolByName(self.context, 'portal_membership')
self.widgets['text'].addClass("autoresize")
self.widgets['author_notification'].label = _(u"")
portal_membership = getToolByName(self.context, 'portal_membership')
if not portal_membership.isAnonymousUser():
self.widgets['author_name'].mode = interfaces.HIDDEN_MODE
self.widgets['author_email'].mode = interfaces.HIDDEN_MODE
registry = queryUtility(IRegistry)
settings = registry.forInterface(IDiscussionSettings)
if not settings.notification_enabled:
self.widgets['author_notification'].mode = interfaces.HIDDEN_MODE
def updateActions(self):
super(CommentForm, self).updateActions()
@@ -29,12 +29,14 @@ class DiscussionSettingsEditForm(controlpanel.RegistryEditForm):
self.fields['globally_enabled'].widgetFactory = SingleCheckBoxFieldWidget
self.fields['anonymous_comments'].widgetFactory = SingleCheckBoxFieldWidget
self.fields['show_commenter_image'].widgetFactory = SingleCheckBoxFieldWidget
self.fields['notification_enabled'].widgetFactory = SingleCheckBoxFieldWidget
def updateWidgets(self):
super(DiscussionSettingsEditForm, self).updateWidgets()
self.widgets['globally_enabled'].label = _(u"Enable Comments")
self.widgets['anonymous_comments'].label = _(u"Anonymous Comments")
self.widgets['show_commenter_image'].label = _(u"Commenter Image")
self.widgets['notification_enabled'].label = _(u"Email Notification")
class DiscussionSettingsControlPanel(controlpanel.ControlPanelFormWrapper):