Skip to content
Snippets Groups Projects
Commit 06fbfc2e authored by Ben Adida's avatar Ben Adida
Browse files

merged voter list and bboard

parent 794170d9
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,7 @@ this election is <u>not</u> featured on the front page.
<p align="center" style="font-size: 1.5em;">
<a href="{% url helios.views.one_election_questions election.uuid %}">questions ({% if election.questions %}{{election.questions|length}}{% else %}0{% endif %})</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="{% url helios.views.voters_list_pretty election.uuid %}">voters</a>
<a href="{% url helios.views.voters_list_pretty election.uuid %}">voters &amp; ballots</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="{% url helios.views.list_trustees_view election.uuid %}">trustees ({{trustees|length}})</a>
</p>
......@@ -241,7 +241,7 @@ You are <em>not eligible</em> to vote in this election, because registration is
{% endif %}
<p style="font-size: 1.3em;">
<a href="{% url helios.views.one_election_bboard election.uuid %}">Ballot Tracking Center</a> &nbsp;| &nbsp;
<a href="{% url helios.views.voters_list_pretty election.uuid %}">Ballot Tracking Center</a> &nbsp;| &nbsp;
<a href="{% url helios.views.one_election_audited_ballots election.uuid %}">Audited Ballots</a>
</p>
......
......@@ -21,7 +21,11 @@
<p>
{% if q %}
<p><em>searching for <u>{{q}}</u>.</em> [<a href="?">clear search</a>]</p>
{% else %}
<form method="get" action="{% url helios.views.voters_list_pretty election.uuid %}"><b>search</b>: <input type="text" name="q" /> <input type="submit" value="search" /></form>
{% endif %}
</p>
<br />
{% if admin_p and upload_p %}
......@@ -56,13 +60,13 @@ Prior Bulk Uploads:
{% if voters %}
{% if voters_page.has_previous %}
<a href="./list?page={{voters_page.previous_page_number}}&limit={{limit}}">previous {{limit}}</a> &nbsp;&nbsp;
<a href="./list?page={{voters_page.previous_page_number}}&limit={{limit}}&q={{q|urlencode}}">previous {{limit}}</a> &nbsp;&nbsp;
{% endif %}
Voters {{voters_page.start_index}} - {{voters_page.end_index}} (of {{total_voters}})&nbsp;&nbsp;
{% if voters_page.has_next %}
<a href="./list?page={{voters_page.next_page_number}}&limit={{limit}}">next {{limit}}</a> &nbsp;&nbsp;
<a href="./list?page={{voters_page.next_page_number}}&limit={{limit}}&q={{q|urlencode}}">next {{limit}}</a> &nbsp;&nbsp;
{% endif %}
<table class="pretty">
......@@ -99,7 +103,7 @@ Voters {{voters_page.start_index}} - {{voters_page.end_index}} (of {{total_voter
</table>
{% else %}
<em>no voters yet</em>
<em>no voters.</em>
{% endif %}
{% endblock %}
......@@ -838,6 +838,7 @@ def voters_list_pretty(request, election):
# for django pagination support
page = int(request.GET.get('page', 1))
limit = int(request.GET.get('limit', 50))
q = request.GET.get('q','')
order_by = 'voter_id'
......@@ -849,6 +850,13 @@ def voters_list_pretty(request, election):
# load a bunch of voters
voters = Voter.get_by_election(election, order_by=order_by)
if q != '':
if election.use_voter_aliases:
voters = voters.filter(alias__icontains = q)
else:
voters = voters.filter(name__icontains = q)
total_voters = voters.count()
voter_paginator = Paginator(voters, limit)
......@@ -858,7 +866,7 @@ def voters_list_pretty(request, election):
'voters': voters_page.object_list, 'admin_p': admin_p,
'email_voters': helios.VOTERS_EMAIL,
'limit': limit, 'total_voters': total_voters,
'upload_p': helios.VOTERS_UPLOAD,
'upload_p': helios.VOTERS_UPLOAD, 'q' : q,
'voter_files': voter_files})
@election_admin(frozen=False)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment