summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2014-11-02 10:43:09 -0600
committerDan McGee <dan@archlinux.org>2014-11-02 10:44:03 -0600
commit5bfe138a86a98b52f0b6746b900af6431cd4d17a (patch)
treedd10f445fe972c93aafe5ca56d86530a5ac042a2 /public
parent0c72812fde64f3ed039d807b9e8b3914960b7d6b (diff)
downloadarchweb-5bfe138a86a98b52f0b6746b900af6431cd4d17a.tar.gz
archweb-5bfe138a86a98b52f0b6746b900af6431cd4d17a.zip
Add new StaffGroup objectrelease_2014-11-02
This will allow us to be a bit more dynamic in showing the people listings on the website. We'll be adding a Support Staff category to recognize those that do things around here but aren't technically developers. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'public')
-rw-r--r--public/views.py43
1 files changed, 8 insertions, 35 deletions
diff --git a/public/views.py b/public/views.py
index 62d1137a..118f067a 100644
--- a/public/views.py
+++ b/public/views.py
@@ -5,11 +5,11 @@ from operator import attrgetter
from django.conf import settings
from django.contrib.auth.models import User
from django.db.models import Count, Q
-from django.http import Http404, HttpResponse
-from django.shortcuts import render
+from django.http import HttpResponse
+from django.shortcuts import get_object_or_404, render
from django.views.decorators.cache import cache_control, cache_page
-from devel.models import MasterKey, PGPSignature
+from devel.models import MasterKey, PGPSignature, StaffGroup
from main.models import Arch, Repo, Donor
from mirrors.models import MirrorUrl
from news.models import News
@@ -28,45 +28,18 @@ def index(request):
context = {
'news_updates': News.objects.order_by('-postdate', '-id')[:15],
'pkg_updates': updates,
+ 'staff_groups': StaffGroup.objects.all(),
}
return render(request, 'public/index.html', context)
-USER_LISTS = {
- 'devs': {
- 'user_type': 'Developers',
- 'user_title': 'Developer',
- 'description': "This is a list of the current Arch Linux Developers. They maintain the [core] and [extra] package repositories in addition to doing any other developer duties.",
- },
- 'tus': {
- 'user_type': 'Trusted Users',
- 'user_title': 'Trusted User',
- 'description': "Here are all your friendly Arch Linux Trusted Users who are in charge of the [community] repository.",
- },
- 'fellows': {
- 'user_type': 'Fellows',
- 'user_title': 'Fellow',
- 'description': "Below you can find a list of ex-developers (aka project fellows). These folks helped make Arch what it is today. Thanks!",
- },
-}
-
@cache_control(max_age=307)
-def userlist(request, user_type='devs'):
- users = User.objects.order_by(
+def people(request, slug):
+ group = get_object_or_404(StaffGroup, slug=slug)
+ users = User.objects.filter(groups=group.group).order_by(
'first_name', 'last_name').select_related('userprofile')
- if user_type == 'devs':
- users = users.filter(is_active=True, groups__name="Developers")
- elif user_type == 'tus':
- users = users.filter(is_active=True, groups__name="Trusted Users")
- elif user_type == 'fellows':
- users = users.filter(is_active=False,
- groups__name__in=["Developers", "Trusted Users"])
- else:
- raise Http404
- users = users.distinct()
- context = USER_LISTS[user_type].copy()
- context['users'] = users
+ context = {'group': group, 'users': users}
return render(request, 'public/userlist.html', context)