Fix up the site user list

This commit is contained in:
Trever Fischer
2012-04-21 11:44:46 -04:00
parent 1c01adbf0d
commit 3ce1e114c1
3 changed files with 19 additions and 5 deletions

View File

@@ -5,7 +5,7 @@ from django.http import HttpResponseRedirect, Http404
from django.shortcuts import render_to_response
from notification import models as notification
from django.template import RequestContext
from django.contrib.auth.models import User
from django.contrib.auth.models import User, Group
from django.core.urlresolvers import reverse
import django.contrib.auth
from django.contrib.auth import authenticate, login
@@ -120,7 +120,8 @@ def claimInvite(request, code=None):
def list(request):
profiles = User.objects.all()
return render_to_response('local/list.html', {'profiles': profiles}, context_instance = RequestContext(request))
groups = Group.objects.all()
return render_to_response('local/list.html', {'profiles': profiles, 'groups': groups}, context_instance = RequestContext(request))
def index(request):
newsForum = Forum.objects.get(id=settings.CAMINUS_NEWS_FORUM_ID)

View File

@@ -247,15 +247,17 @@ tr.sticky a:link {
margin-top: 1em;
}
#profile-list ul {
.profile-list ul {
display:block;
list-style: none;
}
#profile-list li {
.profile-list li {
float: left;
border:3px solid black;
padding: 3px;
width: 128px;
height: 128px;
text-align: center;
}

View File

@@ -5,7 +5,18 @@
{% block sectiontitle %}Users{% endblock %}
{% block content %}
<ul id='profile-list'>
{% for group in groups %}
{% if group.users %}
<h2>{{group}}</h2>
<ul class='profile-list'>
{% for user in group.users %}
<li><a href="{% url local.views.profile username=user.username %}">{% avatar user %}<p>{{user}}</p></a></li>
{% endfor %}
</ul>
{% endif%}
{% endfor %}
<h2>All Players</h2>
<ul class='profile-list'>
{% for user in profiles %}
<li><a href="{% url local.views.profile username=user.username %}">{% avatar user %}<p>{{user}}</p></a></li>
{% endfor %}