Skip to content
Snippets Groups Projects
Commit 280b566c authored by Ben Adida's avatar Ben Adida
Browse files

made things a lot more generic

parent 882458f8
Branches
No related tags found
No related merge requests found
Showing
with 46 additions and 42 deletions
app.yaml
settings.py
*.pyc
.DS_Store
*~
\ No newline at end of file
application: iacr-helios
application: XXX-helios
version: 1
runtime: python
api_version: 1
......@@ -19,13 +19,13 @@ handlers:
secure: always
- url: /static
static_dir: iacr/media
static_dir: single-election/media
secure: always
# this overrides the style for the booth
# without having to fork the code
- url: /booth/css
static_dir: iacr/media/boothcss
static_dir: single-election/media/boothcss
secure: always
- url: /booth
......
......@@ -107,7 +107,7 @@ DEFAULT_FROM_EMAIL = 'Ben Adida for Helios <ben@adida.net>'
SERVER_EMAIL = DEFAULT_FROM_EMAIL
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'iacrrulez!!!ohyeah,andheliostoo'
SECRET_KEY = 'votingrulez!!!ohyeah,andheliostoo'
LOGIN_URL = '/auth/'
#LOGOUT_URL = '/account/logout/'
......@@ -117,7 +117,7 @@ INSTALLED_APPS = (
'appengine_django',
'auth',
'helios',
'iacr',
'single-election',
)
......@@ -125,6 +125,20 @@ APPEND_SLASH = False
DEBUG = True
TEMPLATE_DEBUG = True
URL_HOST = "https://iacr-helios.appspot.com"
URL_HOST = "https://FILL-ME-IN-helios.appspot.com"
# election stuff
SINGLE_ELECTION_UUID = 'FILL-ME-IN'
SINGLE_ELECTION_SHORT_NAME = 'FILL-ME-IN'
SINGLE_ELECTION_PARAMS = {
'short_name' : SINGLE_ELECTION_SHORT_NAME,
'name' : 'IACR 2009 Election',
'description' : 'Election for the IACR Board - 2009',
'uuid' : 'iacr',
'openreg': False,
'tally_type': 'homomorphic',
'ballot_type': 'homomorphic',
'use_voter_aliases': True
}
IACR_ELECTION_UUID = 'iacr'
\ No newline at end of file
"""
This django app is meant only to connect the pieces of Helios and Auth that are specific to IACR
This django app is meant only to connect the pieces of Helios and Auth that are specific to single election
"""
import glue
......@@ -8,7 +8,7 @@ import helios
import auth
import auth.models
helios.TEMPLATE_BASE = "iacr/templates/base.html"
helios.TEMPLATE_BASE = "single-election/templates/base.html"
helios.ADMIN_ONLY = True
helios.ADMIN = auth.models.User.get_or_create(user_type = 'password', user_id = 'benadida', info={'password':'test'})
......
File moved
logo.gif
\ No newline at end of file
File moved
File moved
......@@ -7,7 +7,7 @@
xml:lang="{% firstof LANGUAGE_CODE 'en' %}"
lang="{% firstof LANGUAGE_CODE 'en' %}">
<head>
<title>{% block title %}{% endblock %} - IACR Helios</title>
<title>{% block title %}{% endblock %} - Helios</title>
{% block css %}
<!--
<link rel="stylesheet" type="text/css" media="screen, projection" href="{{ MEDIA_URL }}combined-{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}.css" />
......@@ -30,7 +30,7 @@
<body>
<div id="content">
<div id="header">
<img src="/static/iacrlogo.gif" /><br />
<img src="/static/logo.gif" /><br />
{% block header %}
{% endblock %}
</div>
......@@ -43,7 +43,6 @@
{% block content %}{% endblock %}
<div id="footer">
<br /><br />
<em>This web site is not endorsed by the IACR. It is only meant for demonstration purposes.</em>
</div>
</div>
......
{% extends 'iacr/templates/base.html' %}
{% extends 'single-election/templates/base.html' %}
{% block title %}Confirm Vote{% endblock %}
{% block content %}
......@@ -38,7 +38,7 @@ function show_waiting() {
</form>
<p>
Forgot your password? <a href="{% url auth.auth_systems.password.password_forgotten_view %}?return_url={% url iacr.views.cast_confirm %}">Have it emailed to you</a>.<br />(don't worry, we won't forget your vote).
Forgot your password? <a href="{% url auth.auth_systems.password.password_forgotten_view %}?return_url={% url single-election.views.cast_confirm %}">Have it emailed to you</a>.<br />(don't worry, we won't forget your vote).
</p>
</div>
......
{% extends 'iacr/templates/base.html' %}
{% extends 'single-election/templates/base.html' %}
{% block title %}Confirm Vote{% endblock %}
{% block content %}
......
{% extends 'iacr/templates/base.html' %}
{% extends 'single-election/templates/base.html' %}
{% block content %}
......
{% extends 'iacr/templates/base.html' %}
{% block title %}IACR Helios{% endblock %}
{% extends 'single-election/templates/base.html' %}
{% block title %}Single Election Helios{% endblock %}
{% block header %}
<h2>IACR Election</h2>
<h2>Single Election</h2>
{% endblock %}
{% block content %}
<p>
Welcome the IACR 2009 Board Election.
Welcome to the SINGLE HELIOS ELECTION Server.
</p>
<p>
......@@ -25,7 +25,7 @@
<p style="font-size: 1.4em;">
Proceed to
<a href="{% url helios.views.one_election_view settings.IACR_ELECTION_UUID %}">the IACR election</a>.
<a href="{% url helios.views.one_election_view settings.SINGLE_ELECTION_UUID %}">the SINGLE HELIOS ELECTION</a>.
</p>
{% endblock %}
File moved
"""
Utilities for iacr views
Utilities for single election views
Ben Adida (2009-07-18)
"""
......@@ -26,5 +26,5 @@ def render_template(request, template_name, vars = {}):
if request.session.has_key('csrf_token'):
vars_with_user['csrf_token'] = request.session['csrf_token']
return render_to_response('iacr/templates/%s.html' % template_name, vars_with_user)
return render_to_response('single-election/templates/%s.html' % template_name, vars_with_user)
"""
IACR specific views
single-election specific views
"""
from helios.models import *
......@@ -17,27 +17,15 @@ from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpRespons
from django.conf import settings
ELECTION_SHORT_NAME = 'iacr09'
def get_election():
return Election.get_by_key_name(ELECTION_SHORT_NAME)
return Election.get_by_key_name(settings.SINGLE_ELECTION_SHORT_NAME)
def home(request):
# create the election if need be
election_params = {
'short_name' : ELECTION_SHORT_NAME,
'name' : 'IACR 2009 Election',
'description' : 'Election for the IACR Board - 2009',
'uuid' : 'iacr',
'cast_url' : settings.URL_HOST + reverse(cast),
'openreg': False,
'admin' : helios.ADMIN,
'tally_type': 'homomorphic',
'ballot_type': 'homomorphic',
'use_voter_aliases': True
}
election_params = settings.SINGLE_ELECTION_PARAMS
election_params['cast_url'] = settings.URL_HOST + reverse(cast)
election_params['admin'] = helios.ADMIN
# create the election if need be
election, created_p = Election.get_or_create(**election_params)
return render_template(request, "index")
......
......@@ -5,5 +5,5 @@ from django.contrib import admin
urlpatterns = patterns('',
(r'^auth/', include('auth.urls')),
(r'^helios/', include('helios.urls')),
(r'^', include('iacr.urls')),
(r'^', include('single-election.urls')),
)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment