Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 368 lines (282 sloc) 14.272 kb
424d1c7 z3c.form form added to commentsviewlet (not fully functional yet).
Timo Stollenwerk authored
1 ### OLD ###
2
2b0133a documentByLine added to the comments viewlet (to localized time is no…
Timo Stollenwerk authored
3 from datetime import datetime
3d43434 comments viewlet's format_time now returns localized time.
Timo Stollenwerk authored
4 from DateTime import DateTime
2b0133a documentByLine added to the comments viewlet (to localized time is no…
Timo Stollenwerk authored
5
aa50c33 show login form instead of the commenting form to anonymous users.
Timo Stollenwerk authored
6 from urllib import quote as url_quote
7
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
8 from zope.interface import implements
660ee78 User Story: As a visitor, I can view portraits, full name and usernam…
Timo Stollenwerk authored
9
353c6ac anonymous comments added.
Timo Stollenwerk authored
10 from zope.component import createObject, getMultiAdapter, queryUtility
660ee78 User Story: As a visitor, I can view portraits, full name and usernam…
Timo Stollenwerk authored
11
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
12 from zope.viewlet.interfaces import IViewlet
895105b added viewlet that overrides the standard plone commenting viewlet (n…
Timo Stollenwerk authored
13
8fb254f add optional workflow actions to the get_replies method of the commen…
Timo Stollenwerk authored
14 from Acquisition import aq_inner, aq_parent, aq_base
660ee78 User Story: As a visitor, I can view portraits, full name and usernam…
Timo Stollenwerk authored
15
2ecd5e7 check if discussion is allowed for the comments viewlet.
Timo Stollenwerk authored
16 from AccessControl import getSecurityManager
17
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
18 from Products.Five.browser import BrowserView
895105b added viewlet that overrides the standard plone commenting viewlet (n…
Timo Stollenwerk authored
19 from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
20
660ee78 User Story: As a visitor, I can view portraits, full name and usernam…
Timo Stollenwerk authored
21 from Products.CMFCore.utils import getToolByName
22
b7b0b18 very basic form validation added to comments viewlet.
Timo Stollenwerk authored
23 from Products.CMFPlone import PloneMessageFactory as _
f85acfa Adding missing import for IStatusMessage, fixes validation. evilbungl…
Timo Stollenwerk authored
24 from Products.statusmessages.interfaces import IStatusMessage
b7b0b18 very basic form validation added to comments viewlet.
Timo Stollenwerk authored
25
353c6ac anonymous comments added.
Timo Stollenwerk authored
26 from plone.registry.interfaces import IRegistry
27
aa50c33 show login form instead of the commenting form to anonymous users.
Timo Stollenwerk authored
28 from plone.app.layout.viewlets.common import ViewletBase
29
c135228 Use adaption instead of calling the conversationAdapterFactory directly.
Timo Stollenwerk authored
30 from plone.app.discussion.comment import CommentFactory
8fb254f add optional workflow actions to the get_replies method of the commen…
Timo Stollenwerk authored
31 from plone.app.discussion.interfaces import IConversation, IComment, IReplies, IDiscussionSettings
895105b added viewlet that overrides the standard plone commenting viewlet (n…
Timo Stollenwerk authored
32
424d1c7 z3c.form form added to commentsviewlet (not fully functional yet).
Timo Stollenwerk authored
33 ### NEW ###
34
35 from plone.app.layout.viewlets.common import ViewletBase
36
37 from zope.interface import Interface, implements
38
39 from zope.viewlet.interfaces import IViewlet
40
41 from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
42
43 from plone.z3cform import layout
44
45 from zope import interface, schema
46 from z3c.form import form, field, button, interfaces
47
48 from plone.z3cform import z2
49
50 from plone.app.discussion.interfaces import IComment
51
52 from zope.annotation import IAttributeAnnotatable
53
54 from plone.z3cform.fieldsets import extensible
55
56 from Products.Five.browser import BrowserView
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
57
2e2f6fc set form fields manually.
Timo Stollenwerk authored
58 from zope.schema.fieldproperty import FieldProperty
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
59
05f4626 comment view that redirects to the comment added. no unit test so far!
Timo Stollenwerk authored
60 class View(BrowserView):
61 """Comment View
62 """
63
64 def __call__(self):
65 # Redirect from /path/to/object/++conversation++default/123456789
66 # to /path/to/object#comment-123456789
67 comment_id = aq_parent(self).id
eec0e2d fix comment redirect from "#comment-<comment_id>" to "#<comment_id>".
Timo Stollenwerk authored
68 #self.request.response.redirect(aq_parent(aq_parent(aq_parent(self))).absolute_url() + '#comment-' + comment_id)
69 self.request.response.redirect(aq_parent(aq_parent(aq_parent(self))).absolute_url() + '#' + comment_id)
05f4626 comment view that redirects to the comment added. no unit test so far!
Timo Stollenwerk authored
70
424d1c7 z3c.form form added to commentsviewlet (not fully functional yet).
Timo Stollenwerk authored
71
72 class Comment(object):
73 implements(IComment, IAttributeAnnotatable)
74 portal_type = u""
2e2f6fc set form fields manually.
Timo Stollenwerk authored
75 __parent__ = None
76 __name__ = None
424d1c7 z3c.form form added to commentsviewlet (not fully functional yet).
Timo Stollenwerk authored
77 comment_id = u""
78 in_reply_to = u""
79 title = u""
80 mime_type = u""
81 text = u""
82 creator = u""
83 creation_date = u""
84 modification_date = u""
85 author_username = u""
86 author_name = u""
87 author_email = u""
88
89 class CommentForm(extensible.ExtensibleForm, form.Form):
2e2f6fc set form fields manually.
Timo Stollenwerk authored
90
424d1c7 z3c.form form added to commentsviewlet (not fully functional yet).
Timo Stollenwerk authored
91 ignoreContext = True # don't use context to get widget data
92 label = u"Add a comment"
93
878f450 fix attribute error when submitting the comment form.
Timo Stollenwerk authored
94 fields = field.Fields(IComment).omit('portal_type',
95 '__parent__',
96 '__name__',
97 'comment_id',
98 'in_reply_to',
99 'mime_type',
100 'creator',
101 'creation_date',
102 'modification_date',
103 'author_username',
104 'author_name',
105 'author_email',)
106
424d1c7 z3c.form form added to commentsviewlet (not fully functional yet).
Timo Stollenwerk authored
107 @button.buttonAndHandler(u'Post comment')
108 def handleApply(self, action):
109 data, errors = self.extractData()
878f450 fix attribute error when submitting the comment form.
Timo Stollenwerk authored
110 if data.has_key('title'):
111 print data['title'] # ... or do stuff
424d1c7 z3c.form form added to commentsviewlet (not fully functional yet).
Timo Stollenwerk authored
112
113 class ViewletFormWrapper(ViewletBase, layout.FormWrapper):
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
114
115 implements(IViewlet)
116
424d1c7 z3c.form form added to commentsviewlet (not fully functional yet).
Timo Stollenwerk authored
117 form = CommentForm
118
878f450 fix attribute error when submitting the comment form.
Timo Stollenwerk authored
119 def index(self):
120 return ViewPageTemplateFile('comments.pt').__of__(self)(self)
424d1c7 z3c.form form added to commentsviewlet (not fully functional yet).
Timo Stollenwerk authored
121
122 def __init__(self, context, request, view, manager):
123 super(ViewletFormWrapper, self).__init__(context, request, view, manager)
124 if self.form is not None:
125 self.form_instance = self.form(self.context.aq_inner, self.request)
126 self.form_instance.__name__ = self.__name__
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
127
2ecd5e7 check if discussion is allowed for the comments viewlet.
Timo Stollenwerk authored
128 self.portal_discussion = getToolByName(self.context, 'portal_discussion', None)
129 self.portal_membership = getToolByName(self.context, 'portal_membership', None)
130
424d1c7 z3c.form form added to commentsviewlet (not fully functional yet).
Timo Stollenwerk authored
131 def render_form(self):
878f450 fix attribute error when submitting the comment form.
Timo Stollenwerk authored
132 z2.switch_on(self, request_layer=self.request_layer)
424d1c7 z3c.form form added to commentsviewlet (not fully functional yet).
Timo Stollenwerk authored
133 self.form.update(self.form_instance)
134 return self.form.render(self.form_instance)
135
136 # view methods
137
2ecd5e7 check if discussion is allowed for the comments viewlet.
Timo Stollenwerk authored
138 def can_reply(self):
139 return getSecurityManager().checkPermission('Reply to item', aq_inner(self.context))
140
dd0133e add delete and workflow actions buttons to comments viewlet.
Timo Stollenwerk authored
141 def can_manage(self):
142 return getSecurityManager().checkPermission('Manage portal', aq_inner(self.context))
143
2ecd5e7 check if discussion is allowed for the comments viewlet.
Timo Stollenwerk authored
144 def is_discussion_allowed(self):
34ee743 remove all the unnecessary acquisition wrapping of conversation (sinc…
Timo Stollenwerk authored
145 context = aq_inner(self.context)
c135228 Use adaption instead of calling the conversationAdapterFactory directly.
Timo Stollenwerk authored
146 conversation = IConversation(context)
473699d is_discussion_allowed method from the comments viewlet now uses Conve…
Timo Stollenwerk authored
147 return conversation.enabled
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
148
8fb254f add optional workflow actions to the get_replies method of the commen…
Timo Stollenwerk authored
149 def get_replies(self, workflow_actions=False):
150 context = aq_inner(self.context)
151 conversation = IConversation(context)
152
5300e33 fix the anonymous view for the comments viewlet.
Timo Stollenwerk authored
153 def replies_with_workflow_actions():
154 # Return dict with workflow actions
155 #context = aq_inner(self.context)
156 wf = getToolByName(context, 'portal_workflow')
157
158 for r in conversation.getThreads():
159 comment_obj = r['comment']
160 # list all possible workflow actions
161 actions = [a for a in wf.listActionInfos(object=comment_obj)
162 if a['category'] == 'workflow' and a['allowed']]
163 r = r.copy()
164 r['actions'] = actions
165 yield r
166
8fb254f add optional workflow actions to the get_replies method of the commen…
Timo Stollenwerk authored
167 # Return all direct replies
49aab73 show the second "login to comment"-button (below the comments) only w…
Timo Stollenwerk authored
168 if conversation.total_comments > 0:
8fb254f add optional workflow actions to the get_replies method of the commen…
Timo Stollenwerk authored
169 if workflow_actions:
5300e33 fix the anonymous view for the comments viewlet.
Timo Stollenwerk authored
170 return replies_with_workflow_actions()
8fb254f add optional workflow actions to the get_replies method of the commen…
Timo Stollenwerk authored
171 else:
5300e33 fix the anonymous view for the comments viewlet.
Timo Stollenwerk authored
172 return conversation.getThreads()
49aab73 show the second "login to comment"-button (below the comments) only w…
Timo Stollenwerk authored
173 else:
5300e33 fix the anonymous view for the comments viewlet.
Timo Stollenwerk authored
174 return None
175
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
176
1af2b43 get_commenter_portrait and get_commenter_home_url methods added to co…
Timo Stollenwerk authored
177 def get_commenter_home_url(self, username):
178 if username is None:
179 return None
180 else:
181 return "%s/author/%s" % (self.context.portal_url(), username)
182
183 def get_commenter_portrait(self, username):
184
185 if username is None:
5e26227 fix that anonymous users see a link to a non-existent user-home in th…
Timo Stollenwerk authored
186 # return the default user image if no username is given
187 return 'defaultUser.gif'
1af2b43 get_commenter_portrait and get_commenter_home_url methods added to co…
Timo Stollenwerk authored
188 else:
5e26227 fix that anonymous users see a link to a non-existent user-home in th…
Timo Stollenwerk authored
189 portal_membership = getToolByName(self.context, 'portal_membership', None)
190 return portal_membership.getPersonalPortrait(username).absolute_url();
1af2b43 get_commenter_portrait and get_commenter_home_url methods added to co…
Timo Stollenwerk authored
191
353c6ac anonymous comments added.
Timo Stollenwerk authored
192 def anonymous_discussion_allowed(self):
193 # Check if anonymous comments are allowed in the registry
194 registry = queryUtility(IRegistry)
b106262 plone.registry 1.0a2 changed methods to mixedCase (for_interface to f…
Timo Stollenwerk authored
195 settings = registry.forInterface(IDiscussionSettings)
353c6ac anonymous comments added.
Timo Stollenwerk authored
196 return settings.anonymous_comments
197
e98a399 option to show commenter image added.
Timo Stollenwerk authored
198 def show_commenter_image(self):
199 # Check if showing commenter image is enabled in the registry
200 registry = queryUtility(IRegistry)
b106262 plone.registry 1.0a2 changed methods to mixedCase (for_interface to f…
Timo Stollenwerk authored
201 settings = registry.forInterface(IDiscussionSettings)
e98a399 option to show commenter image added.
Timo Stollenwerk authored
202 return settings.show_commenter_image
203
2ecd5e7 check if discussion is allowed for the comments viewlet.
Timo Stollenwerk authored
204 def is_anonymous(self):
205 return self.portal_state.anonymous()
206
aa50c33 show login form instead of the commenting form to anonymous users.
Timo Stollenwerk authored
207 def login_action(self):
208 return '%s/login_form?came_from=%s' % (self.navigation_root_url, url_quote(self.request.get('URL', '')),)
2ecd5e7 check if discussion is allowed for the comments viewlet.
Timo Stollenwerk authored
209
2b0133a documentByLine added to the comments viewlet (to localized time is no…
Timo Stollenwerk authored
210 def format_time(self, time):
3d43434 comments viewlet's format_time now returns localized time.
Timo Stollenwerk authored
211 # We have to transform Python datetime into Zope DateTime
eec0e2d fix comment redirect from "#comment-<comment_id>" to "#<comment_id>".
Timo Stollenwerk authored
212 # before we can call toLocalizedTime.
3d43434 comments viewlet's format_time now returns localized time.
Timo Stollenwerk authored
213 util = getToolByName(self.context, 'translation_service')
214 zope_time = DateTime(time.year, time.month, time.day, time.hour, time.minute, time.second)
215 return util.toLocalizedTime(zope_time, long_format=True)
1af2b43 get_commenter_portrait and get_commenter_home_url methods added to co…
Timo Stollenwerk authored
216
878f450 fix attribute error when submitting the comment form.
Timo Stollenwerk authored
217 CommentsViewlet = layout.wrap_form(CommentForm, __wrapper_class=ViewletFormWrapper)
424d1c7 z3c.form form added to commentsviewlet (not fully functional yet).
Timo Stollenwerk authored
218
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
219 class AddComment(BrowserView):
220 """Add a comment to a conversation
221 """
222
223 def __call__(self):
224
225 if self.request.has_key('form.button.AddComment'):
226
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
227 context = aq_inner(self.context)
228
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
229 subject = self.request.get('subject')
230 text = self.request.get('body_text')
353c6ac anonymous comments added.
Timo Stollenwerk authored
231 author_username = self.request.get('author_username')
232 author_email = self.request.get('author_email')
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
233
b7b0b18 very basic form validation added to comments viewlet.
Timo Stollenwerk authored
234 # Check the form input
235 if author_username == '':
236 IStatusMessage(self.request).addStatusMessage(\
237 _("Username field is empty."),
238 type="info")
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
239 return self.request.response.redirect(aq_parent(aq_inner(context)).absolute_url())
b7b0b18 very basic form validation added to comments viewlet.
Timo Stollenwerk authored
240 if author_email == '':
241 IStatusMessage(self.request).addStatusMessage(\
242 _("Email field is empty."),
243 type="info")
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
244 return self.request.response.redirect(aq_parent(aq_inner(context)).absolute_url())
b7b0b18 very basic form validation added to comments viewlet.
Timo Stollenwerk authored
245 if subject == '':
246 IStatusMessage(self.request).addStatusMessage(\
247 _("Subject field is empty."),
248 type="info")
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
249 return self.request.response.redirect(aq_parent(aq_inner(context)).absolute_url())
b7b0b18 very basic form validation added to comments viewlet.
Timo Stollenwerk authored
250 if text == '':
251 IStatusMessage(self.request).addStatusMessage(\
252 _("Comment field is empty."),
253 type="info")
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
254 return self.request.response.redirect(aq_parent(aq_inner(context)).absolute_url())
b7b0b18 very basic form validation added to comments viewlet.
Timo Stollenwerk authored
255
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
256 # The add-comment view is called on the conversation object
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
257 conversation = context
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
258
259 # Create the comment
260 comment = CommentFactory()
261 comment.title = subject
262 comment.text = text
263
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
264 portal_membership = getToolByName(context, 'portal_membership')
660ee78 User Story: As a visitor, I can view portraits, full name and usernam…
Timo Stollenwerk authored
265
266 if portal_membership.isAnonymousUser():
353c6ac anonymous comments added.
Timo Stollenwerk authored
267 comment.creator = author_username
268 comment.author_name = author_username
269 comment.author_email = author_email
270 comment.creation_date = comment.modification_date = datetime.now()
660ee78 User Story: As a visitor, I can view portraits, full name and usernam…
Timo Stollenwerk authored
271 else:
272 member = portal_membership.getAuthenticatedMember()
1670338 Add id fall back for Creator if no Username (Title) has been added.
Timo Stollenwerk authored
273 fullname = member.getProperty('fullname')
274 if fullname == '' or None:
275 comment.creator = member.id
276 else:
277 comment.creator = fullname
660ee78 User Story: As a visitor, I can view portraits, full name and usernam…
Timo Stollenwerk authored
278 comment.author_username = member.getUserName()
279 comment.author_name = member.getProperty('fullname')
280 comment.author_email = member.getProperty('email')
281 comment.creation_date = comment.modification_date = datetime.now()
282
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
283 # Add comment to the conversation
660ee78 User Story: As a visitor, I can view portraits, full name and usernam…
Timo Stollenwerk authored
284 comment_id = conversation.addComment(comment)
ad06e9a make comments viewlet show the plone.app.discussion comments and allo…
Timo Stollenwerk authored
285
77490ec Redirect directly to the comment and not to the content object after …
Timo Stollenwerk authored
286 # Redirect to comment (inside a content object page)
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
287 #self.request.response.redirect(aq_parent(aq_inner(context)).absolute_url() + '#comment-' + str(comment_id))
288 self.request.response.redirect(aq_parent(aq_inner(context)).absolute_url() + '#' + str(comment_id))
bda70af reply-to-comment view and jquery forms added.
Timo Stollenwerk authored
289
290 class ReplyToComment(BrowserView):
291 """Reply to a comment
292 """
293
294 def __call__(self):
295
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
296 context = aq_inner(self.context)
297
bda70af reply-to-comment view and jquery forms added.
Timo Stollenwerk authored
298 if self.request.has_key('form.button.AddComment'):
299
300 reply_to_comment_id = self.request.get('form.reply_to_comment_id')
60ed441 set the username oder creator when a reply is added to a comment.
Timo Stollenwerk authored
301
bda70af reply-to-comment view and jquery forms added.
Timo Stollenwerk authored
302 subject = self.request.get('subject')
303 text = self.request.get('body_text')
60ed441 set the username oder creator when a reply is added to a comment.
Timo Stollenwerk authored
304 author_username = self.request.get('author_username')
305 author_email = self.request.get('author_email')
bda70af reply-to-comment view and jquery forms added.
Timo Stollenwerk authored
306
b7b0b18 very basic form validation added to comments viewlet.
Timo Stollenwerk authored
307 # Check the form input
308 if author_username == '':
309 IStatusMessage(self.request).addStatusMessage(\
310 _("Username field is empty."),
311 type="info")
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
312 return self.request.response.redirect(aq_parent(aq_inner(context)).absolute_url())
b7b0b18 very basic form validation added to comments viewlet.
Timo Stollenwerk authored
313 if author_email == '':
314 IStatusMessage(self.request).addStatusMessage(\
315 _("Email field is empty."),
316 type="info")
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
317 return self.request.response.redirect(aq_parent(aq_inner(context)).absolute_url())
b7b0b18 very basic form validation added to comments viewlet.
Timo Stollenwerk authored
318 if subject == '':
319 IStatusMessage(self.request).addStatusMessage(\
320 _("Subject field is empty."),
321 type="info")
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
322 return self.request.response.redirect(aq_parent(aq_inner(context)).absolute_url())
b7b0b18 very basic form validation added to comments viewlet.
Timo Stollenwerk authored
323 if text == '':
324 IStatusMessage(self.request).addStatusMessage(\
325 _("Comment field is empty."),
326 type="info")
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
327 return self.request.response.redirect(aq_parent(aq_inner(context)).absolute_url())
b7b0b18 very basic form validation added to comments viewlet.
Timo Stollenwerk authored
328
bda70af reply-to-comment view and jquery forms added.
Timo Stollenwerk authored
329 # The add-comment view is called on the conversation object
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
330 conversation = context
bda70af reply-to-comment view and jquery forms added.
Timo Stollenwerk authored
331
332 # Fetch the comment we want to reply to
333 comment_to_reply_to = conversation.get(reply_to_comment_id)
334
335 replies = IReplies(comment_to_reply_to)
336
337 # Create the comment
338 comment = CommentFactory()
339 comment.title = subject
340 comment.text = text
341
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
342 portal_membership = getToolByName(context, 'portal_membership')
60ed441 set the username oder creator when a reply is added to a comment.
Timo Stollenwerk authored
343
344 if portal_membership.isAnonymousUser():
345 comment.creator = author_username
346 comment.author_name = author_username
347 comment.author_email = author_email
348 comment.creation_date = comment.modification_date = datetime.now()
349 else:
350 member = portal_membership.getAuthenticatedMember()
351 fullname = member.getProperty('fullname')
352 if fullname == '' or None:
353 comment.creator = member.id
354 else:
355 comment.creator = fullname
356 comment.author_username = member.getUserName()
357 comment.author_name = member.getProperty('fullname')
358 comment.author_email = member.getProperty('email')
359 comment.creation_date = comment.modification_date = datetime.now()
360
bda70af reply-to-comment view and jquery forms added.
Timo Stollenwerk authored
361 # Add the reply to the comment
362 new_re_id = replies.addComment(comment)
363
77490ec Redirect directly to the comment and not to the content object after …
Timo Stollenwerk authored
364 # Redirect to comment (inside a content object page)
f088cb9 fix bug 834504. Replies have a wrong path index.
Timo Stollenwerk authored
365 #self.request.response.redirect(aq_parent(aq_inner(context)).absolute_url() + '#comment-' + str(reply_to_comment_id))
b288f3f fix "Reply button is not working anymore when a reply was posted."
Timo Stollenwerk authored
366 # Todo: Temporarily remove the "#comment-" to fix a bug
367 # in CMFPlone/skins/plone_ecmascript/form_tabbing.js
90440cf add bulk actions and filter to the moderation view.
Timo Stollenwerk authored
368 self.request.response.redirect(aq_parent(aq_inner(context)).absolute_url() + '#' + str(reply_to_comment_id))
Something went wrong with that request. Please try again.