+ "LEFT JOIN voter canceler ON canceler.id = motion.canceled_by "
+ "WHERE motion.id=$1")
rv = p(motion, g.voter)
- return render_template('single_motion.html', motion=rv[0], may_vote=may("vote", rv[0].get("type")), may_cancel=may("cancel", rv[0].get("type")))
+ votes = None
+ if may("audit", rv[0].get("type")):
+ votes = get_db().prepare("SELECT vote.result, voter.email FROM vote INNER JOIN voter ON voter.id = vote.voter_id WHERE vote.motion_id=$1")(motion);
+ return render_template('single_motion.html', motion=rv[0], may_vote=may("vote", rv[0].get("type")), may_cancel=may("cancel", rv[0].get("type")), votes=votes)
@app.route("/motion/<int:motion>/vote", methods=['POST'])
def vote(motion):
{%- endblock %}
{% block body %}
{%- include 'motion.html' %}
+{%- if votes %}
+<div class="panel panel-info" id="votes">
+ <div class="panel-heading">
+ Motion Votes
+ </div>
+ <div class="panel-body">
+ {%- for row in votes %}
+ <div>{{row.email}}: {{row.result}}</div>
+ {%- endfor %}
+ </div>
+</div>
+{%- endif %}
{%- if motion.running %}
{%- if may_vote %}
<form action="/motion/{{motion.id}}/vote" method="POST">