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

updates to look and feel

parent 33959609
No related branches found
No related tags found
No related merge requests found
Subproject commit 76192665b69d0b10e68dee394a878964af199f46 Subproject commit 809c803c91711f3cab3f3edd783400848ebeb27f
Subproject commit d02ada61409e2a02c934e8541d88646b4472fd9f Subproject commit 70c662f1d8ee1904798ef14ad2ba4bffc2a18692
...@@ -55,6 +55,13 @@ body { ...@@ -55,6 +55,13 @@ body {
font-size: 16pt; font-size: 16pt;
} }
#mystuff {
float:right;
width: 250px;
border-left: 1px solid #888;
padding-left: 20px;
}
table.pretty { table.pretty {
margin: 1em 1em 1em 2em; margin: 1em 1em 1em 2em;
background: whitesmoke; background: whitesmoke;
...@@ -75,6 +82,14 @@ table.pretty th, td { ...@@ -75,6 +82,14 @@ table.pretty th, td {
border: 1px solid #888; border: 1px solid #888;
} }
.highlight-box-margin {
background:#ccc;
padding: 10px;
color: black;
border: 1px solid #888;
margin-right: 300px;
}
.round { .round {
-moz-border-radius-bottomleft:5px; -moz-border-radius-bottomleft:5px;
-moz-border-radius-bottomright:5px; -moz-border-radius-bottomright:5px;
......
...@@ -50,13 +50,8 @@ ...@@ -50,13 +50,8 @@
{% endif %} {% endif %}
</span> </span>
{% if user %} {% if user %}
logged in as logged in as {{user.display_html_small|safe}}
<img border="0" height="15" src="/static/auth/login-icons/{{user.user_type}}.png" alt="{{user.user_type}}" /> [<a href="{% url auth.views.logout %}?return_url={{CURRENT_URL}}">logout</a>]<br />
{% if user.name %}
{{user.name}}
{% else %}
{{user.user_id}}
{% endif %} [<a href="{% url auth.views.logout %}?return_url={{CURRENT_URL}}">logout</a>]<br />
{% else %} {% else %}
not logged in. [<a href="{% url auth.views.index %}?return_url={{CURRENT_URL}}">log in</a>]<br /> not logged in. [<a href="{% url auth.views.index %}?return_url={{CURRENT_URL}}">log in</a>]<br />
{% endif %} {% endif %}
......
...@@ -7,32 +7,62 @@ ...@@ -7,32 +7,62 @@
{% block content %} {% block content %}
<p> <div id="mystuff">
Welcome to the {{settings.SITE_TITLE}} system! {% if user %}
</p> <div style="font-size:1.4em;" class="highlight-box">
{{user.display_html_big|safe}}
</div>
{% if create_p %}
<h4>Administration</h4>
{% if elections_administered %}
<ul>
{% for election in elections_administered %}
<li> <a href="{% url helios.views.one_election_view election.uuid %}">{{election.name}}</a></li>
{% endfor %}
</ul>
{% else %}
<em>none yet</em><br />
{% endif %}
<div style="text-align:right">
<button style="font-size:1.2em;"><a href="{% url helios.views.election_new %}">create election &gt;</a></button>
</div>
{% endif %}
<p> <h4>Recent Votes</h4>
{% if elections_voted %}
<ul>
{% for election in elections_voted %}
<li><a href="{% url helios.views.one_election_view election.uuid %}">{{election.name}}</a></li>
{% endfor %}
</ul>
{% else %}
<em>none yet</em>
{% endif %}
{% else %}
<h3>Log In to Start Voting</h3>
{{login_box|safe}}
{% endif %}
<br /><br />
</div>
<p style="font-size: 1.4em;">
{{settings.WELCOME_MESSAGE|safe}} {{settings.WELCOME_MESSAGE|safe}}
</p> </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 %}
{% if elections|length %} {% if elections|length %}
<p style="font-size: 1.4em;"> <p>
Current Featured Elections:
<ul>
{% for election in elections %} {% for election in elections %}
<li> <a href="{% url helios.views.election_shortcut election.short_name %}">{{election.name}}</a></li> <div class="highlight-box-margin">
<a style="font-size: 1.4em;" href="{% url helios.views.election_shortcut election.short_name %}">{{election.name}}</a> by {{election.admin.display_html_small|safe}}<br />
{{election.description}}
</div>
<br />
{% endfor %} {% endfor %}
</ul>
</p> </p>
{% else %} {% else %}
<h4>no featured elections at the moment</h4> <h4>no featured elections at the moment</h4>
{% endif %} {% endif %}
<br clear="right" /><br />
{% endblock %} {% endblock %}
...@@ -17,6 +17,8 @@ from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpRespons ...@@ -17,6 +17,8 @@ from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpRespons
from django.conf import settings from django.conf import settings
import copy
import auth.views as auth_views
def get_election(): def get_election():
return None return None
...@@ -25,9 +27,31 @@ def home(request): ...@@ -25,9 +27,31 @@ def home(request):
# load the featured elections # load the featured elections
featured_elections = Election.get_featured() featured_elections = Election.get_featured()
user = get_user(request)
create_p = can_create_election(request) create_p = can_create_election(request)
return render_template(request, "index", {'elections': featured_elections, 'create_p':create_p}) if create_p:
elections_administered = Election.get_by_user_as_admin(user)
else:
elections_administered = None
if user:
elections_voted = Election.get_by_user_as_voter(user)
else:
elections_voted = None
auth_systems = copy.copy(settings.AUTH_ENABLED_AUTH_SYSTEMS)
try:
auth_systems.remove('password')
except: pass
login_box = auth_views.login_box_raw(request, return_url="/", auth_systems=auth_systems)
return render_template(request, "index", {'elections': featured_elections,
'elections_administered' : elections_administered,
'elections_voted' : elections_voted,
'create_p':create_p,
'login_box' : login_box})
def about(request): def about(request):
return HttpResponse(request, "about") return HttpResponse(request, "about")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment