summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@kiwwwi.com.ar>2011-03-06 11:05:57 -0300
committerNicolás Reynolds <fauno@kiwwwi.com.ar>2011-03-06 11:05:57 -0300
commit3aa14c9fbec24f5049e12a8dbb5ce059d2c8f5f3 (patch)
tree28755cf0ae66b145d752358c1f722c2d095e877a /public
parentc738e2c8f687f3417b90c951254121cce491843a (diff)
parent65e965c8f76677904f5d98965e13bf89726247d4 (diff)
Merge branch 'master' of git://projects.archlinux.org/archweb
Conflicts: media/archweb.css public/views.py urls.py
Diffstat (limited to 'public')
-rw-r--r--public/views.py31
1 files changed, 20 insertions, 11 deletions
diff --git a/public/views.py b/public/views.py
index 330f04b4..0ad1ca1c 100644
--- a/public/views.py
+++ b/public/views.py
@@ -5,6 +5,7 @@ from . import utils
from django.contrib.auth.models import User
from django.db.models import Q
+from django.http import Http404
from django.views.generic import list_detail
from django.views.generic.simple import direct_to_template
from django.shortcuts import redirect
@@ -18,20 +19,28 @@ def index(request):
}
return direct_to_template(request, 'public/index.html', context)
-def userlist(request, type='Developers'):
+USER_LISTS = {
+ 'devs': {
+ 'user_type': 'Hackers',
+ 'description': "This is a list of the current Parabola Hackers. They maintain the [libre] package repository and keep the [core], [extra] and [community] repositories clean of unfree software, in addition to doing any other developer duties.",
+ },
+ 'fellows': {
+ 'user_type': 'Fellows',
+ 'description': "Below you can find a list of ex-hackers (aka project fellows). These folks helped make Parabola what it is today. Thanks!",
+ },
+}
+
+def userlist(request, type='hackers'):
users = User.objects.order_by('username').select_related('userprofile')
- if type == 'Hackers':
+ if type == 'hackers':
users = users.filter(is_active=True, groups__name="Hackers")
- msg = "This is a list of the current Parabola GNU/Linux hackers. They maintain the *-libre packages in addition to doing any other developer duties."
- elif type == 'Fellows':
- users = users.filter(is_active=False)
- msg = "Below you can find a list of ex-hackers (aka project fellows). These folks helped make Parabola what it is today. Thanks!"
+ elif type == 'fellows':
+ users = users.filter(is_active=False, groups__name__in=["Hackers"])
+ else:
+ raise Http404
- context = {
- 'user_type': type,
- 'description': msg,
- 'users': users,
- }
+ context = USER_LISTS[type].copy()
+ context['users'] = users
return direct_to_template(request, 'public/userlist.html', context)
def donate(request):