示例#1
0
文件: app.py 项目: pgagnon/progcom
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)
示例#2
0
文件: app.py 项目: rmoorman/progcom
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))
示例#3
0
文件: app.py 项目: rmoorman/progcom
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)
示例#4
0
文件: app.py 项目: themson/progcom
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))
示例#5
0
文件: app.py 项目: pgagnon/progcom
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())
示例#6
0
文件: app.py 项目: rmoorman/progcom
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())
示例#7
0
文件: app.py 项目: aldeka/progcom
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())
示例#8
0
文件: app.py 项目: cczona/progcom
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())