Skip to content
Snippets Groups Projects
Commit dd014684 authored by jan.bednarik's avatar jan.bednarik
Browse files

Pirati patch

parent 19555c3e
Branches
No related tags found
No related merge requests found
Showing
with 327 additions and 288 deletions
# Helios Election System
Helios is an end-to-end verifiable voting system.
[![Travis Build Status](https://travis-ci.org/benadida/helios-server.svg?branch=master)](https://travis-ci.org/benadida/helios-server)
Fork used by the Czech Pirate Party. Includes PirateID integration and Czech translation.
[![Stories in Ready](https://badge.waffle.io/benadida/helios-server.png?label=ready&title=Ready)](https://waffle.io/benadida/helios-server)
Helios is an end-to-end verifiable voting system.
# -*- coding: utf-8 -*-
"""
Forms for Helios
"""
......@@ -11,40 +12,40 @@ from .widgets import SplitSelectDateTimeWidget
class ElectionForm(forms.Form):
short_name = forms.SlugField(max_length=40, help_text='no spaces, will be part of the URL for your election, e.g. my-club-2010')
name = forms.CharField(max_length=100, widget=forms.TextInput(attrs={'size':60}), help_text='the pretty name for your election, e.g. My Club 2010 Election')
description = forms.CharField(max_length=4000, widget=forms.Textarea(attrs={'cols': 70, 'wrap': 'soft'}), required=False)
election_type = forms.ChoiceField(label="type", choices = Election.ELECTION_TYPES)
use_voter_aliases = forms.BooleanField(required=False, initial=False, help_text='If selected, voter identities will be replaced with aliases, e.g. "V12", in the ballot tracking center')
short_name = forms.SlugField(max_length=40, help_text=u'bez mezer, bude použita jako část URL vašeho hlasování, např. kf-msk-20-2018-zmena-rozpoctu', label=u"Zkratka")
name = forms.CharField(max_length=100, widget=forms.TextInput(attrs={'size':60}), help_text=u'plný název vašeho hlasování, např. KF MSK 20/2018 Změna rozpočtu', label=u"Název")
description = forms.CharField(max_length=32000, widget=forms.Textarea(attrs={'cols': 70, 'wrap': 'soft'}), required=False, label=u"Popis")
election_type = forms.ChoiceField(label=u"Typ", choices = Election.ELECTION_TYPES)
use_voter_aliases = forms.BooleanField(required=False, initial=False, help_text=u'zvolíte-li tuto možnost, na stránce pro sledování hlasovacích lístků budou jména voličů nahrazena aliasy, např. "V12"', label=u"Použít aliasy voličů")
#use_advanced_audit_features = forms.BooleanField(required=False, initial=True, help_text='disable this only if you want a simple election with reduced security but a simpler user interface')
randomize_answer_order = forms.BooleanField(required=False, initial=False, help_text='enable this if you want the answers to questions to appear in random order for each voter')
private_p = forms.BooleanField(required=False, initial=False, label="Private?", help_text='A private election is only visible to registered voters.')
help_email = forms.CharField(required=False, initial="", label="Help Email Address", help_text='An email address voters should contact if they need help.')
randomize_answer_order = forms.BooleanField(required=False, initial=False, help_text=u'zvolte, pokud chcete, aby se každému voliči zobrazovaly odpovědi na otázky v náhodně zvoleném pořadí', label=u"Odpovědi v náhodném pořadí")
private_p = forms.BooleanField(required=False, initial=False, label=u"Soukromé?", help_text=u'Soukromé hlasování je viditelné jen pro registrované voliče.')
help_email = forms.CharField(required=False, initial="", label=u"E-mail pro nápovědu", help_text=u'e-mailová adresa, na kterou se budou voliči obracet s žádostmi o pomoc.')
voting_starts_at = SplitDateTimeField(help_text = u'datum a čas zahájení hlasování; v UTC, takže oproti časovému pásmu ČR je menší o 1 hodinu v zimním, resp. o 2 hodiny v letním čase',
widget=SplitSelectDateTimeWidget, required=False, label=u"Hlasování začíná v")
voting_ends_at = SplitDateTimeField(help_text = u'datum a čas ukončení hlasování; v UTC, takže oproti časovému pásmu ČR je menší o 1 v zimním, resp. o 2 hodiny v letním čase',
widget=SplitSelectDateTimeWidget, required=False, label=u"Hlasování končí v")
if settings.ALLOW_ELECTION_INFO_URL:
election_info_url = forms.CharField(required=False, initial="", label="Election Info Download URL", help_text="the URL of a PDF document that contains extra election information, e.g. candidate bios and statements")
election_info_url = forms.CharField(required=False, initial="", label=u"URL pro stažení informací o hlasování", help_text=u"URL dokumentu ve formátu PDF, obsahujícího doplňkové informace k hlasování, např. životopisy a profily kandidátů")
# times
voting_starts_at = SplitDateTimeField(help_text = 'UTC date and time when voting begins',
widget=SplitSelectDateTimeWidget, required=False)
voting_ends_at = SplitDateTimeField(help_text = 'UTC date and time when voting ends',
widget=SplitSelectDateTimeWidget, required=False)
pass
class ElectionTimeExtensionForm(forms.Form):
voting_extended_until = SplitDateTimeField(help_text = 'UTC date and time voting extended to',
widget=SplitSelectDateTimeWidget, required=False)
voting_extended_until = SplitDateTimeField(help_text = u'datum a čas prodlouženého ukončení hlasování; v UTC',
widget=SplitSelectDateTimeWidget, required=False, label=u"Hlasování prodlouženo do")
class EmailVotersForm(forms.Form):
subject = forms.CharField(max_length=80)
body = forms.CharField(max_length=4000, widget=forms.Textarea)
send_to = forms.ChoiceField(label="Send To", initial="all", choices= [('all', 'all voters'), ('voted', 'voters who have cast a ballot'), ('not-voted', 'voters who have not yet cast a ballot')])
send_to = forms.ChoiceField(label=u"Poslat", initial="all", choices= [('all', u'všem voličům'), ('voted', u'voličům, kteří již odevzdali lístek'), ('not-voted', u'voličům, kteří ještě neodevzdali lístek')])
class TallyNotificationEmailForm(forms.Form):
subject = forms.CharField(max_length=80)
body = forms.CharField(max_length=2000, widget=forms.Textarea, required=False)
send_to = forms.ChoiceField(label="Send To", choices= [('all', 'all voters'), ('voted', 'only voters who cast a ballot'), ('none', 'no one -- are you sure about this?')])
send_to = forms.ChoiceField(label=u"Poslat", choices= [('all', u'všem voličům'), ('voted', u'jen voličům, kteří odevzdali lístek'), ('none', u'nikomu -- jste si tím jist?')])
class VoterPasswordForm(forms.Form):
voter_id = forms.CharField(max_length=50, label="Voter ID")
voter_id = forms.CharField(max_length=50, label=u"ID voliče")
password = forms.CharField(widget=forms.PasswordInput(), max_length=100)
......@@ -4,12 +4,12 @@
<h4>
{#if $T.admin_p}[
{#if $T.question$index > 0}<a href="javascript:question_move_up({$T.question$index});">^</a>]&nbsp;[{#/if}
<a onclick="return confirm('Are you sure you want to remove this question?');" href="javascript:question_remove({$T.question$index})">x</a>] [<a href="javascript:question_edit({$T.question$index})">edit</a>] {#/if}{$T.question$index + 1}. {$T.question.question} ({$T.question.choice_type}, select between {$T.question.min} and {#if $T.question.max != null}{$T.question.max}{#else}unlimited{#/if} answers, result type {$T.question.result_type}{#if $T.question.randomize_answer_order}, random answer order{#/if}.)</h4>
<a onclick="return confirm('Určitě chcete odstranit tuto otázku?');" href="javascript:question_remove({$T.question$index})">x</a>] [<a href="javascript:question_edit({$T.question$index})">upravit</a>] {#/if}{$T.question$index + 1}. {$T.question.question} ({$T.question.choice_type}, zvolte mezi {$T.question.min} a {#if $T.question.max != null}{$T.question.max}{#else}neomezeně{#/if} odpověďmi, typ výsledku {$T.question.result_type}.)</h4>
<ul>
{#foreach $T.question.answers as answer}
<li> {$T.answer}
{#if $T.question.answer_urls[$T.answer$index]}
[<a target="_new" href="{$T.question.answer_urls[$T.answer$index]}">more</a>]
[<a target="_new" href="{$T.question.answer_urls[$T.answer$index]}">podrobnosti</a>]
{#/if}
</li>
{#/for}
......@@ -25,15 +25,16 @@
</select>
-->
<input type="hidden" name="choice_type" value="approval" />
<b>{$T.question$index + 1}.</b> &nbsp;&nbsp;&nbsp;Select between &nbsp;&nbsp;
<b>{$T.question$index + 1}.</b> &nbsp;&nbsp;&nbsp;Zvolte mezi &nbsp;&nbsp;
<select name="min">
<option selected>0</option>
{#for option_index = 1 to 20}
<option>0</option>
<option selected>1</option>
{#for option_index = 2 to 20}
<option>{$T.option_index}</option>
{#/for}
</select>
&nbsp;&nbsp; and &nbsp;&nbsp;
&nbsp;&nbsp; a &nbsp;&nbsp;
<select name="max">
<option>0</option>
......@@ -45,14 +46,14 @@
</select>
&nbsp;&nbsp;
answers.
odpověďmi.
&nbsp;&nbsp;
&nbsp;&nbsp;
Result Type:&nbsp;
Typ výsledku:&nbsp;
<select name="result_type">
<option selected>absolute</option>
<option>relative</option>
<option selected>absolut</option>
<option>relativ</option>
</select>
&nbsp;&nbsp;
......@@ -66,23 +67,23 @@ Random Answer Order:&nbsp;
<table id="answer_table_{$T.question$index}">
<tbody>
<tr><th colspan="2">Question:</th><td><input type="text" name="question" size="70" /></td></tr>
<tr><th colspan="2">Otázka:</th><td><input type="text" name="question" size="70" /></td></tr>
<tr><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th></tr>
</tbody>
<tfoot>
<tr><th colspan="2"></th><th><a href="javascript:add_answers($('#answer_table_{$T.question$index}'),5)">add 5 more answers</a></th></tr>
<tr><td colspan="3"><input type="submit" value="update question" /> &nbsp; <input type="reset" value="cancel" onclick="question_edit_cancel({$T.question$index});" /></td></tr>
<tr><th colspan="2"></th><th><a href="javascript:add_answers($('#answer_table_{$T.question$index}'),5)">přidat 5 dalších odpovědí</a></th></tr>
<tr><td colspan="3"><input type="submit" value="změnit otázku" /> &nbsp; <input type="reset" value="zpět" onclick="question_edit_cancel({$T.question$index});" /></td></tr>
</tfoot>
</table>
</form>
</div>
{#else}
no questions yet
zatím žádné otázky
{#/for}
{#if $T.admin_p}
<h4>Add a Question:</h4>
<h4>Přidat otázku:</h4>
<form id="question_form" onsubmit="question_add(this); return false;" action="#">
<p>
<!--
......@@ -92,15 +93,16 @@ no questions yet
</select>
-->
<input type="hidden" name="choice_type" value="approval" />
&nbsp;&nbsp;&nbsp;Select between &nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;Zvolte mezi &nbsp;&nbsp;
<select name="min">
<option selected>0</option>
{#for option_index = 1 to 20}
<option>0</option>
<option selected>1</option>
{#for option_index = 2 to 20}
<option>{$T.option_index}</option>
{#/for}
</select>
&nbsp;&nbsp; and &nbsp;&nbsp;
&nbsp;&nbsp; a &nbsp;&nbsp;
<select name="max">
<option>0</option>
......@@ -112,14 +114,14 @@ no questions yet
</select>
&nbsp;&nbsp;
answers.
odpověďmi.
&nbsp;&nbsp;
&nbsp;&nbsp;
Result Type:&nbsp;
Typ výsledku:&nbsp;
<select name="result_type">
<option selected>absolute</option>
<option>relative</option>
<option selected>absolut</option>
<option>relativ</option>
</select>
&nbsp;&nbsp;
......@@ -135,12 +137,12 @@ Random Answer Order:&nbsp;
<table id="answer_table" style="width:100%;">
<tbody>
<tr><th colspan="2">Question:</th><td><input type="text" name="question" size="70" /></td></tr>
<tr><th colspan="2">Otázka:</th><td><input type="text" name="question" size="70" /></td></tr>
<tr><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th></tr>
</tbody>
<tfoot>
<tr><th colspan="2"></th><th><a href="javascript:add_answers($('#answer_table'), 5)">add 5 more answers</a></th></tr>
<tr><td colspan="2"><input type="submit" value="add question" /></td></tr>
<tr><th colspan="2"></th><th><a href="javascript:add_answers($('#answer_table'), 5)">přidat 5 dalších odpovědí</a></th></tr>
<tr><td colspan="2"><input type="submit" value="přidat otázku" /></td></tr>
</tfoot>
</table>
......
......@@ -382,27 +382,27 @@ class Election(HeliosModel):
if self.questions is None or len(self.questions) == 0:
issues.append(
{'type': 'questions',
'action': "add questions to the ballot"}
'action': u"přidat do hlasovacího lístku otázky"}
)
trustees = Trustee.get_by_election(self)
if len(trustees) == 0:
issues.append({
'type': 'trustees',
'action': "add at least one trustee"
'action': u"přidat aspoň jednoho trusteeho"
})
for t in trustees:
if t.public_key is None:
issues.append({
'type': 'trustee keypairs',
'action': 'have trustee %s generate a keypair' % t.name
'action': u'nechat trusteeho %s vytvořit si svůj pár klíčů' % t.name
})
if self.voter_set.count() == 0 and not self.openreg:
issues.append({
"type" : "voters",
"action" : 'enter your voter list (or open registration to the public)'
"action" : u'zadat seznam voličů (nebo ponechat veřejné registrace)'
})
return issues
......@@ -481,6 +481,41 @@ class Election(HeliosModel):
## FIXME
return 0
def load_eligible_voters(self):
"""
try to load voters by eligibility constraints
"""
if self.eligibility == None:
return
if self.openreg == False:
return
total_load = True
for eligibility_case in self.eligibility:
auth_system = eligibility_case['auth_system']
if not 'constraint' in eligibility_case:
total_load = False
else:
if hasattr(AUTH_SYSTEMS[auth_system], 'can_list_category_members'):
for constraint in eligibility_case['constraint']:
category_id = AUTH_SYSTEMS[auth_system].eligibility_category_id(constraint)
user_list = AUTH_SYSTEMS[auth_system].list_category_members(category_id)
if self.use_voter_aliases:
random.shuffle(user_list)
for u in user_list:
user = User.update_or_create(user_type = u['type'], user_id = u['id'], name = u['name'], info = u['info'], token = u['token'])
Voter.register_user_in_election(user, self)
else:
total_load = False
if total_load:
self.openreg = False
def set_eligibility(self):
"""
if registration is closed and eligibility has not been
......@@ -531,6 +566,8 @@ class Election(HeliosModel):
self.frozen_at = datetime.datetime.utcnow()
self.load_eligible_voters()
# voters hash
self.generate_voters_hash()
......
......@@ -16,16 +16,16 @@
<br />
{% endif %}
You are logged in as <u>{{voter.display_html_big|safe}}</u><br /><br />
Jste přihlášeni jako <u>{{voter.display_html_big|safe}}</u><br /><br />
<button type="submit" class="large">CAST this ballot</button>
<span style="font-size:0.8em;"><br />You can cast as many ballots as you want.<br />Only the last one counts.</span>
<button type="submit" class="large">ODEVZDAT tento lístek</button>
<span style="font-size:0.8em;"><br />Můžete odevzdat tolik lístků, kolik chcete.<br />Pouze poslední se počítá.</span>
</form>
<p>
<button class="tiny" onclick="document.location='{% url "election@view" election.uuid %}';">cancel</button><br />
<span style="font-size:0.8em;">If you cancel now, your ballot will <em>NOT</em> be recorded.<br />
You can start the voting process over again, of course.</span>
<button class="tiny" onclick="document.location='{% url "election@view" election.uuid %}';">zrušit</button><br />
<span style="font-size:0.8em;">Pokud zrušíte nyní, váš lístek <em>NEBUDE</em> zaznamenán.<br />
Samozřejmě můžete proces hlasování zopakovat od začátku.</span>
</p>
<!-- for now, for CSRF protection, no auto-submit just yet (benadida) -->
......@@ -34,11 +34,11 @@ You are logged in as <u>{{voter.display_html_big|safe}}</u><br /><br />
</div>
{% else %}
<p style="font-size:1.4em;">
voting has stopped, sorry.
Hlasování bylo ukončeno, sorry.
</p>
{% endif %}
{% else %}
<p style="font-size:1.4em;">
voting has not yet begun, sorry.
Hlasování ještě nezačalo, sorry.
</p>
{% endif %}
Please provide the voter ID and password you received by email.<br /><br />
Prosím zadejte ID voliče a heslo které jste obdrželi emailem.<br /><br />
<form method="post" action="{% url "election@password-voter-login" election.uuid %}" onsubmit="show_waiting()">
<input type="hidden" name="csrf_token" value="{{csrf_token}}" />
<input type="hidden" name="return_url" value="{{return_url}}" />
......@@ -8,12 +8,12 @@ Please provide the voter ID and password you received by email.<br /><br />
</table>
{% if bad_voter_login %}
<p style="color: red;">
bad voter ID or password, please try again.
špatné ID voliče nebo heslo, zkuste znovu prosím.
</p>
{% endif %}
{% if cast_ballot == "1" %}
<p class="small">
You may cast as many ballots as you wish:<br />only the last one counts.
Můžete vhodit lístků kolik chcete:<br />pouze poslední se počítá.
</p>
<input type="submit" class="button" value="cast ballot" />
{% else %}
......
......@@ -2,27 +2,27 @@
{% block title %}Confirm Vote{% endblock %}
{% block content %}
<h1>{{election.name}} &mdash; Vote Successfully Cast!</h1>
<h1>{{election.name}} &mdash; Hlas úspěšně odeslán!</h1>
<p>
Congratulations, your vote has been <b><u>successfully cast</u></b>!
Gratulujeme, váš hlasy byl <b><u>úspěšně odeslán</u></b>!
</p>
{% if vote_hash %}
<p>
Your smart ballot tracker is:<br /><br />
Váš chytrý sledovač lístku je:<br /><br />
<tt style="font-size:1.8em; font-weight: bold; padding-left: 20px;"> {{vote_hash}}</tt>
</p>
{% endif %}
{% if logout %}
<p><b>For your safety, we have logged you out.</b></p>
<p><b>Pro vaši bezpečnost jsme vás odhlásili.</b></p>
<iframe width="0" height="0" border="0" frameborder="0" src="{% url "auth@logout" %}">
</iframe>
{% endif %}
<p style="font-size: 1.4em;">
[ <a href="{% url "election@view" election.uuid %}">return to election info</a> ]
[ <a href="{% url "election@view" election.uuid %}">vrátit se k informacím o volbě</a> ]
</p>
{% endblock %}
......@@ -2,9 +2,9 @@
{% block title %}{{cast_vote.vote_tinyhash}} &mdash; {{election.name}}{% endblock %}
{% block content %}
<h2 class="title">Cast Vote {{cast_vote.vote_tinyhash}}</h2>
cast in <a href="{% url "election@view" election.uuid %}">{{election.name}}</a><br />
Fingerprint: <tt>{{cast_vote.vote_hash}}</tt><br />
<h2 class="title">Odeslat hlas {{cast_vote.vote_tinyhash}}</h2>
hlasovat v <a href="{% url "election@view" election.uuid %}">{{election.name}}</a><br />
Otisk: <tt>{{cast_vote.vote_hash}}</tt><br />
by <b><u>
{% if the_voter.alias %}
{{the_voter.alias}}
......@@ -13,7 +13,7 @@ by <b><u>
{% endif %}
</u></b>
<br /><br />
<a href="#" onclick="$('#castvote_content').slideToggle(250); return false;">details</a><br /><br />
<a href="#" onclick="$('#castvote_content').slideToggle(250); return false;">podrobnosti</a><br /><br />
<div style="display:none;" id="castvote_content">
<textarea cols="100" rows="10">
{{vote_content}}
......
{% extends TEMPLATE_BASE %}
{% block title %}Compute Tally &mdash; {{election.name}}{% endblock %}
{% block title %}Spočítat výsledek &mdash; {{election.name}}{% endblock %}
{% block content %}
<h2 class="title">{{election.name}} &mdash; Compute Tally <span style="font-size:0.7em;">[<a href="{% url "election@view" election.uuid %}">cancel</a>]</span></h2>
<h2 class="title">{{election.name}} &mdash; Spočítej výsledek <span style="font-size:0.7em;">[<a href="{% url "election@view" election.uuid %}">zrušit</a>]</span></h2>
<p>
You are about to compute the tally for this election. You only will then see the results.
Chystáte se spočítat výsledek pro toto hlasování. Pouze vy pak uvidíte výsledek.
</p>
<form method="POST" action="">
<input type="hidden" name="csrf_token" value="{{csrf_token}}" />
<input type="submit" class="button" value="compute the tally!" />
<input type="submit" class="button" value="Spočítat výsledek!" />
</form>
{% endblock %}
{% if show_title %}<h3 style="padding:0; margin:0">{{election.name}}</h3>{% endif %}
<b>{{election.num_cast_votes}}</b> cast votes.{% if show_vote_link %} [<a target="_top" href="{{election_url}}">vote!</a>]{% endif %}<br />
<b>{{election.num_cast_votes}}</b> odevzdaných hlasů.{% if show_vote_link %} [<a target="_top" href="{{election_url}}">Hlasovat!</a>]{% endif %}<br />
<span style="font-size:0.7em;">powered by <a target="_top" href="http://heliosvoting.org">Helios Voting</a></span>
{% extends TEMPLATE_BASE %}
{% block title %}Ballot Tracking Center for {{election.name}}{% endblock %}
{% block title %}Sledování hlasovacích lístků pro {{election.name}}{% endblock %}
{% block content %}
<h2 class="title">{{election.name}} &mdash; Ballot Tracking Center <span style="font-size:0.7em;">[<a href="{% url "election@view" election_uuid=election.uuid %}">back to election</a>]</span></h2>
<h2 class="title">{{election.name}} &mdash; Sledování hlasovacích lístků <span style="font-size:0.7em;">[<a href="{% url "election@view" election_uuid=election.uuid %}">zpět k hlasování</a>]</span></h2>
<p>
This is the ballot tracking center, which displays the tracking numbers of all cast ballots in this election.
Na této stránce lze sledovat hlasovací lístky. Jsou zde zobrazeny sledovací kódy všech hlasovacích lístků odevzdaných v tomto hlasování.
</p>
<p>
<b>{{election.num_cast_votes}}</b> cast votes.
<b>{{election.num_cast_votes}}</b> odevzdaných hlasů.
</p>
Voters {{offset_plus_one}} - {{offset_plus_limit}} &nbsp;&nbsp;
Voliči {{offset_plus_one}} - {{offset_plus_limit}} &nbsp;&nbsp;
{% if next_after %}
<a href="{% url "election@bboard" election.uuid %}?after={{next_after}}&offset={{offset_plus_limit}}">next {{limit}}</a> &nbsp;&nbsp;
<a href="{% url "election@bboard" election.uuid %}?after={{next_after}}&offset={{offset_plus_limit}}">dalších {{limit}}</a> &nbsp;&nbsp;
{% endif %}
{% ifequal offset 0 %}
{% else %}
<a href="{% url "election@bboard" election.uuid %}">back to start</a> &nbsp;&nbsp;
<a href="{% url "election@bboard" election.uuid %}">zpět na začátek</a> &nbsp;&nbsp;
{% endifequal %}
{% if more_p %}
<a href="{% url "election@bboard" election.uuid %}?after={{next_after}}&offset={{next_offset}}">next {{limit}}</a>
<a href="{% url "election@bboard" election.uuid %}?after={{next_after}}&offset={{next_offset}}">dalších {{limit}}</a>
{% endif %}
<table class="pretty">
<tr><th>
{% if election.use_voter_aliases %}
Alias
{% else %}
Name
Jméno
{% endif %}
</th><th>Smart Ballot Tracker</th></tr>
</th><th>Kód pro sledování hlasovacího lístku</th></tr>
{% for voter in voters %}
<tr><td>
{% if election.use_voter_aliases %}
{{voter.alias}}
{% else %}
<img border="0" height="20" src="/static/auth/login-icons/{{voter.voter_type}}.png" alt="{{voter.voter_type}}" /> {% if voter.name %}{{voter.name}}{% else %}{{voter.voter_id}}{% endif %}
{% endif %}</td><td><tt style="font-size: 1.4em;;">{% if voter.vote_hash %}{{voter.vote_hash}} <span style="font-size:0.8em;">[<a href="{% url "election@ballots@voter@last" election_uuid=election.uuid voter_uuid=voter.uuid %}">view</a>]</span>{% else %}&mdash;{% endif %}</tt></td></tr>
{% endif %}</td><td><tt style="font-size: 1.4em;;">{% if voter.vote_hash %}{{voter.vote_hash}} <span style="font-size:0.8em;">[<a href="{% url "election@ballots@voter@last" election_uuid=election.uuid voter_uuid=voter.uuid %}">zobrazit</a>]</span>{% else %}&mdash;{% endif %}</tt></td></tr>
{% endfor %}
</table>
......
{% extends "helios/templates/cryptobase.html" %}
{% block content %}
<h2 class="title">{{election.name}} &mdash; Questions <span style="font-size:0.7em;">[<a href="{% url "election@view" election.uuid %}">back to election</a>]</span></h2>
<h2 class="title">{{election.name}} &mdash; Otázky <span style="font-size:0.7em;">[<a href="{% url "helios.views.one_election_view" election.uuid %}">zpět k hlasování</a>]</span></h2>
<h2 class="title">{{election.name}} &mdash; Otázky <span style="font-size:0.7em;">[<a href="{% url "election@view" election.uuid %}">zpět k hlasování</a>]</span></h2>
<script language="javascript">
{% if election.questions %}
......
{% extends TEMPLATE_BASE %}
{% block title %}Confirm Vote{% endblock %}
{% block title %}Potvrďte svůj hlas{% endblock %}
{% block content %}
<script language="javascript">
......@@ -24,7 +24,7 @@ window.onbeforeunload = function(evt) {
evt = window.event;
}
var message = "You have not yet cast your ballot! Make sure to complete the voting process if you want your vote to count.";
var message = "Ještě jste neodevzdal svůj hlasovací lístek! Chcete-li, aby váš hlas byl započten, musíte hlasovací proces dokončit.";
if (evt) {
evt.returnValue = message;
......@@ -34,10 +34,10 @@ window.onbeforeunload = function(evt) {
};
</script>
<p style="margin-top: 10px">Submitting your vote for <b>{{election.name}}</b>...</p>
<p style="margin-top: 10px">Odesílám váš hlas v hlasování <b>{{election.name}}</b>...</p>
<div id="waiting_div">
Verifying and Casting your ballot<br />
Kontroluji a odevzdávám váš hlasovací lístek<br />
<img src="/static/helios/loading.gif" />
</div>
......@@ -51,10 +51,10 @@ window.onbeforeunload = function(evt) {
{% if show_password %}
{% if user %}
<h1>Wait!</h1>
<h1>Pozor!</h1>
<p>
You are logged in as <u>{{user.display_html_small|safe}}</u>, but this election<br />
requires election-specific credentials.
Jste přihlášen jako <u>{{user.display_html_small|safe}}</u>, ale toto hlasování<br />
vyžaduje speciální oprávnění.
</p>
{% endif %}
{% with cast_ballot="1" %}
......@@ -64,42 +64,42 @@ requires election-specific credentials.
{% else %}
{% if user %}
<h1>Sorry!<h1>
<b>Sorry, you are <em>
<h1>Je nám líto!<h1>
<b>Bohužel <em>
{% if election.openreg %}
<u>not eligible</u></em> for this election.
<u>nejste oprávněn</u></em> hlasovat v tomto hlasování.
{% else %}
not registered</em> for this election, and registration is closed.
nejste v seznamu voličů</em> pro toto hlasování a seznam voličů byl již uzavřen.
{% endif %}
</b><br /></p>
<p>
[<a href="{% url "election@view" election.uuid %}">return to the main election page</a>]
[<a href="{% url "election@view" election.uuid %}">návrat na úvodní stránku hlasování</a>]
</p>
{% else %}
<p>
<h1>Wait! You need to log in.</h1>
<h1>Pozor! Musíte se přihlásit.</h1>
{% if election.openreg %}
{% if election.eligibility %}
{% else %}
This election is open to <em>anyone</em>, so log in with your preferred account.
Tohoto hlasování se může zúčastnit <em>kdokoli</em>, přihlaste se tedy uživatelským účtem, kterému dáváte přednost.
{% endif %}
{% else %}
This election is only open to <em>registered voters</em>, so log in with
the same account you registered with.
Tohoto hlasování se mohou zúčastnit pouze <em>oprávnění voliči</em>, přihlaste se tedy
takovým uživatelským účtem, který vás opravňuje volit.
{% endif %}
</p>
{{login_box|safe}}
<br />
Don't worry, we'll remember your ballot while you log in.
Nemusíte mít obavy, svůj vyplněný hlasovací lístek budete mít k dispozici i po přihlášení.
{% endif %}
{% endif %}
<br />
Your smart ballot tracker is:<br /><br />
Váš kód pro sledování hlasovacího lístku je:<br /><br />
<tt style="font-size:1.3em; font-weight: bold; padding-left: 20px;"> {{vote_fingerprint}}</tt>
</p>
{# this closes the IF ELSE of this being password_only #}
......
{% extends TEMPLATE_BASE %}
{% block title %}Compute Encryted Tally for {{election.name}}{% endblock %}
{% block title %}Spočítat zašifrovaný výsledek pro {{election.name}}{% endblock %}
{% block content %}
<h2 class="title">Compute Tally for Election: {{election.name}}</h2>
<h2 class="title">Spočítat výsledek pro hlasování: {{election.name}}</h2>
<div id="instructions">
{% if election.num_cast_votes %}
<p>
You are about to compute the encrypted tally for election <b>{{election.name}}</b>.
Chystáte se nechat spočítat zašifrovaný výsledek hlasování <b>{{election.name}}</b>.
</p>
<p>
Once you do this, voters will no longer be able to cast a ballot.
Jakmile tak učiníte, voliči již nebudou moci odevzdávat hlasovací lístky.
</p>
<form method="post" action="" onsubmit="alert('ok, tally has begun')" class="pretty">
<form method="post" action="" onsubmit="alert('sčítání hlasů bylo zahájeno')" class="pretty">
<input type="hidden" name="csrf_token" value="{{csrf_token}}" />
<input class="button" type="submit" value="compute encrypted tally!" />
<button onclick="document.location='{% url "election@view" election.uuid %}'; return false;">never mind</button>
<input class="button" type="submit" value="Spočítat zašifrovaný výsledek!" />
<button onclick="document.location='{% url "election@view" election.uuid %}'; return false;">ještě ne</button>
</form>
{% else %}
<p>
No votes have been cast in this election. At least one vote must be cast before you compute the tally.<br /><br />
<a href="{% url "election@view" election.uuid %}">back to election</a>
V tomto hlasování nebyl odevzdán žádný hlas. Aby mohl být spočítán výsledek, musí být odevzdán aspoň jeden hlas.<br /><br />
<a href="{% url "election@view" election.uuid %}">zpět na hlasování</a>
</p>
{% endif %}
</div>
......
......@@ -2,7 +2,7 @@
{% block content %}
<h2 class="title">{{election.name}} &mdash; Update <span style="font-size:0.7em;">[<a href="{% url "election@view" election.uuid %}">cancel</a>]</span></h2>
<h2 class="title">{{election.name}} &mdash; Upravit <span style="font-size:0.7em;">[<a href="{% url "election@view" election.uuid %}">zrušit</a>]</span></h2>
{% if error %}
<p style="color: red;">
......@@ -16,7 +16,7 @@
{{election_form.as_table}}
</table>
<div>
<label for="">&nbsp;</label><input type="submit" value="Update" id="update_button" />
<label for="">&nbsp;</label><input type="submit" value="Upravit" id="update_button" />
</div>
</form>
......
......@@ -2,7 +2,7 @@
{% block content %}
<h2 class="title">{{election.name}} &mdash; Extend Voting <span style="font-size:0.7em;">[<a href="{% url "election@view" election.uuid %}">cancel</a>]</span></h2>
<h2 class="title">{{election.name}} &mdash; Prodloužit hlasování <span style="font-size:0.7em;">[<a href="{% url "election@view" election.uuid %}">zrušit</a>]</span></h2>
<form class="prettyform" action="" method="POST" id="edit_election_form">
<input type="hidden" name="csrf_token" value="{{csrf_token}}" />
......@@ -10,7 +10,7 @@
{{election_form.as_table}}
</table>
<div>
<label for="">&nbsp;</label><input type="submit" value="Extend Voting" id="update_button" />
<label for="">&nbsp;</label><input type="submit" value="Prodloužit hlasování" id="update_button" />
</div>
</form>
......
{% extends TEMPLATE_BASE %}
{% block content %}
<h2 class="title">{{election.name}} &mdash; Freeze Ballot</h2>
<h2 class="title">{{election.name}} &mdash; Uzavřít hlasovací lístek</h2>
<p>
Once the ballot is frozen, the questions and options can no longer be modified.<br />
The list of trustees and their public keys will also be frozen.
Jakmile je hlasovací lístek uzavřen, otázky a možnosti již nemohou být změněny.<br />
Bude také uzavřen seznam trustees jejich veřejných klíčů.
</p>
<p>
{% if election.openreg %}
Registration for your election is currently <b>open</b>, which means anyone can vote, even after you freeze the ballot.
Registrace pro toto hlasování je <b>otevřená</b>, což znamená, že hlasovat může kdokoli, a to i po uzavření hlasovacího lístku.
{% else %}
Registration for your election is currently <b>closed</b>, which means only the voters you designate will be able to cast a ballot. As the administrator, you will still be able to modify that voter list as the election progresses.
Registrace pro toto hlasování je <b>uzavřená</b>, což znamená že jen voliči, které určíte, budou moci odevzdat hlasovací lístek. Jste-li administrátor, budete moci upravit seznam voličů i během hlasování.
{% endif %}
</p>
{% if helios.VOTERS_EMAIL %}
<p>
You must freeze the ballot before you can contact voters.
Před kontaktováním voličů musíte uzavřít hlasovací lístek.
</p>
{% endif %}
{% if issues_p %}
<p>
Before you can freeze the election, you will need to:
Před uzavřením tvorby hlasování musíte:
<ul>
{% for issue in issues %}
<li>{{issue.action}}</li>
{% endfor %}
</ul>
<a href="{% url "election@view" election.uuid %}">go back to the election</a>
<a href="{% url "election@view" election.uuid %}">zpět k hlasování</a>
</p>
{% else %}
<form method="post" action="">
<input type="hidden" name="csrf_token" value="{{csrf_token}}" />
<input class="button" type="submit" value="Freeze the ballot" />
<button onclick="document.location='{% url "election@view" election.uuid %}'; return false;">never mind</button>
<input class="button" type="submit" value="Uzavřít hlasovací lístek" />
<button onclick="document.location='{% url "election@view" election.uuid %}'; return false;">ještě ne</button>
</form>
{% endif %}
......
......@@ -99,14 +99,14 @@ function show_pk() {
</script>
<h2 class="title">{{election.name}} &mdash; Trustee {{trustee.name}} &mdash; Key Setup</h2>
<h2 class="title">{{election.name}} &mdash; Trustee {{trustee.name}} &mdash; nastavení klíče</h2>
<p>
As a trustee, it's time to set up your key for this election.
Jako trustee nyní musíte nastavit svůj klíč pro toto hlasování.
</p>
<p id="waiting_message">
Please wait for the generator to load...
Vyčkejte, prosím, nahrává se generátor...
</p>
<p id="generator">
......@@ -114,64 +114,64 @@ function show_pk() {
<span id="buttons"><button onclick="generate_keypair(); return false;" id="generate_button">Generate Election Keys</button></span>
<br />
If you've already generated a keypair, you can <a href="javascript:show_key_reuse()">reuse it</a>.
Pokud máte již vygenerovaný pár klíčů, můžete jej <a href="javascript:show_key_reuse()">znovu použít</a>.
</p>
<div id="reuse">
<h3>Reusing a Key</h3>
<h3>Opětovné použití klíče</h3>
<p>
Enter your complete secret key below:
Vložte celý svůj tajný klíč do okénka níže:
</p>
<form onsubmit="reuse_key(this.secret_key.value); return false;">
<textarea cols="80" rows="5" wrap="soft" name="secret_key">
</textarea>
<br />
<input type="submit" value="reuse" />
<input type="submit" value="opětovně použít" />
</form>
</div>
<div id="sk_download">
<h3>Your Secret Key</h3>
<span id="clear_button">
Your key has been generated, but you may choose to<br /><a href="javascript:clear_keys();">clear it from memory and start from scratch</a> if you prefer.<br />
Váš klíč byl vytvořen, ale můžete se rozhodnout<br /><a href="javascript:clear_keys();">vymazat ho z paměti a začít znovu</a>.<br />
</span>
<p>
<button style="font-size:16pt;" onclick="download_sk(); $('#pk_link').show();">Show my secret key</button>
<button style="font-size:16pt;" onclick="download_sk(); $('#pk_link').show();">Zobrazit tajný klíč</button>
</p>
</div>
<div style="display:none;" id="pk_content">
<p>Bellow is your trustee secret key content. Please copy its content and save it securely. <br>
You can also click to dowload it to a file.
And please don't lose it! Otherwise it will not be possible to decrypt the election tally.<br>
<p>Níže je zobrazen váš tajný klíč. Prosím zkopírujte si ho a bezpečně uložte. <br>
Můžete si ho také kliknutím stáhnout v souboru.
A prosím neztraťte ho! Jinak nebude možné hlasování dešifrovat.<br>
</p>
<textarea id="sk_content" rows="5" wrap="soft" cols="50" style="height: 25em;"></textarea>
</div>
<div style="display:none;" id="pk_link">
<p>
<a id="download_to_file" href="javascript:download_sk_to_file('trustee_key_for_{{election.name}}.txt');">download private key to a file</a>
<a id="download_to_file" href="javascript:download_sk_to_file('trustee_key_for_{{election.name}}.txt');">uložit soubor s tajným klíčem</a>
</p>
<p>
<a href="javascript:show_pk();">ok, I've saved the key, let's move on</a>
<a href="javascript:show_pk();">ok, klíč mám uložen, můžeme pokračovat</a>
</p>
</div>
<form method="post" id="pk_form" action="{% url "election@trustee@upload-pk" election.uuid trustee.uuid %}">
<h3>Your Public Key</h3>
<p>
It's time to upload the public key to the server.
Nyní je třeba nahrát váš veřejný klíč na server.
</p>
<p>
The fingerprint of your public key is: <tt id="pk_hash" style="font-size: 1.5em; font-weight: bold;"></tt>.<br />
You may want to save this to confirm that your public key was properly stored by the server.<br />
(Your public key is not currently being displayed because you do not need to save it, the fingerprint is sufficient.)
Otisk vašeho veřejného klíče je: <tt id="pk_hash" style="font-size: 1.5em; font-weight: bold;"></tt>.<br />
Můžete si ho uložit kvůli ověření, že váš veřejný klíč byl v pořádku uložen na server.<br />
(Nezobrazujeme celý váš veřejný klíč, neboť není potřeba, abyste si ho ukládal, otisk postačuje.)
</p>
<textarea id="pk_textarea" name="public_key_json" cols="80" rows="10" style="display:none;">
</textarea>
<input type="submit" value="Upload your public key">
<input type="submit" value="Nahrát veřejný klíč">
</form>
<div id="applet_div"></div>
......
......@@ -2,7 +2,7 @@
{% block content %}
<h2 class="title">Create a New Election</h2>
<h2 class="title">Vytvořit nové hlasování</h2>
{% if error %}
<p style="color: red;">
......@@ -16,7 +16,7 @@
{{election_form.as_table}}
</table>
<div>
<label for="">&nbsp;</label><input type="submit" value="Next &gt;&gt;" id="next_button" />
<label for="">&nbsp;</label><input type="submit" value="Pokračovat &gt;&gt;" id="next_button" />
</div>
</form>
......
......@@ -2,18 +2,18 @@
{% block content %}
<h2 class="title">Election {{election.name}} Not Yet Open</h2>
<h2 class="title">Hlasování {{election.name}} ještě nebylo zahájeno</h2>
<p>
This election is not yet open.
Toto hlasování ještě nebylo zahájeno.
</p>
<p>
{% if election.voting_start_at %}Voting start at {{election.voting_start_at}}<br />{% endif %}
{% if election.voting_end_at %}Voting end at {{election.voting_end_at}}<br />{% endif %}
{% if election.voting_start_at %}začátek hlasování: {{election.voting_start_at}}<br />{% endif %}
{% if election.voting_end_at %}konec hlasování: {{election.voting_end_at}}<br />{% endif %}
</p>
<p>
<a href="{% url "election@view" election.uuid %}">back to the election</a>
<a href="{% url "election@view" election.uuid %}">zpět k hlasování</a>
</p>
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment