Exemplo n.º 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)
Exemplo n.º 2
0
def comment(id):
    comment = request.values.get('comment').strip()
    if comment:
        l.add_to_discussion(request.user.id, id, comment, feedback=False)
    return render_template('discussion_snippet.html',
                           unread=l.is_unread(request.user.id, id),
                           discussion=l.get_discussion(id))
Exemplo n.º 3
0
def comment(id):
    comment = request.values.get('comment').strip()
    if comment:
        l.add_to_discussion(request.user.id, id, comment, feedback=False)
    return render_template('discussion_snippet.html', 
            unread = l.is_unread(request.user.id, id),
            discussion = l.get_discussion(id))
Exemplo n.º 4
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)
Exemplo n.º 5
0
def screening(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()
    progress = l.screening_progress()
    bookmarked = l.has_bookmark(request.user.id, id)

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

    return render_template(
        "screening_proposal.html",
        proposal=proposal,
        votes=votes,
        discussion=discussion,
        standards=standards,
        progress=progress,
        bookmarked=bookmarked,
        existing_vote=existing_vote,
        unread=unread,
    )
Exemplo n.º 6
0
def feedback(id):
    if CUTOFF_FEEDBACK:
        abort(404)
    comment = request.values.get('feedback').strip()
    if comment:
        l.add_to_discussion(request.user.id, id, comment, feedback=True)
    return render_template('discussion_snippet.html',
                           unread=l.is_unread(request.user.id, id),
                           discussion=l.get_discussion(id))
Exemplo n.º 7
0
def feedback(id):
    if CUTOFF_FEEDBACK:
        abort(404)
    comment = request.values.get('feedback').strip()
    if comment:
        l.add_to_discussion(request.user.id, id, comment, feedback=True)
    return render_template('discussion_snippet.html', 
            unread = l.is_unread(request.user.id, id),
            discussion = l.get_discussion(id))
Exemplo n.º 8
0
def mark_read(id):
    l.mark_read(request.user.id, id)
    return render_template('discussion_snippet.html',
                           unread=l.is_unread(request.user.id, id),
                           discussion=l.get_discussion(id))
Exemplo n.º 9
0
def mark_read(id):
    l.mark_read(request.user.id, id)
    return render_template('discussion_snippet.html', 
            unread = l.is_unread(request.user.id, id),
            discussion = l.get_discussion(id))