Esempio n. 1
0
 def _process(self):
     form = AbstractCommentForm(abstract=self.abstract, user=session.user)
     if form.validate_on_submit():
         create_abstract_comment(self.abstract, form.data)
         return jsonify_data(flash=False, html=render_abstract_page(self.abstract, management=self.management))
     tpl = get_template_module('events/reviews/forms.html')
     return jsonify(html=tpl.render_comment_form(form, proposal=self.abstract))
Esempio n. 2
0
 def _process(self):
     form = AbstractCommentForm(abstract=self.abstract, user=session.user)
     if form.validate_on_submit():
         create_abstract_comment(self.abstract, form.data)
         return jsonify_data(flash=False, html=render_abstract_page(self.abstract, management=self.management))
     tpl = get_template_module('events/reviews/forms.html')
     return jsonify(html=tpl.render_comment_form(form, proposal=self.abstract))
Esempio n. 3
0
 def _process(self):
     form = AbstractCommentForm(obj=self.comment, abstract=self.abstract, user=session.user,
                                prefix='edit-comment-{}-'.format(self.comment.id))
     if form.validate_on_submit():
         update_abstract_comment(self.comment, form.data)
         return jsonify_data(flash=False, html=render_abstract_page(self.abstract, management=self.management))
     tpl = get_template_module('events/reviews/forms.html')
     return jsonify(html=tpl.render_comment_form(form, proposal=self.abstract, comment=self.comment, edit=True))
Esempio n. 4
0
 def _process(self):
     form = AbstractCommentForm(obj=self.comment, abstract=self.abstract, user=session.user,
                                prefix='edit-comment-{}-'.format(self.comment.id))
     if form.validate_on_submit():
         update_abstract_comment(self.comment, form.data)
         return jsonify_data(flash=False, html=render_abstract_page(self.abstract, management=self.management))
     tpl = get_template_module('events/reviews/forms.html')
     return jsonify(html=tpl.render_comment_form(form, proposal=self.abstract, comment=self.comment, edit=True))
Esempio n. 5
0
    def _process(self):
        form = AbstractCommentForm(abstract=self.abstract, user=session.user)
        if form.validate_on_submit():
            create_abstract_comment(self.abstract, form.data)
            if abstracts_reviewing_settings.get(self.event,
                                                'notify_on_new_comments'):
                visibility = form.visibility.data if form.visibility else AbstractCommentVisibility.contributors
                recipients = self._get_recipients(visibility) - {session.user}
                comment = form.text.data
                self._send_notification(recipients, comment)

            return jsonify_data(flash=False,
                                html=render_abstract_page(
                                    self.abstract, management=self.management))
        tpl = get_template_module('events/reviews/forms.html')
        return jsonify(
            html=tpl.render_comment_form(form, proposal=self.abstract))