Skip to content

Commit 46597d4

Browse files
authored
Merge pull request #48 from elekto-io/revokeballot
Changes to ballot revokation workflow
2 parents 92a54c6 + ef0e874 commit 46597d4

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

elekto/controllers/elections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def elections_edit(eid):
151151

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

156156

157157
@APP.route('/app/elections/<eid>/confirmation', methods=['GET'])

elekto/templates/views/elections/single.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,20 @@ <h2 class="title pb-0 mb-0">
5757
{% endfor %}
5858
</div>
5959
<p class="disclaimer space-lr mt-1rem">
60-
The poll starts from <b>{{ election['start_datetime'] }} UTC</b> and ends at
60+
{% if election['status'] == 'running' and g.user.username in voters['eligible_voters'] %}
61+
{% if g.user.id in voted %}
62+
You have cast your vote.
63+
{% else %}
64+
You have not yet voted in this election.
65+
{% endif %}
66+
{% endif %}
67+
Voting starts at <b>{{ election['start_datetime'] }} UTC</b> and ends at
6168
<b>{{ election['end_datetime'] }} UTC</b>.
62-
6369
{% if g.user.username not in voters['eligible_voters'] %}
6470
If you wish to participate in the election, please fill the
6571
<a href="{{ url_for('elections_exception', eid=election['key']) }}"><b>exception form</b></a>
6672
before <b>{{ election['exception_due'] }}</b>.
6773
{% endif %}
68-
6974
</p>
7075
</div>
7176

@@ -83,7 +88,7 @@ <h2 class="title pb-0 mb-0">
8388
<div class="input-group">
8489
<input type="password" name="password" class="form-control" placeholder="Enter the passphrase" id="">
8590
<div class="input-group-append">
86-
<button type="submit" class="btn btn-dark">Re-Cast Ballot</button>
91+
<button type="submit" class="btn btn-dark">Revoke Ballot</button>
8792
</div>
8893
</div>
8994
</form>

elekto/templates/views/elections/vote.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ <h1 class="banner-title space-lr">
2222
<small class="badge mr-5px badge-{{ election['status'] }} ">{{ election['status'] }}</small>
2323
</p>
2424
<p class="disclaimer space-lr mt-1rem">
25-
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.
25+
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.
2626
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.
2727
<br />
2828

29-
<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.
29+
<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.
3030
</p>
3131
</div>
3232
<div class="space--md pt-0">
@@ -61,7 +61,7 @@ <h6 class="title mt-5px pb-0 mb-0">
6161
<div class="mt-2rem pt-2rem row">
6262
<div class="col-md-6 text-justify">
6363
<small>
64-
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.
64+
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.
6565
</small>
6666
</div>
6767
<div class="col-md-6 pt-5px">

0 commit comments

Comments
 (0)