Exemple #1
0
def screening(id):
    l.l('screening_view', uid=request.user.id, id=id)
    proposal = l.get_proposal(id)
    if not proposal or proposal.withdrawn:
        abort(404)

    if request.user.email in (x.email.lower() for x in proposal.authors):
        abort(404)

    unread = l.is_unread(request.user.id, id)
    discussion = l.get_discussion(id)

    standards = l.get_standards()

    existing_vote = l.get_user_vote(request.user.id, id)
    votes = l.get_votes(id)

    my_votes = l.get_my_votes(request.user.id)
    percent = l.get_vote_percentage(request.user.email, request.user.id)

    return render_template('screening_proposal.html',
                           proposal=proposal,
                           votes=votes,
                           discussion=discussion,
                           standards=standards,
                           existing_vote=existing_vote,
                           unread=unread,
                           percent=percent)
Exemple #2
0
def pick():
    if THIS_IS_BATCH:
        return redirect(url_for('batch_splash_page'))

    reconsider = l.get_reconsider(request.user.id)

    if reconsider:
        msg = """You voted on this proposal before the change to standard #4.
                 Please reconsider and save your vote!"""
        flash(msg)
        return redirect(url_for('screening', id=reconsider[0].id))

    if request.user.revisit:
        data = [x for x in l.get_my_votes(request.user.id) if x.updated]
        if data:
            msg = """This proposal has been updated since your last vote.
                    Please reconsider and save your vote!"""
            flash(msg)
            return redirect(url_for('screening', id=data[0].proposal))

    id = l.needs_votes(request.user.email, request.user.id)
    if not id:
        flash("You have voted on every proposal!")
        return redirect(url_for('screening_stats'))
    return redirect(url_for('screening', id=id))
Exemple #3
0
def screening(id):
    l.l('screening_view', uid=request.user.id, id=id)
    proposal = l.get_proposal(id)
    if not proposal or proposal.withdrawn:
        abort(404)

    if request.user.email in (x.email.lower() for x in proposal.authors):
        abort(404)

    unread = l.is_unread(request.user.id, id)
    discussion = l.get_discussion(id)

    standards = l.get_standards()
    bookmarked = l.has_bookmark(request.user.id, id)

    existing_vote = l.get_user_vote(request.user.id, id)
    votes = l.get_votes(id)

    my_votes = l.get_my_votes(request.user.id)
    percent = l.get_vote_percentage(request.user.email, request.user.id)

    return render_template('screening_proposal.html', proposal=proposal,
                            votes=votes, discussion=discussion,
                            standards=standards,
                            bookmarked=bookmarked,
                            existing_vote=existing_vote,
                            unread=unread,
                            percent=percent)
Exemple #4
0
def pick():
    if THIS_IS_BATCH:
        return redirect(url_for('batch_splash_page'))

    reconsider = l.get_reconsider(request.user.id)

    if reconsider:
        msg = """You voted on this proposal before the change to standard #4.
                 Please reconsider and save your vote!"""
        flash(msg)
        return redirect(url_for('screening', id=reconsider[0].id))

    if request.user.revisit:
        data = [x for x in l.get_my_votes(request.user.id) if x.updated]
        if data:
            msg = """This proposal has been updated since your last vote.
                    Please reconsider and save your vote!"""
            flash(msg)
            return redirect(url_for('screening', id=data[0].proposal))

    id = l.needs_votes(request.user.email, request.user.id)
    if not id:
        flash("You have voted on every proposal!")
        return redirect(url_for('screening_stats'))
    return redirect(url_for('screening', id=id))
Exemple #5
0
def show_votes():
    votes = l.get_my_votes(request.user.id)
    votes = [x._replace(updated_on=l._js_time(x.updated_on)) for x in votes]
    percent = l.get_vote_percentage(request.user.email, request.user.id)
    return render_template('my_votes.html',
                           votes=votes,
                           percent=percent,
                           standards=l.get_standards())
Exemple #6
0
def show_votes():
    votes = l.get_my_votes(request.user.id)
    votes = [x._replace(updated_on=l._js_time(x.updated_on)) for x in votes]
    percent = l.get_vote_percentage(request.user.email, request.user.id)
    return render_template('my_votes.html', votes=votes, percent=percent,
                            standards = l.get_standards())
Exemple #7
0
def show_votes():
    votes = l.get_my_votes(request.user.id)
    percent = 100.0 * len(votes) / l.get_proposal_count()
    return render_template("my_votes.html", votes=votes, percent=percent, standards=l.get_standards())
Exemple #8
0
def show_votes():
    votes = l.get_my_votes(request.user.id)
    percent = l.get_vote_percentage(request.user.email, request.user.id)
    return render_template('my_votes.html', votes=votes, percent=percent,
                            standards = l.get_standards())