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
Tags
No related merge requests found
Showing
with 46 additions and 42 deletions
app.yaml
settings.py
*.pyc *.pyc
.DS_Store .DS_Store
*~ *~
\ No newline at end of file
application: iacr-helios application: XXX-helios
version: 1 version: 1
runtime: python runtime: python
api_version: 1 api_version: 1
...@@ -19,13 +19,13 @@ handlers: ...@@ -19,13 +19,13 @@ handlers:
secure: always secure: always
- url: /static - url: /static
static_dir: iacr/media static_dir: single-election/media
secure: always secure: always
# this overrides the style for the booth # this overrides the style for the booth
# without having to fork the code # without having to fork the code
- url: /booth/css - url: /booth/css
static_dir: iacr/media/boothcss static_dir: single-election/media/boothcss
secure: always secure: always
- url: /booth - url: /booth
......
...@@ -107,7 +107,7 @@ DEFAULT_FROM_EMAIL = 'Ben Adida for Helios <ben@adida.net>' ...@@ -107,7 +107,7 @@ DEFAULT_FROM_EMAIL = 'Ben Adida for Helios <ben@adida.net>'
SERVER_EMAIL = DEFAULT_FROM_EMAIL SERVER_EMAIL = DEFAULT_FROM_EMAIL
# Make this unique, and don't share it with anybody. # Make this unique, and don't share it with anybody.
SECRET_KEY = 'iacrrulez!!!ohyeah,andheliostoo' SECRET_KEY = 'votingrulez!!!ohyeah,andheliostoo'
LOGIN_URL = '/auth/' LOGIN_URL = '/auth/'
#LOGOUT_URL = '/account/logout/' #LOGOUT_URL = '/account/logout/'
...@@ -117,7 +117,7 @@ INSTALLED_APPS = ( ...@@ -117,7 +117,7 @@ INSTALLED_APPS = (
'appengine_django', 'appengine_django',
'auth', 'auth',
'helios', 'helios',
'iacr', 'single-election',
) )
...@@ -125,6 +125,20 @@ APPEND_SLASH = False ...@@ -125,6 +125,20 @@ APPEND_SLASH = False
DEBUG = True DEBUG = True
TEMPLATE_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 import glue
...@@ -8,7 +8,7 @@ import helios ...@@ -8,7 +8,7 @@ import helios
import auth import auth
import auth.models import auth.models
helios.TEMPLATE_BASE = "iacr/templates/base.html" helios.TEMPLATE_BASE = "single-election/templates/base.html"
helios.ADMIN_ONLY = True helios.ADMIN_ONLY = True
helios.ADMIN = auth.models.User.get_or_create(user_type = 'password', user_id = 'benadida', info={'password':'test'}) 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 @@ ...@@ -7,7 +7,7 @@
xml:lang="{% firstof LANGUAGE_CODE 'en' %}" xml:lang="{% firstof LANGUAGE_CODE 'en' %}"
lang="{% firstof LANGUAGE_CODE 'en' %}"> lang="{% firstof LANGUAGE_CODE 'en' %}">
<head> <head>
<title>{% block title %}{% endblock %} - IACR Helios</title> <title>{% block title %}{% endblock %} - Helios</title>
{% block css %} {% block css %}
<!-- <!--
<link rel="stylesheet" type="text/css" media="screen, projection" href="{{ MEDIA_URL }}combined-{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}.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 @@ ...@@ -30,7 +30,7 @@
<body> <body>
<div id="content"> <div id="content">
<div id="header"> <div id="header">
<img src="/static/iacrlogo.gif" /><br /> <img src="/static/logo.gif" /><br />
{% block header %} {% block header %}
{% endblock %} {% endblock %}
</div> </div>
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
{% block content %}{% endblock %} {% block content %}{% endblock %}
<div id="footer"> <div id="footer">
<br /><br /> <br /><br />
<em>This web site is not endorsed by the IACR. It is only meant for demonstration purposes.</em>
</div> </div>
</div> </div>
......
{% extends 'iacr/templates/base.html' %} {% extends 'single-election/templates/base.html' %}
{% block title %}Confirm Vote{% endblock %} {% block title %}Confirm Vote{% endblock %}
{% block content %} {% block content %}
...@@ -38,7 +38,7 @@ function show_waiting() { ...@@ -38,7 +38,7 @@ function show_waiting() {
</form> </form>
<p> <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> </p>
</div> </div>
......
{% extends 'iacr/templates/base.html' %} {% extends 'single-election/templates/base.html' %}
{% block title %}Confirm Vote{% endblock %} {% block title %}Confirm Vote{% endblock %}
{% block content %} {% block content %}
......
{% extends 'iacr/templates/base.html' %} {% extends 'single-election/templates/base.html' %}
{% block content %} {% block content %}
......
{% extends 'iacr/templates/base.html' %} {% extends 'single-election/templates/base.html' %}
{% block title %}IACR Helios{% endblock %} {% block title %}Single Election Helios{% endblock %}
{% block header %} {% block header %}
<h2>IACR Election</h2> <h2>Single Election</h2>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<p> <p>
Welcome the IACR 2009 Board Election. Welcome to the SINGLE HELIOS ELECTION Server.
</p> </p>
<p> <p>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<p style="font-size: 1.4em;"> <p style="font-size: 1.4em;">
Proceed to 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> </p>
{% endblock %} {% endblock %}
File moved
""" """
Utilities for iacr views Utilities for single election views
Ben Adida (2009-07-18) Ben Adida (2009-07-18)
""" """
...@@ -26,5 +26,5 @@ def render_template(request, template_name, vars = {}): ...@@ -26,5 +26,5 @@ def render_template(request, template_name, vars = {}):
if request.session.has_key('csrf_token'): if request.session.has_key('csrf_token'):
vars_with_user['csrf_token'] = request.session['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 * from helios.models import *
...@@ -17,27 +17,15 @@ from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpRespons ...@@ -17,27 +17,15 @@ from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpRespons
from django.conf import settings from django.conf import settings
ELECTION_SHORT_NAME = 'iacr09'
def get_election(): 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): def home(request):
# create the election if need be election_params = settings.SINGLE_ELECTION_PARAMS
election_params = { election_params['cast_url'] = settings.URL_HOST + reverse(cast)
'short_name' : ELECTION_SHORT_NAME, election_params['admin'] = helios.ADMIN
'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
}
# create the election if need be
election, created_p = Election.get_or_create(**election_params) election, created_p = Election.get_or_create(**election_params)
return render_template(request, "index") return render_template(request, "index")
......
...@@ -5,5 +5,5 @@ from django.contrib import admin ...@@ -5,5 +5,5 @@ from django.contrib import admin
urlpatterns = patterns('', urlpatterns = patterns('',
(r'^auth/', include('auth.urls')), (r'^auth/', include('auth.urls')),
(r'^helios/', include('helios.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