Skip to content

Commit

Permalink
Merge pull request #48 from elekto-io/revokeballot
Browse files Browse the repository at this point in the history
Changes to ballot revokation workflow
  • Loading branch information
jberkus authored Oct 19, 2021
2 parents 92a54c6 + ef0e874 commit 46597d4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion elekto/controllers/elections.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def elections_edit(eid):

SESSION.commit()
F.flash('The old ballot is sucessfully deleted, please re-cast the ballot.')
return F.redirect(F.url_for('elections_voting_page', eid=eid))
return F.redirect(F.url_for('elections_single', eid=eid))


@APP.route('/app/elections/<eid>/confirmation', methods=['GET'])
Expand Down
13 changes: 9 additions & 4 deletions elekto/templates/views/elections/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,20 @@ <h2 class="title pb-0 mb-0">
{% endfor %}
</div>
<p class="disclaimer space-lr mt-1rem">
The poll starts from <b>{{ election['start_datetime'] }} UTC</b> and ends at
{% if election['status'] == 'running' and g.user.username in voters['eligible_voters'] %}
{% if g.user.id in voted %}
You have cast your vote.
{% else %}
You have not yet voted in this election.
{% endif %}
{% endif %}
Voting starts at <b>{{ election['start_datetime'] }} UTC</b> and ends at
<b>{{ election['end_datetime'] }} UTC</b>.

{% if g.user.username not in voters['eligible_voters'] %}
If you wish to participate in the election, please fill the
<a href="{{ url_for('elections_exception', eid=election['key']) }}"><b>exception form</b></a>
before <b>{{ election['exception_due'] }}</b>.
{% endif %}

</p>
</div>

Expand All @@ -83,7 +88,7 @@ <h2 class="title pb-0 mb-0">
<div class="input-group">
<input type="password" name="password" class="form-control" placeholder="Enter the passphrase" id="">
<div class="input-group-append">
<button type="submit" class="btn btn-dark">Re-Cast Ballot</button>
<button type="submit" class="btn btn-dark">Revoke Ballot</button>
</div>
</div>
</form>
Expand Down
6 changes: 3 additions & 3 deletions elekto/templates/views/elections/vote.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ <h1 class="banner-title space-lr">
<small class="badge mr-5px badge-{{ election['status'] }} ">{{ election['status'] }}</small>
</p>
<p class="disclaimer space-lr mt-1rem">
Only the {% if election['no_winners'] > 1 %} {{ election['no_winners']}} {% else %} single {% endif %} favorite chocie{% if election['no_winners'] > 1 %}s {% endif %} will win the election.
Only the {% if election['no_winners'] > 1 %} {{ election['no_winners']}} {% else %} single {% endif %} preferred candidate{% if election['no_winners'] > 1 %}s {% endif %} will win the election.
The poll ends at <b>{{ election['end_datetime'] }} UTC</b>. Contact the poll supervisor{% if election['election_officers'] | length > 1 %}s{% endif %} if you need help.
<br />

<b>Note:</b> A lower rank indicates a higher preference and "No opinion" does not indicate the lowest preference; it means you do not choose to rank this choice with respect to other choices.
<b>Note:</b> Rank your most preferred candidate as "1" and less preferred candidates with higher numbers. "No opinion" does not indicate the lowest preference; it means you do not choose to rank this choice with respect to other choices.
</p>
</div>
<div class="space--md pt-0">
Expand Down Expand Up @@ -61,7 +61,7 @@ <h6 class="title mt-5px pb-0 mb-0">
<div class="mt-2rem pt-2rem row">
<div class="col-md-6 text-justify">
<small>
If you wish to be able to re-cast this ballot, please enter a passphrase here. If you do not enter a passphrase, you will not be able to change your vote later.
If you wish to be able to revoke this ballot, please enter a passphrase here. If you do not enter a passphrase, you will not be able to change or delete your vote later.
</small>
</div>
<div class="col-md-6 pt-5px">
Expand Down

0 comments on commit 46597d4

Please sign in to comment.