예제 #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))