commit
ac1ac4ae4a
@ -14,7 +14,8 @@ New features:
|
||||
|
||||
Bug fixes:
|
||||
|
||||
- *add item here*
|
||||
- More Python 2 / 3 compatibility.
|
||||
[pbauer]
|
||||
|
||||
|
||||
3.0.5 (2018-02-04)
|
||||
|
@ -2,7 +2,7 @@
|
||||
from AccessControl import getSecurityManager
|
||||
from Acquisition import aq_inner
|
||||
from Acquisition import aq_parent
|
||||
from comments import CommentForm
|
||||
from .comments import CommentForm
|
||||
from plone.app.discussion import _
|
||||
from plone.registry.interfaces import IRegistry
|
||||
from plone.z3cform.layout import wrap_form
|
||||
|
@ -19,7 +19,7 @@ from plone.z3cform.interfaces import IWrappedForm
|
||||
from Products.CMFCore.utils import getToolByName
|
||||
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
|
||||
from Products.statusmessages.interfaces import IStatusMessage
|
||||
from urllib import quote as url_quote
|
||||
from six.moves.urllib.parse import quote
|
||||
from z3c.form import button
|
||||
from z3c.form import field
|
||||
from z3c.form import form
|
||||
@ -537,7 +537,7 @@ class CommentsViewlet(ViewletBase):
|
||||
def login_action(self):
|
||||
return '{0}/login_form?came_from={1}'.format(
|
||||
self.navigation_root_url,
|
||||
url_quote(self.request.get('URL', '')),
|
||||
quote(self.request.get('URL', '')),
|
||||
)
|
||||
|
||||
def format_time(self, time):
|
||||
|
@ -12,7 +12,6 @@ from plone.uuid.interfaces import IUUID
|
||||
from Products.CMFCore.interfaces import IContentish
|
||||
from Products.CMFPlone.utils import safe_unicode
|
||||
from Products.ZCatalog.interfaces import IZCatalog
|
||||
from string import join
|
||||
|
||||
|
||||
MAX_DESCRIPTION = 25
|
||||
@ -77,7 +76,7 @@ def creator(object):
|
||||
@indexer(IComment)
|
||||
def description(object):
|
||||
# Return the first 25 words of the comment text and append ' [...]'
|
||||
text = join(object.getText(targetMimetype='text/plain').split()[:MAX_DESCRIPTION])
|
||||
text = ' '.join(object.getText(targetMimetype='text/plain').split()[:MAX_DESCRIPTION])
|
||||
if len(object.getText().split()) > 25:
|
||||
text += ' [...]'
|
||||
return text
|
||||
|
@ -727,7 +727,7 @@ class TestCommentsViewlet(unittest.TestCase):
|
||||
)
|
||||
|
||||
def test_format_time(self):
|
||||
python_time = datetime(2009, 02, 01, 23, 32, 03, 57)
|
||||
python_time = datetime(2009, 2, 1, 23, 32, 3, 57)
|
||||
# Python Time must be utc time. There seems to be no too simple way
|
||||
# to tell datetime to be of utc time.
|
||||
# therefor, we convert the time to seconds since epoch, which seems
|
||||
|
@ -5,8 +5,8 @@ standard portal_catalog for indexing comments.
|
||||
|
||||
BBB support for the old portal_discussion is provided in the bbb package.
|
||||
"""
|
||||
from interfaces import IComment
|
||||
from interfaces import ICommentingTool
|
||||
from .interfaces import IComment
|
||||
from .interfaces import ICommentingTool
|
||||
from OFS.SimpleItem import SimpleItem
|
||||
from Products.CMFCore.utils import getToolByName
|
||||
from Products.CMFCore.utils import UniqueObject
|
||||
|
Loading…
Reference in New Issue
Block a user