def _review(self, id): """Review a proposal. """ c.proposal = Proposal.find_by_id(id) c.signed_in_person = h.signed_in_person() c.next_review_id = Proposal.find_next_proposal(c.proposal.id, c.proposal.type.id, c.signed_in_person.id) c.review = Review.find_by_proposal_reviewer(id, c.signed_in_person.id, abort_404=False) if c.review: for key in self.form_result['review']: setattr(c.review, key, self.form_result['review'][key]) # update the objects with the validated form data meta.Session.commit() h.flash("Review Updated Successfully") return redirect_to(controller='review', action='view', id=c.review.id) else: results = self.form_result['review'] review = Review(**results) meta.Session.add(review) review.proposal = c.proposal review.reviewer = c.signed_in_person meta.Session.commit() h.flash("Review Added Successfully") if c.next_review_id: return redirect_to(action='review', id=c.next_review_id) h.flash("No more proposals to review") return redirect_to(action='review_index')
def _review(self, id): """Review a proposal. """ c.proposal = Proposal.find_by_id(id) c.signed_in_person = h.signed_in_person() c.next_review_id = Proposal.find_next_proposal(c.proposal.id, c.proposal.type.id, c.signed_in_person.id) c.review = Review.find_by_proposal_reviewer(id, c.signed_in_person.id, abort_404=False) if c.review: for key in self.form_result['review']: setattr(c.review, key, self.form_result['review'][key]) # update the objects with the validated form data meta.Session.commit() h.flash("Review Updated Successfully") return redirect_to(controller='review', action='view', id=c.review.id) else: results = self.form_result['review'] review = Review(**results) meta.Session.add(review) review.proposal = c.proposal review.reviewer = c.signed_in_person meta.Session.commit() h.flash("Review Added Successfully") if c.next_review_id: return redirect_to(action='review', id=c.next_review_id) h.flash("No more papers to review") return redirect_to(action='review_index')
def edit(self, id): c.review = Review.find_by_id(id) redirect_to( h.url_for(controller='proposal', id=c.review.proposal.id, action='review'))
def index(self): c.proposal_type_collection = ProposalType.find_all() c.review_collection_by_type = {} for proposal_type in c.proposal_type_collection: query = Review.by_reviewer(h.signed_in_person().id).join(Proposal).filter_by(proposal_type_id=proposal_type.id) c.review_collection_by_type[proposal_type] = query.all() return render('/review/list.mako')
def delete(self, id): c.review = Review.find_by_id(id) if c.review.reviewer.id != h.signed_in_person().id: # Raise a no_auth error h.auth.no_role() return render('/review/confirm_delete.mako')
def index(self): c.proposal_type_collection = ProposalType.find_all() c.review_collection_by_type = {} for proposal_type in c.proposal_type_collection: query = Review.by_reviewer( h.signed_in_person()).join(Proposal).filter_by( proposal_type_id=proposal_type.id) c.review_collection_by_type[proposal_type] = query.all() return render('/review/list.mako')
def _delete(self, id): c.review = Review.find_by_id(id) if c.review.reviewer.id != h.signed_in_person().id: # Raise a no_auth error h.auth.no_role() meta.Session.delete(c.review) meta.Session.commit() h.flash("Review Deleted") redirect_to(controller='review', action='index')
def view(self, id): c.review = Review.find_by_id(id) # TODO: currently not enough (see TODOs in model/proposal.py) #if not h.auth.authorized(h.auth.has_organiser_role): # # You can't review your own proposal # for person in c.review.proposal.people: # if person.id == h.signed_in_person().id: # h.auth.no_role() if c.review is None: redirect_to(action='index') return render('review/view.mako')
def review(self, id): c.streams = Stream.select_values() c.proposal = Proposal.find_by_id(id) c.signed_in_person = h.signed_in_person() c.next_review_id = Proposal.find_next_proposal(c.proposal.id, c.proposal.type.id, c.signed_in_person.id) c.review = Review.find_by_proposal_reviewer(id, c.signed_in_person.id, abort_404=False) if c.review: c.form = 'edit' defaults = h.object_to_defaults(c.review, 'review') if c.review.score == None: defaults['review.score'] = '' if c.review.stream_id: defaults['review.stream'] = c.review.stream_id form = render('/review/edit.mako') return htmlfill.render(form, defaults) else: c.form = 'new' return render('/review/new.mako')
def edit(self, id): c.review = Review.find_by_id(id) redirect_to(h.url_for(controller='proposal', id=c.review.proposal.id, action='review'))
def index(self): c.review_collection = Review.find_all() return render('/review/list.mako')
def summary(self): c.summary = Review.find_summary().all() return render('review/summary.mako')