Skip to content

Commit

Permalink
added a bunch of trustee related things
Browse files Browse the repository at this point in the history
  • Loading branch information
benadida committed Jan 4, 2010
1 parent b262692 commit 6b47fef
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion templates/election_build.html
@@ -1,7 +1,7 @@
{% extends "helios/templates/cryptobase.html" %}

{% block content %}
<h2 class="title">{{election.name}} &mdash; Questions <span style="font-size:0.7em;">[<a href="{% url helios.views.one_election_view election_id=election.uuid %}">done</a>]</span></h2>
<h2 class="title">{{election.name}} &mdash; Questions <span style="font-size:0.7em;">[<a href="{% url helios.views.one_election_view election.uuid %}">done</a>]</span></h2>

<script language="javascript">
{% if election.questions %}
Expand Down
2 changes: 1 addition & 1 deletion templates/election_keygenerator.html
Expand Up @@ -62,7 +62,7 @@

</script>

<h2 class="title">{{election.name}} &mdash; Trustee Keypair Generator</h2>
<h2 class="title">{{election.name}} &mdash; Trustee {{trustee.name}} &mdash; Keypair Generator</h2>

<p>
This is a trustee keypair generator for your election.
Expand Down
10 changes: 5 additions & 5 deletions templates/election_view.html
Expand Up @@ -34,10 +34,10 @@
</li>

{% if not election.frozen_at %}
<li> <a href="{% url helios.views.one_election_build election_id=election.uuid %}">questions and answers</a></li>
<li> <a href="{% url helios.views.one_election_build election.uuid %}">questions and answers</a></li>
<li> <a href="{% url helios.views.list_trustees_view election.uuid %}">trustees</a></li>
<li> <a href="{% url helios.views.voters_manage election_id=election.uuid %}">manage voters</a></li>
<li> <a href="{% url helios.views.one_election_freeze election_id=election.uuid %}"><em>freeze</em> ballot and<br />open election for voting.</a></li>
<li> <a href="{% url helios.views.voters_manage election.uuid %}">manage voters</a></li>
<li> <a href="{% url helios.views.one_election_freeze election.uuid %}"><em>freeze</em> ballot and<br />open election for voting.</a></li>
{% else %}

{% if election.encrypted_tally %}
Expand All @@ -55,9 +55,9 @@
{% else %}

{% if email_voters %}
<li> <a href="{% url helios.views.voters_email election_id=election.uuid %}">email voters</a></li>
<li> <a href="{% url helios.views.voters_email election.uuid %}">email voters</a></li>
{% endif %}
<li> <a href="{% url helios.views.one_election_compute_tally election_id=election.uuid %}">compute tally</a></li>
<li> <a href="{% url helios.views.one_election_compute_tally election.uuid %}">compute tally</a></li>

{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion templates/list_trustees.html
Expand Up @@ -27,7 +27,7 @@ <h2 class="title">{{election.name}} &mdash; Trustees <span style="font-size:0.7e
<h3> Trustee #{{forloop.counter}}: {{t.name}} {% if not election.frozen_at %}
{% if admin_p %}
({{t.email}})
[<a onclick="return confirm('Are you sure you want to remove this Trustee?');" href="{% url helios.views.delete_trustee election.uuid %}?uuid={{t.uuid}}">x</a>]
{% if not election.frozen_at %}[<a onclick="return confirm('Are you sure you want to remove this Trustee?');" href="{% url helios.views.delete_trustee election.uuid %}?uuid={{t.uuid}}">x</a>]{% endif %}
[<a onclick="return confirm('Are you sure you want to send this trustee his/her admin URL?');" href="{% url helios.views.trustee_send_url election.uuid t.uuid %}">send login</a>]
{% endif %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion templates/voters_manage.html
@@ -1,7 +1,7 @@
{% extends TEMPLATE_BASE %}

{% block content %}
<h2 class="title">{{election.name}} &mdash; Manage Voters <span style="font-size:0.7em;">[<a href="{% url helios.views.one_election_view election_id=election.uuid %}">done</a>]</span></h2>
<h2 class="title">{{election.name}} &mdash; Manage Voters <span style="font-size:0.7em;">[<a href="{% url helios.views.one_election_view election.uuid %}">done</a>]</span></h2>

<table class="pretty">
<tr><th>Alias</th><th>Name</th><th>Username</th></tr>
Expand Down
19 changes: 19 additions & 0 deletions test.py
@@ -0,0 +1,19 @@
"""
Testing Helios Features
"""

from helios.models import *
from auth.models import *
import uuid

def generate_voters(election, num_voters = 1000, start_with = 1):
# generate the user
for v_num in range(start_with, start_with + num_voters):
user = User(user_type='password', user_id='testuser%s' % v_num, name='Test User %s' % v_num)
user.put()
voter = Voter(uuid=str(uuid.uuid1()), election = election, voter_type=user.user_type, voter_id = user.user_id)
voter.put()

def delete_voters(election):
for v in Voter.get_by_election(election):
v.delete()

0 comments on commit 6b47fef

Please sign in to comment.