diff --git a/data/cubes.comment.js b/data/cubes.comment.js index 95dedf5cb317dd1c5b00919a4ed66add07b7cf01_ZGF0YS9jdWJlcy5jb21tZW50Lmpz..46cc97b563324a908ba029661355663738e900b3_ZGF0YS9jdWJlcy5jb21tZW50Lmpz 100644 --- a/data/cubes.comment.js +++ b/data/cubes.comment.js @@ -21,7 +21,7 @@ var ul = null; if (!commentNode.length) { // we are adding a comment to the top level entity - commentNode = $('#commentsectionComponent'); + commentNode = $('#commentsection' + eid); klass = 'comment'; } else { klass = 'section'; diff --git a/views.py b/views.py index 95dedf5cb317dd1c5b00919a4ed66add07b7cf01_dmlld3MucHk=..46cc97b563324a908ba029661355663738e900b3_dmlld3MucHk= 100644 --- a/views.py +++ b/views.py @@ -278,7 +278,7 @@ related to an object """ __regid__ = 'commentsection' - __select__ = ((component.EntityCtxComponent.__select__ | match_kwargs('entity')) + __select__ = (component.EntityCtxComponent.__select__ & relation_possible('comments', 'object', 'Comment')) context = 'navcontentbottom' @@ -299,11 +299,9 @@ rset = None if not (rset or addcomment): return - w(u'<div id="%s" class="%s" cubicweb:rooteid="%s">' % ( - self.domid, self.cssclass, entity.eid)) if rset.rowcount: w(u'<h4>%s</h4>' % (req._('Comment_plural'))) w(u'<ul class="comment">') for i in xrange(rset.rowcount): self.view('tree', rset, row=i, w=w) w(u'</ul>') @@ -304,10 +302,9 @@ if rset.rowcount: w(u'<h4>%s</h4>' % (req._('Comment_plural'))) w(u'<ul class="comment">') for i in xrange(rset.rowcount): self.view('tree', rset, row=i, w=w) w(u'</ul>') - w(u'</div>') if addcomment is not None: w(u'<div id="comment%sHolder"></div>' % entity.eid) params = self.cw_extra_kwargs.copy()