merge r46437 and r46946 from davisagli-features: respect the per-comment mime_type setting, and use the old cooked text/html from legacy comments when migrating
svn path=/plone.app.discussion/trunk/; revision=48356
This commit is contained in:
@@ -80,7 +80,7 @@
|
||||
|
||||
<div class="commentBody">
|
||||
|
||||
<span tal:replace="structure python:view.cook(reply.getText())" />
|
||||
<span tal:replace="structure reply/getText" />
|
||||
|
||||
<div class="commentActions">
|
||||
<form name="delete"
|
||||
|
||||
@@ -271,17 +271,6 @@ class CommentsViewlet(ViewletBase):
|
||||
|
||||
# view methods
|
||||
|
||||
def cook(self, text):
|
||||
transforms = getToolByName(self, 'portal_transforms')
|
||||
targetMimetype = 'text/html'
|
||||
registry = queryUtility(IRegistry)
|
||||
settings = registry.forInterface(IDiscussionSettings, check=False)
|
||||
mimetype = settings.text_transform
|
||||
return transforms.convertTo(targetMimetype,
|
||||
text,
|
||||
context=self,
|
||||
mimetype=mimetype).getData()
|
||||
|
||||
def can_reply(self):
|
||||
"""Returns true if current user has the 'Reply to item' permission.
|
||||
"""
|
||||
|
||||
@@ -70,7 +70,8 @@ class View(BrowserView):
|
||||
# create a reply object
|
||||
comment = CommentFactory()
|
||||
comment.title = reply.Title()
|
||||
comment.text = reply.text
|
||||
comment.text = reply.cooked_text
|
||||
comment.mime_type = 'text/html'
|
||||
comment.creator = reply.Creator()
|
||||
|
||||
email = reply.getProperty('email', None)
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
tal:content="item/in_response_to" />
|
||||
</td>
|
||||
<td>
|
||||
<span tal:replace="structure python:view.cook(item.Description)" />
|
||||
<span tal:replace="structure item/Description" />
|
||||
<a href=""
|
||||
tal:attributes="href string:${item/getURL}/getText"
|
||||
tal:condition="python:item.Description.endswith('[...]')"
|
||||
|
||||
@@ -2,7 +2,6 @@ from Acquisition import aq_inner, aq_parent
|
||||
|
||||
from Products.Five.browser import BrowserView
|
||||
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
|
||||
from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
|
||||
|
||||
from Products.CMFCore.utils import getToolByName
|
||||
|
||||
@@ -37,9 +36,6 @@ class View(BrowserView):
|
||||
sort_order='reverse')
|
||||
return self.template()
|
||||
|
||||
def cook(self, text):
|
||||
return text
|
||||
|
||||
def moderation_enabled(self):
|
||||
"""Returns true if a 'review workflow' is enabled on 'Discussion Item'
|
||||
content type. A 'review workflow' is characterized by implementing
|
||||
|
||||
Reference in New Issue
Block a user