Skip to content

Commit

Permalink
made ballot preview visible even if election is not frozen
Browse files Browse the repository at this point in the history
  • Loading branch information
benadida committed Mar 2, 2014
1 parent e2d7036 commit 9a48ddc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
14 changes: 14 additions & 0 deletions helios/templates/election_not_started.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends TEMPLATE_BASE %}

{% block content %}

<h2 class="title">Election {{election.name}} Not Yet Open</h2>

<p>
This election is not yet open. You probably got here from the Ballot Preview.
</p>

<p>
<a href="{% url helios.views.one_election_view election.uuid %}">back to the election</a>
</p>
{% endblock %}
4 changes: 2 additions & 2 deletions helios/templates/election_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ <h3 class="highlight-box">Tally</h3>
<a href="{% url helios.views.one_election_audited_ballots election.uuid %}">Audited Ballots</a>
</p>

{% endif %}

{% if not election.voting_has_started %}
<p style="font-size: 1.2em;">
<a href="{{SECURE_URL_HOST}/booth/vote.html?election_url={% url helios.views.one_election election.uuid %}">preview booth</a>
</p>
{% endif %}

{% endif %}

{% if election.voting_has_stopped %}
<p style="font-size: 1.2em;">
{% if election.result %}
Expand Down
9 changes: 7 additions & 2 deletions helios/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ def post_audited_ballot(request, election):
return SUCCESS


@election_view(frozen=True)
# we don't require frozen election to allow for ballot preview
@election_view()
def one_election_cast(request, election):
"""
on a GET, this is a cancellation, on a POST it's a cast
Expand Down Expand Up @@ -593,14 +594,18 @@ def password_voter_login(request, election):

return HttpResponseRedirect(settings.SECURE_URL_HOST + return_url)

@election_view(frozen=True)
@election_view()
def one_election_cast_confirm(request, election):
user = get_user(request)

# if no encrypted vote, the user is reloading this page or otherwise getting here in a bad way
if not request.session.has_key('encrypted_vote'):
return HttpResponseRedirect(settings.URL_HOST)

# election not frozen or started
if not election.voting_has_started():
return render_template(request, 'election_not_started', {'election': election})

voter = get_voter(request, user, election)

# auto-register this person if the election is openreg
Expand Down
2 changes: 1 addition & 1 deletion heliosbooth/templates/seal.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h4><a onclick="$('#auditbody').slideToggle(250);" href="#">Audit</a> <span styl
<h3>Your ballot is ready to be submitted</h3>

<p>
<em>Don't forget to click "Proceed to Cast" below!</em>
<em>Don't forget to click "Proceed to Submission" below!</em>
</p>

<p>Please <b><u>keep a record</u></b> of your smart ballot tracker [<a onclick="BOOTH.show_receipt(); return false;" href="#">print</a>]:<br /><br />
Expand Down

0 comments on commit 9a48ddc

Please sign in to comment.