diff --git a/.gitignore b/.gitignore index 1cfb0a5e80ba13584237ab477c4951168b7da1f1..4defc1280f22a26b7735d3b78423f32ee68ef0f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +app.yaml +settings.py *.pyc .DS_Store *~ \ No newline at end of file diff --git a/app.yaml b/app.yaml.sample similarity index 85% rename from app.yaml rename to app.yaml.sample index 783f3674a7f3bb0900af1f55ad720082371c84f1..a162a36017fc6ba31f7ce0a972db9710b456849b 100644 --- a/app.yaml +++ b/app.yaml.sample @@ -1,4 +1,4 @@ -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 diff --git a/settings.py b/settings.py.sample similarity index 88% rename from settings.py rename to settings.py.sample index 14f1a1f8fa518f65c8db37885967362767798537..32b706f94fb8abab185742371093aaefaa0eb203 100644 --- a/settings.py +++ b/settings.py.sample @@ -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 diff --git a/iacr/__init__.py b/single-election/__init__.py similarity index 77% rename from iacr/__init__.py rename to single-election/__init__.py index 38485c0cf2c696fa6d80e7fa36651272673377d1..248656b782b987763de1cd2b86b437a7f3794724 100644 --- a/iacr/__init__.py +++ b/single-election/__init__.py @@ -1,5 +1,5 @@ """ -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'}) diff --git a/iacr/glue.py b/single-election/glue.py similarity index 100% rename from iacr/glue.py rename to single-election/glue.py diff --git a/single-election/media/.gitignore b/single-election/media/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..94a12010e109afd946e2aca452783eafba4ac5db --- /dev/null +++ b/single-election/media/.gitignore @@ -0,0 +1 @@ +logo.gif \ No newline at end of file diff --git a/iacr/media/boothcss/booth.css b/single-election/media/boothcss/booth.css similarity index 100% rename from iacr/media/boothcss/booth.css rename to single-election/media/boothcss/booth.css diff --git a/iacr/media/boothcss/forms.css b/single-election/media/boothcss/forms.css similarity index 100% rename from iacr/media/boothcss/forms.css rename to single-election/media/boothcss/forms.css diff --git a/iacr/media/iacrlogo.gif b/single-election/media/logo.gif.sample similarity index 100% rename from iacr/media/iacrlogo.gif rename to single-election/media/logo.gif.sample diff --git a/iacr/media/main.css b/single-election/media/main.css similarity index 100% rename from iacr/media/main.css rename to single-election/media/main.css diff --git a/iacr/templates/base.html b/single-election/templates/base.html similarity index 86% rename from iacr/templates/base.html rename to single-election/templates/base.html index 0359d5b787241b781f5431259fef75527d3b5ff1..141513ca60930e6c0c3158921924fa70bd856188 100644 --- a/iacr/templates/base.html +++ b/single-election/templates/base.html @@ -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> diff --git a/iacr/templates/confirm.html b/single-election/templates/confirm.html similarity index 81% rename from iacr/templates/confirm.html rename to single-election/templates/confirm.html index 17a854f10cafeed0a67cddb3b04c54d70b50685c..f453da66bc9cf283cdd9888f52bbc08338545acc 100644 --- a/iacr/templates/confirm.html +++ b/single-election/templates/confirm.html @@ -1,4 +1,4 @@ -{% 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> diff --git a/iacr/templates/done.html b/single-election/templates/done.html similarity index 88% rename from iacr/templates/done.html rename to single-election/templates/done.html index b9a0a4c624098159778ce3c70dc49fd9806b2890..04470342ee8ca73e2878eaa0b1ae581c6d84f793 100644 --- a/iacr/templates/done.html +++ b/single-election/templates/done.html @@ -1,4 +1,4 @@ -{% extends 'iacr/templates/base.html' %} +{% extends 'single-election/templates/base.html' %} {% block title %}Confirm Vote{% endblock %} {% block content %} diff --git a/iacr/templates/election_tallied.html b/single-election/templates/election_tallied.html similarity index 87% rename from iacr/templates/election_tallied.html rename to single-election/templates/election_tallied.html index ab92e3ab365807e14dafbc71aaf7d9312fc66cba..7b536c583328bf9beea82eea78426e9e61bcdf6c 100644 --- a/iacr/templates/election_tallied.html +++ b/single-election/templates/election_tallied.html @@ -1,4 +1,4 @@ -{% extends 'iacr/templates/base.html' %} +{% extends 'single-election/templates/base.html' %} {% block content %} diff --git a/iacr/templates/index.html b/single-election/templates/index.html similarity index 71% rename from iacr/templates/index.html rename to single-election/templates/index.html index b7420c2dd246e787446d7dafed0d300b2b46f4f6..4a8e0cbe2766693e30f2156a1ddee85c94214f59 100644 --- a/iacr/templates/index.html +++ b/single-election/templates/index.html @@ -1,14 +1,14 @@ -{% 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 %} diff --git a/iacr/urls.py b/single-election/urls.py similarity index 100% rename from iacr/urls.py rename to single-election/urls.py diff --git a/iacr/view_utils.py b/single-election/view_utils.py similarity index 82% rename from iacr/view_utils.py rename to single-election/view_utils.py index 5d53ca2603d823718eab5784e88f43d9cd72fcc2..98eec832180b6e753eb1bc8ad6cd293f740f8bb7 100644 --- a/iacr/view_utils.py +++ b/single-election/view_utils.py @@ -1,5 +1,5 @@ """ -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) diff --git a/iacr/views.py b/single-election/views.py similarity index 86% rename from iacr/views.py rename to single-election/views.py index cbb5dbc84fabeb9a985b7ad5024005622f5cb8a2..20a5847076d6e51f8f20b6e967a07e09db68e3b5 100644 --- a/iacr/views.py +++ b/single-election/views.py @@ -1,5 +1,5 @@ """ -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") diff --git a/urls.py b/urls.py index 564c2f8f310f3e2d5ff3f48952be9adf04a91bb0..60e123f1b484ba94e6fcd37dea7bbde5827cc50e 100644 --- a/urls.py +++ b/urls.py @@ -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