diff --git a/helios b/helios index 95eb27464e8850963f65177c8426ace0920f6430..9785977b0c97397e91622b9b1fa58561c4ed4e9f 160000 --- a/helios +++ b/helios @@ -1 +1 @@ -Subproject commit 95eb27464e8850963f65177c8426ace0920f6430 +Subproject commit 9785977b0c97397e91622b9b1fa58561c4ed4e9f diff --git a/initialization.py.sample b/initialization.py.sample index 0ad5c871e576ffffd88ce94526a0f012448e2b9b..cf6c6ad326b2bd78ae3298c65ccd9a8365982b8a 100644 --- a/initialization.py.sample +++ b/initialization.py.sample @@ -11,7 +11,6 @@ import auth.models helios.TEMPLATE_BASE = "server_ui/templates/base.html" helios.ADMIN_ONLY = True -helios.ADMIN = auth.models.User.update_or_create(user_type = 'cas', user_id = 'yaro', info={}) # authentication limited to passwords auth.ENABLED_AUTH_SYSTEMS = ['cas', 'password'] diff --git a/server_ui/templates/base.html b/server_ui/templates/base.html index 796070b1a48607cdadc8ea484ef22ba419aa256a..058026489713fec69760473b6a6012b1aa65bef2 100644 --- a/server_ui/templates/base.html +++ b/server_ui/templates/base.html @@ -45,7 +45,9 @@ </div> <div id="footer"> <span style="float:right;"> +{% if settings.FOOTER_LOGO %} <img src="/static/footer-logo.gif" /> +{% endif %} </span> {% if user %} logged in as {{user.user_id}} [<a href="{% url auth.views.logout %}">logout</a>]<br /> diff --git a/server_ui/templates/index.html b/server_ui/templates/index.html index 5c0913dca1127d3db0fe5479e259ae7a027ed104..70aaf5baf8c6a139d7c6222fa93b5fab892e5f58 100644 --- a/server_ui/templates/index.html +++ b/server_ui/templates/index.html @@ -18,6 +18,12 @@ </p> --> +{% if create_p %} +<a href="{% url helios.views.election_new %}">create election</a> +| +<a href="{% url helios.views.elections_administered %}">elections you administer</a> +{% endif %} + <p style="font-size: 1.4em;"> Current Elections: <ul> @@ -27,4 +33,5 @@ Current Elections: </ul> </p> + {% endblock %} diff --git a/server_ui/views.py b/server_ui/views.py index 1c7f33de0bbb4a5d197093fffebfe765f5cfbcc5..9e5c61063b3156b0a43e95462aef14abf7dbab0a 100644 --- a/server_ui/views.py +++ b/server_ui/views.py @@ -10,6 +10,7 @@ import helios.views import helios from helios.crypto import utils as cryptoutils from auth.security import * +from helios.security import can_create_election from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponseNotAllowed @@ -24,7 +25,9 @@ def home(request): # load the featured elections featured_elections = Election.get_featured() - return render_template(request, "index", {'elections': featured_elections}) + create_p = can_create_election(request) + + return render_template(request, "index", {'elections': featured_elections, 'create_p':create_p}) def about(request): return HttpResponse(request, "about") diff --git a/settings.py.sample b/settings.py.sample index 844c411d658ff6f0ba0a6b232eec49bd04bd6bab..dc3cd3360df9f6989e31daf39badb6bf42ff9cec 100644 --- a/settings.py.sample +++ b/settings.py.sample @@ -147,4 +147,5 @@ SINGLE_ELECTION_PARAMS = { # FOOTER links FOOTER_LINKS = [{'url':'http://usg.princeton.edu/elections', 'text':'USG Elections Center'}] +FOOTER_LOGO = False