Esempio n. 1
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))
Esempio n. 2
0
def render_paper_page(paper, view_class=None):
    comment_form = (PaperCommentForm(
        paper=paper, user=session.user, formdata=None)
                    if not paper.is_in_final_state else None)
    review_form = None
    reviewed_for_groups = list(
        paper.last_revision.get_reviewed_for_groups(session.user))
    if len(reviewed_for_groups) == 1:
        review_form = build_review_form(paper.last_revision,
                                        reviewed_for_groups[0])
    judgment_form = PaperJudgmentForm(formdata=None, paper=paper)
    revision_form = PaperSubmissionForm(formdata=None)
    params = {
        'paper': paper,
        'comment_form': comment_form,
        'review_form': review_form,
        'judgment_form': judgment_form,
        'revision_form': revision_form
    }
    if view_class:
        return view_class.render_template('paper.html', paper.event, **params)
    else:
        return render_template('events/papers/paper.html',
                               no_javascript=True,
                               standalone=True,
                               **params)
Esempio n. 3
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))