Skip to content
Snippets Groups Projects
Commit 3ff4f114dec1 authored by sylvain thenault's avatar sylvain thenault
Browse files

merge

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')
......@@ -184,6 +182,7 @@
form_buttons=buttons,
attrcategories=('primary',))
self.w(u'<div id="comment%sSlot">%s</div>' % (
commented.eid, form.form_render(display_relations_form=False)))
commented.eid, form.form_render(display_label=False,
display_relations_form=False)))
......@@ -188,6 +187,6 @@
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 +192,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