Exemplo n.º 1
0
 def _process(self):
     form = PaperCommentForm(paper=self.paper, user=session.user)
     if form.validate_on_submit():
         visibility = form.visibility.data if form.visibility else None
         create_comment(self.paper, form.text.data, visibility, session.user)
         return jsonify_data(flash=False, html=render_paper_page(self.paper))
     tpl = get_template_module('events/reviews/forms.html')
     return jsonify(html=tpl.render_comment_form(form, proposal=self.paper))
Exemplo n.º 2
0
 def _process(self):
     form = PaperCommentForm(paper=self.paper, user=session.user)
     if form.validate_on_submit():
         visibility = form.visibility.data if form.visibility else None
         create_comment(self.paper, form.text.data, visibility, session.user)
         return jsonify_data(flash=False, html=render_paper_page(self.paper))
     tpl = get_template_module('events/reviews/forms.html')
     return jsonify(html=tpl.render_comment_form(form, proposal=self.paper))
Exemplo n.º 3
0
 def _process(self):
     form = PaperCommentForm(obj=self.comment, paper=self.paper, user=session.user,
                             prefix='edit-comment-{}-'.format(self.comment.id))
     if form.validate_on_submit():
         visibility = form.visibility.data if form.visibility else self.comment.visibility
         update_comment(self.comment, form.text.data, visibility)
         return jsonify_data(flash=False, html=render_paper_page(self.paper))
     tpl = get_template_module('events/reviews/forms.html')
     return jsonify(html=tpl.render_comment_form(form, proposal=self.paper, comment=self.comment, edit=True))
Exemplo n.º 4
0
 def _process(self):
     form = PaperCommentForm(obj=self.comment, paper=self.paper, user=session.user,
                             prefix='edit-comment-{}-'.format(self.comment.id))
     if form.validate_on_submit():
         visibility = form.visibility.data if form.visibility else self.comment.visibility
         update_comment(self.comment, form.text.data, visibility)
         return jsonify_data(flash=False, html=render_paper_page(self.paper))
     tpl = get_template_module('events/reviews/forms.html')
     return jsonify(html=tpl.render_comment_form(form, proposal=self.paper, comment=self.comment, edit=True))