コード例 #1
0
 def _process(self):
     form = build_review_form(review=self.review)
     if form.validate_on_submit():
         update_review(self.review, **form.split_data)
         return jsonify_data(flash=False,
                             html=render_paper_page(self.paper))
     tpl = get_template_module('events/reviews/forms.html')
     return jsonify(html=tpl.render_review_form(form, review=self.review))
コード例 #2
0
 def _process(self):
     form = PaperJudgmentForm(paper=self.paper)
     if form.validate_on_submit():
         judge_paper(self.paper,
                     form.judgment.data,
                     form.judgment_comment.data,
                     judge=session.user)
         return jsonify_data(flash=False,
                             html=render_paper_page(self.paper))
コード例 #3
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))
コード例 #4
0
 def _process(self):
     form = build_review_form(self.paper.last_revision, self.type)
     if form.validate_on_submit():
         create_review(self.paper, self.type, session.user,
                       **form.split_data)
         return jsonify_data(flash=False,
                             html=render_paper_page(self.paper))
     tpl = get_template_module('events/reviews/forms.html')
     return jsonify(html=tpl.render_review_form(
         form, proposal=self.paper, group=self.type))
コード例 #5
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))
コード例 #6
0
 def _process(self):
     form = PaperSubmissionForm()
     if form.validate_on_submit():
         if self.paper is None:
             paper = Paper(self.contribution)
             create_paper_revision(paper, session.user, form.files.data)
             return jsonify_data(flash=False)
         else:
             create_paper_revision(self.paper, session.user,
                                   form.files.data)
             return jsonify_data(flash=False,
                                 html=render_paper_page(self.paper))
     return jsonify_form(
         form,
         form_header_kwargs={'action': request.relative_url},
         disable_if_locked=False)
コード例 #7
0
 def _process(self):
     return render_paper_page(self.paper, view_class=WPDisplayCallForPapers)
コード例 #8
0
 def _process(self):
     if self.paper.state != PaperRevisionState.submitted:
         reset_paper_state(self.paper)
         flash(_("The paper judgment has been reset"), 'success')
     return jsonify_data(html=render_paper_page(self.paper))