# HG changeset patch # User Graziella Toutoungis <graziella.toutoungis@logilab.fr> # Date 1241515492 -7200 # Tue May 05 11:24:52 2009 +0200 # Branch tls-sprint # Node ID e8dc9c0ce7fc51a02910d50ba723d44c6aff8ea2 # Parent 4de8a665b4da4950d05c146df536637f55673af8 fix a bug: on edit comment the dispatch called the InlineCommentView call, this one needs 2 param... diff --git a/views.py b/views.py --- a/views.py +++ b/views.py @@ -157,16 +157,14 @@ 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') - 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,12 +185,15 @@ 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 - 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 ###########################################################