-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from elekto-io/migration
Security updates and migration code for 0.6
- Loading branch information
Showing
8 changed files
with
258 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
{% extends 'layouts/app.html' %} | ||
|
||
{% block header %} | ||
<h1>{% block title %}{{ election['name'] }}{% endblock %}</h1> | ||
{% endblock %} | ||
|
||
{% block breadcrums %} | ||
<a href="{{ url_for('elections') }}" class="breadcrums">elections</a> | ||
<a href="{{ url_for('elections_single', eid=election['key']) }}" class="breadcrums breadcrums-active">{{ | ||
election['name'] }}</a> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
|
||
|
||
<div class=""> | ||
<div class="space--md pb-0"> | ||
<h1 class="banner-title space-lr"> | ||
{{ election['name'] }} | ||
</h1> | ||
<p class="banner-subtitle space-lr mb-2rem"> | ||
<span class="mr-5px">{{ election['organization'] }}</span> | ||
<span class="text-muted mr-5px">|</span> | ||
<small class="badge mr-5px badge-{{ election['status'] }} ">{{ election['status'] }}</small> | ||
<span class="text-muted mr-5px">|</span> | ||
{% if g.user.username in voters['eligible_voters'] %} | ||
<small class="badge badge-blue ">eligible</small> | ||
{% else %} | ||
<small class="badge badge-blue">Not eligible</small> | ||
{% endif %} | ||
</p> | ||
<div class="description space-lr pb-0"> | ||
{{ election['description'] | safe }} | ||
</div> | ||
</div> | ||
<div class="space--md pt-0"> | ||
<h4 class="title space-lr mb-1rem"> | ||
Your Ballot | ||
</h4> | ||
<div class="space-lr"> | ||
{% for ballot in ballots %} | ||
<div class="boxed-hover row" style="border: 1px solid #80808012;"> | ||
<div class="col-10 pt-5px pl-0"> | ||
<h6 class="title mt-5px pb-0 mb-0"> | ||
{{ ballot.candidate }} | ||
</h6> | ||
</div> | ||
<div class="col-2 text--right"> | ||
<h6 class="title mt-5px pb-0 mb-0"> | ||
{{ ballot.rank }} | ||
</h6> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
<p class="disclaimer space-lr mt-1rem"> | ||
{% 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> | ||
|
||
<div class="space--md pt-0"> | ||
<div class="space-lr row"> | ||
{% if election['status'] == 'running' and g.user.username in voters['eligible_voters'] %} | ||
{% if g.user.id not in voted %} | ||
<div class="col-md-2 pr-0"> | ||
<a href="{{ url_for('elections_voting_page', eid=election['key'])}}" class="btn btn-dark pl-3rem pr-3rem">Vote</a> | ||
</div> | ||
{% else %} | ||
<div class="col-md-6"> | ||
<form action="{{ url_for('elections_edit', eid=election['key']) }}" method="post"> | ||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/> | ||
<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">Revoke Ballot</button> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
{% endif %} | ||
{% endif %} | ||
<div class="col-md-6 | ||
{% if election['status'] == 'running' and g.user.username in voters['eligible_voters'] %} | ||
pl-0 | ||
{% endif %} | ||
"> | ||
{% if election['status'] == 'completed' %} | ||
{% if election['results'] %} | ||
<a href="{{ url_for('elections_results', eid=election['key'])}}" class="btn btn-dark">Results</a> | ||
{% else %} | ||
<button class="btn btn-dark" disabled>Results (not published)</button> | ||
{% endif %} | ||
{% endif %} | ||
|
||
{% if g.user.username in election['election_officers'] %} | ||
<a href="{{ url_for('elections_admin', eid=election['key'])}}" class="btn btn-dark">Admin</a> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters