diff --git a/views.py b/views.py index 4de8a665b4da4950d05c146df536637f55673af8_dmlld3MucHk=..e8dc9c0ce7fc51a02910d50ba723d44c6aff8ea2_dmlld3MucHk= 100644 --- a/views.py +++ b/views.py @@ -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 ###########################################################