2010-07-13 12:41:26 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
2009-06-02 23:20:53 +02:00
|
|
|
|
|
|
|
from plone.app.registry.browser import controlpanel
|
|
|
|
|
|
|
|
from plone.app.discussion.interfaces import IDiscussionSettings, _
|
|
|
|
|
2009-11-19 22:40:08 +01:00
|
|
|
from z3c.form.browser.checkbox import SingleCheckBoxFieldWidget
|
|
|
|
|
2009-06-02 23:20:53 +02:00
|
|
|
|
|
|
|
class DiscussionSettingsEditForm(controlpanel.RegistryEditForm):
|
|
|
|
|
|
|
|
schema = IDiscussionSettings
|
|
|
|
label = _(u"Discussion settings")
|
2010-01-24 14:47:39 +01:00
|
|
|
description = _(u"help_discussion_settings_editform",
|
|
|
|
default=u"Some discussion related settings are not located "
|
|
|
|
"in the Discussion Control Panel.\n"
|
|
|
|
"To enable comments for a specific content type, "
|
|
|
|
"go to the Types Control Panel of this type and "
|
2010-08-06 11:34:05 +02:00
|
|
|
"choose 'Allow comments'.\n"
|
2010-01-24 14:47:39 +01:00
|
|
|
"To enable the moderation workflow for comments, "
|
|
|
|
"go to the Types Control Panel, choose \"Comment\" "
|
|
|
|
"and set workflow to \"Comment Review Workflow\".")
|
2009-06-02 23:20:53 +02:00
|
|
|
|
|
|
|
def updateFields(self):
|
|
|
|
super(DiscussionSettingsEditForm, self).updateFields()
|
2009-11-19 22:40:08 +01:00
|
|
|
self.fields['globally_enabled'].widgetFactory = SingleCheckBoxFieldWidget
|
|
|
|
self.fields['anonymous_comments'].widgetFactory = SingleCheckBoxFieldWidget
|
|
|
|
self.fields['show_commenter_image'].widgetFactory = SingleCheckBoxFieldWidget
|
2010-02-11 22:05:28 +01:00
|
|
|
self.fields['moderator_notification_enabled'].widgetFactory = SingleCheckBoxFieldWidget
|
2010-03-11 20:23:02 +01:00
|
|
|
#self.fields['user_notification_enabled'].widgetFactory = SingleCheckBoxFieldWidget
|
2009-06-02 23:20:53 +02:00
|
|
|
|
|
|
|
def updateWidgets(self):
|
|
|
|
super(DiscussionSettingsEditForm, self).updateWidgets()
|
2010-01-24 14:47:39 +01:00
|
|
|
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")
|
2010-02-11 22:05:28 +01:00
|
|
|
self.widgets['moderator_notification_enabled'].label = _(u"Moderator Email Notification")
|
2010-03-11 20:23:02 +01:00
|
|
|
#self.widgets['user_notification_enabled'].label = _(u"User Email Notification")
|
2009-11-19 22:40:08 +01:00
|
|
|
|
2009-06-02 23:20:53 +02:00
|
|
|
|
|
|
|
class DiscussionSettingsControlPanel(controlpanel.ControlPanelFormWrapper):
|
|
|
|
form = DiscussionSettingsEditForm
|