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

moved single election stuff to multi election

parent bfad0e27
No related branches found
No related tags found
No related merge requests found
Showing
with 27 additions and 30 deletions
The Helios Single-Election Server
=================================
The Helios Election Server
==========================
LICENSE: this code is released under the GPL v3 or later.
\ No newline at end of file
......@@ -19,13 +19,13 @@ handlers:
secure: always
- url: /static
static_dir: single-election/media
static_dir: server-ui/media
secure: always
# this overrides the style for the booth
# without having to fork the code
- url: /booth/css
static_dir: single-election/media/boothcss
static_dir: server-ui/media/boothcss
secure: always
- url: /booth
......
......@@ -7,9 +7,9 @@ import helios
import auth
import auth.models
#from single-election import glue
#from server-ui import glue
helios.TEMPLATE_BASE = "single-election/templates/base.html"
helios.TEMPLATE_BASE = "server-ui/templates/base.html"
helios.ADMIN_ONLY = True
helios.ADMIN = auth.models.User.get_or_create(user_type = 'cas', user_id = 'yaro', info={})
......
"""
This django app is meant only to connect the pieces of Helios and Auth that are specific to single election
This django app is meant only to connect the pieces of Helios and Auth to present a clean UI
"""
File moved
File moved
File moved
File moved
{% extends 'single-election/templates/base.html' %}
{% extends 'server-ui/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 single-election.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 server-ui.views.cast_confirm %}">Have it emailed to you</a>.<br />(don't worry, we won't forget your vote).
</p>
</div>
......
{% extends 'single-election/templates/base.html' %}
{% extends 'server-ui/templates/base.html' %}
{% block title %}Confirm Vote{% endblock %}
{% block content %}
......
{% extends 'single-election/templates/base.html' %}
{% extends 'server-ui/templates/base.html' %}
{% block content %}
......
{% extends 'single-election/templates/base.html' %}
{% extends 'server-ui/templates/base.html' %}
{% block title %}{{ settings.SITE_TITLE }}{% endblock %}
{% block header %}
......@@ -16,9 +16,14 @@
Learn more about Helios, and why secure voting matters, <a href="http://heliosvoting.org">here</a>.
</p>
<p style="font-size: 1.4em;">
Proceed to
<a href="{% url helios.views.one_election_view settings.SINGLE_ELECTION_UUID %}">the {{settings.SINGLE_ELECTION_TITLE}}</a>.
Current Elections:
<ul>
{% for election in elections %}
<li> <a href="{% url helios.views.one_election_view election.uuid %}">{{election.name}}</a></li>
{% endfor %}
</ul>
</p>
{% endblock %}
File moved
......@@ -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('single-election/templates/%s.html' % template_name, vars_with_user)
return render_to_response('server-ui/templates/%s.html' % template_name, vars_with_user)
"""
single-election specific views
server-ui specific views
"""
from helios.models import *
......@@ -18,22 +18,14 @@ from django.conf import settings
def get_election():
return Election.get_by_key_name(settings.SINGLE_ELECTION_SHORT_NAME)
return None
def home(request):
election_params = settings.SINGLE_ELECTION_PARAMS
# load the featured elections
featured_elections = [Election.get_by_key_name(uuid) for uuid in settings.FEATURED_ELECTION_UUIDS]
featured_elections = [e for e in featured_elections if e != None]
# let's not do this
# election_params['cast_url'] = settings.URL_HOST + reverse(cast)
election_params['cast_url'] = settings.URL_HOST + reverse(helios.views.one_election_cast, args=[election_params['uuid']])
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")
return render_template(request, "index", {'elections': featured_elections})
def about(request):
return HttpResponse(request, "about")
......
......@@ -117,7 +117,7 @@ INSTALLED_APPS = (
'appengine_django',
'auth',
'helios',
'single-election',
'server-ui',
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment