diff --git a/CHANGES.rst b/CHANGES.rst index 17628e7..b646add 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -14,6 +14,8 @@ New features: Bug fixes: +- Show email in moderation view [ksuess] + - Remove plone.app.robotframework extras (reload and ride). They are not needed and they are not Python 3 compatible. [gforcada] diff --git a/docs/source/conf.py b/docs/source/conf.py index d2a393e..71374d4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -17,7 +17,7 @@ import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.append(os.path.abspath('.')) +# sys.path.append(os.path.abspath('.')) # -- General configuration ---------------------------------------------------- @@ -95,7 +95,7 @@ pygments_style = 'sphinx' #modindex_common_prefix = [] -# -- Options for HTML output --------------------------------------------------- +# -- Options for HTML output --------------------------------------------- # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. @@ -169,7 +169,7 @@ html_static_path = ['_static'] htmlhelp_basename = 'ploneappdiscussiondoc' -# -- Options for LaTeX output -------------------------------------------------- +# -- Options for LaTeX output -------------------------------------------- # The paper size ('letter' or 'a4'). #latex_paper_size = 'letter' @@ -180,8 +180,8 @@ htmlhelp_basename = 'ploneappdiscussiondoc' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'ploneappdiscussion.tex', u'plone.app.discussion Documentation', - u'Timo Stollenwerk', 'manual'), + ('index', 'ploneappdiscussion.tex', u'plone.app.discussion Documentation', + u'Timo Stollenwerk', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of diff --git a/docs/source/howtos/howto_extend_the_comment_form.txt b/docs/source/howtos/howto_extend_the_comment_form.txt index 6f3b604..605e0ef 100644 --- a/docs/source/howtos/howto_extend_the_comment_form.txt +++ b/docs/source/howtos/howto_extend_the_comment_form.txt @@ -47,7 +47,7 @@ comment form with the "website" field:: from zope import schema from zope.annotation import factory - from zope.component import adapts + from zope.component import adapter from zope.interface import Interface from zope.publisher.interfaces.browser import IDefaultBrowserLayer @@ -61,9 +61,9 @@ comment form with the "website" field:: website = schema.TextLine(title=u"Website", required=False) # Persistent class that implements the ICommentExtenderFields interface + @adapter(Comment) class CommentExtenderFields(Persistent): interface.implements(ICommentExtenderFields) - adapts(Comment) website = u"" # CommentExtenderFields factory @@ -71,9 +71,8 @@ comment form with the "website" field:: # Extending the comment form with the fields defined in the # ICommentExtenderFields interface. + @adapter(Interface, IDefaultBrowserLayer, CommentForm) class CommentExtender(extensible.FormExtender): - adapts(Interface, IDefaultBrowserLayer, CommentForm) - fields = Fields(ICommentExtenderFields) def __init__(self, context, request, form): diff --git a/plone/app/discussion/browser/captcha.py b/plone/app/discussion/browser/captcha.py index ffbda2f..090fce9 100644 --- a/plone/app/discussion/browser/captcha.py +++ b/plone/app/discussion/browser/captcha.py @@ -12,29 +12,30 @@ from z3c.form import interfaces from z3c.form.field import Fields from zope import interface from zope.annotation import factory -from zope.component import adapts +from zope.component import adapter from zope.component import queryUtility from zope.interface import Interface from zope.publisher.interfaces.browser import IDefaultBrowserLayer +@adapter(Comment) @interface.implementer(ICaptcha) class Captcha(Persistent): """Captcha input field. """ - adapts(Comment) - captcha = u"" + captcha = u'' + Captcha = factory(Captcha) +# context, request, form +@adapter(Interface, IDefaultBrowserLayer, CommentForm) class CaptchaExtender(extensible.FormExtender): """Extends the comment form with a Captcha. This Captcha extender is only registered when a plugin is installed that provides the "plone.app.discussion-captcha" feature. """ - # context, request, form - adapts(Interface, IDefaultBrowserLayer, CommentForm) fields = Fields(ICaptcha) @@ -65,5 +66,3 @@ class CaptchaExtender(extensible.FormExtender): self.form.fields['captcha'].widgetFactory = NorobotsFieldWidget else: self.form.fields['captcha'].mode = interfaces.HIDDEN_MODE - - diff --git a/plone/app/discussion/browser/comment.py b/plone/app/discussion/browser/comment.py index 6b9b5d3..ab5f32d 100644 --- a/plone/app/discussion/browser/comment.py +++ b/plone/app/discussion/browser/comment.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 from AccessControl import getSecurityManager from Acquisition import aq_inner from Acquisition import aq_parent @@ -112,6 +112,5 @@ class EditCommentForm(CommentForm): type='info') return self._redirect(target=self.context.absolute_url()) -EditComment = wrap_form(EditCommentForm) -# EOF +EditComment = wrap_form(EditCommentForm) diff --git a/plone/app/discussion/browser/moderation.pt b/plone/app/discussion/browser/moderation.pt index d89fff0..fbe0136 100644 --- a/plone/app/discussion/browser/moderation.pt +++ b/plone/app/discussion/browser/moderation.pt @@ -88,7 +88,8 @@