Skip to content
Snippets Groups Projects
Commit e8dc9c0ce7fc authored by Graziella Toutoungis's avatar Graziella Toutoungis
Browse files

fix a bug: on edit comment the dispatch called the InlineCommentView call,...

fix a bug: on edit comment the dispatch called the  InlineCommentView call, this one needs 2 param...
parent 4de8a665b4da
No related branches found
No related tags found
No related merge requests found
......@@ -157,8 +157,7 @@
self.wview('inlinecommentform', None, commented=entity)
class InlineCommentForm(FormViewMixIn, EntityView):
id = 'inlinecommentform'
__select__ = match_kwargs('commented') # explicit call when it makes sense
jsfunc = "processComment(%s, '%s')"
class InlineEditCommentForm(FormViewMixIn, EntityView):
id = 'editcomment'
__select__ = implements('Comment')
......@@ -164,9 +163,8 @@
def call(self, commented):
self.initialize_varmaker()
newcomment = self.vreg.etype_class('Comment')(self.req)
newcomment.eid = self.varmaker.next()
self.comment_form(commented, newcomment)
jsfunc = "processComment(%s, '%s')"
def cell_call(self, row, col):
self.comment_form(self.entity(row, col))
def comment_form(self, commented, newcomment=None):
self.req.add_js('cubes.comment.js')
......@@ -187,7 +185,7 @@
commented.eid, form.form_render(display_relations_form=False)))
class InlineEditCommentForm(InlineCommentForm):
id = 'editcomment'
__select__ = implements('Comment')
class InlineCommentForm(InlineEditCommentForm):
id = 'inlinecommentform'
__select__ = match_kwargs('commented') # explicit call when it makes sense
......@@ -193,6 +191,9 @@
def cell_call(self, row, col):
self.comment_form(self.entity(row, col))
def call(self, commented):
self.initialize_varmaker()
newcomment = self.vreg.etype_class('Comment')(self.req)
newcomment.eid = self.varmaker.next()
self.comment_form(commented, newcomment)
# comment component ###########################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment