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

small tweaks for single election support

parent 74a8b3ee
No related branches found
No related tags found
No related merge requests found
Subproject commit 0f70fed4e89092595296d0c84cc1276a51194e3d
Subproject commit 35969f2b964c8aa9134c51da492ca0866b946f14
"""
This django app is meant only to connect the pieces of Helios and Auth that are specific to Votwee
This django app is meant only to connect the pieces of Helios and Auth that are specific to IACR
"""
import glue
import helios
helios.TEMPLATE_BASE = "votwee/templates/base.html"
\ No newline at end of file
helios.TEMPLATE_BASE = "iacr/templates/base.html"
\ No newline at end of file
......@@ -31,12 +31,6 @@
<div id="content">
<div id="header">
{% block header %}
{% if user %}
logged in as <b>{{user.name}} ({{user.user_type}})</b>
[<a href="{% url auth.views.logout %}?return_url={{CURRENT_URL}}">logout</a>]
{% else %}
not logged in. [<a href="{% url auth.views.index %}?return_url={{CURRENT_URL}}">login</a>]
{% endif %}
{% endblock %}
</div>
{% block content %}{% endblock %}
......
......@@ -4,29 +4,5 @@
{% block content %}
<h1>Welcome to IACR Helios</h1>
{% if user %}
<p style="font-size: 1.4em;">
logged in as <b>{{user.name}}</b>.
</p>
<p>
{{elections|length}} elections administered:
{% for e in elections %}
<a href="{% url helios.views.one_election_view e.uuid %}">{{e.name}}</a>&nbsp;&nbsp;&nbsp;
{% endfor %}
</p>
<p>
{{elections_registered|length}} elections for which you're registered:
{% for e in elections_registered %}
<a href="{% url helios.views.one_election_view e.uuid %}">{{e.name}}</a>&nbsp;&nbsp;&nbsp;
{% endfor %}
</p>
<p>
<a href="{% url helios.views.election_new %}">create an election</a>
</p>
{% else %}
<a href="{% url auth.views.index %}">log in</a>
{% endif %}
<a href="{% url helios.views.one_election_view settings.IACR_ELECTION_UUID %}">the election</a>
{% endblock %}
......@@ -10,6 +10,8 @@ from django.shortcuts import render_to_response
from auth.security import get_user
from django.conf import settings
##
## template abstraction
##
......@@ -18,6 +20,7 @@ def render_template(request, template_name, vars = {}):
vars_with_user = vars.copy()
vars_with_user['user'] = get_user(request)
vars_with_user['settings'] = settings
return render_to_response('iacr/templates/%s.html' % template_name, vars_with_user)
"""
Votwee specific views
IACR specific views
"""
from helios.models import *
......
......@@ -107,7 +107,7 @@ DEFAULT_FROM_EMAIL = 'ben@adida.net'
SERVER_EMAIL = DEFAULT_FROM_EMAIL
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'votweerulez!!!ohyeah,andheliostoo'
SECRET_KEY = 'iacrrulez!!!ohyeah,andheliostoo'
#LOGIN_URL = '/account/login/'
#LOGOUT_URL = '/account/logout/'
......@@ -126,3 +126,5 @@ DEBUG = True
TEMPLATE_DEBUG = True
URL_HOST = "https://iacr-helios.appspot.com"
IACR_ELECTION_UUID = 'foobar'
\ 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