-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #371 from plone/pa-discussion-coreaddon
move plone.allowdiscussion behavior to plone.app.discussion
- Loading branch information
Showing
6 changed files
with
7 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
`plone.app.discussion` is now a core addon. | ||
The `plone.discussion` behavior class was moved over there. | ||
[@jensens] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,7 @@ | ||
from plone.app.dexterity import _ | ||
from plone.autoform import directives | ||
from plone.autoform.interfaces import IFormFieldProvider | ||
from plone.supermodel import model | ||
from z3c.form.interfaces import IAddForm | ||
from z3c.form.interfaces import IEditForm | ||
from zope import schema | ||
from zope.interface import provider | ||
from zope.schema.vocabulary import SimpleTerm | ||
from zope.schema.vocabulary import SimpleVocabulary | ||
from zope.deferredimport import deprecated | ||
|
||
|
||
options = SimpleVocabulary( | ||
[ | ||
SimpleTerm(value=True, title=_("Yes")), | ||
SimpleTerm(value=False, title=_("No")), | ||
] | ||
deprecated( | ||
"IAllowDiscussion import from here is deprecated. Import from plone.app.discussion.behaviors instead (will be removed in Plone 7)", | ||
IAllowDiscussion="plone.app.discussion.behaviors:IAllowDiscussion", | ||
) | ||
|
||
|
||
@provider(IFormFieldProvider) | ||
class IAllowDiscussion(model.Schema): | ||
model.fieldset( | ||
"settings", | ||
label=_("Settings"), | ||
fields=["allow_discussion"], | ||
) | ||
|
||
allow_discussion = schema.Choice( | ||
title=_("Allow discussion"), | ||
description=_("Allow discussion for this content object."), | ||
vocabulary=options, | ||
required=False, | ||
default=None, | ||
) | ||
|
||
directives.omitted("allow_discussion") | ||
directives.no_omit(IEditForm, "allow_discussion") | ||
directives.no_omit(IAddForm, "allow_discussion") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
|
||
|
||
tests = ( | ||
"discussion.txt", | ||
"editing.rst", | ||
"metadata.txt", | ||
"nextprevious.txt", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters