summaryrefslogtreecommitdiff
path: root/public/views.py
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@kiwwwi.com.ar>2011-12-04 23:07:59 -0300
committerNicolás Reynolds <fauno@kiwwwi.com.ar>2011-12-04 23:07:59 -0300
commit988c2c6d400b3721464c2891891807d504b076b0 (patch)
tree013dc3d676edad701d0d3bbd239bc2df0cdf76b4 /public/views.py
parent60a1fc6cc4cef0b9eed58ea4f0ca003b76ec382a (diff)
parent183c4d9cefa95f46c3fa3a6936f837542426eac2 (diff)
Merge branch 'master' of ssh://gparabola/parabolaweb
Conflicts: local_settings.py.example media/archweb.css packages/templatetags/package_extras.py public/views.py templates/packages/details.html templates/packages/flag.html templates/packages/flag_confirmed.html templates/packages/flagged.html templates/packages/search.html templates/public/download.html templates/todolists/view.html
Diffstat (limited to 'public/views.py')
-rw-r--r--public/views.py38
1 files changed, 23 insertions, 15 deletions
diff --git a/public/views.py b/public/views.py
index c10be35f..af46e343 100644
--- a/public/views.py
+++ b/public/views.py
@@ -1,19 +1,18 @@
-from main.models import Arch, Repo, Donor
-from mirrors.models import MirrorUrl
-from news.models import News
-from . import utils
-
from django.conf import settings
from django.contrib.auth.models import User
-from django.db.models import Q
from django.http import Http404
+from django.shortcuts import redirect
from django.views.generic import list_detail
from django.views.generic.simple import direct_to_template
-from django.shortcuts import redirect
+from devel.models import MasterKey
+from main.models import Arch, Repo, Donor
+from mirrors.models import MirrorUrl
+from news.models import News
+from utils import get_recent_updates
def index(request):
- pkgs = utils.get_recent_updates()
+ pkgs = get_recent_updates()
context = {
'news_updates': News.objects.order_by('-postdate', '-id')[:15],
'pkg_updates': pkgs,
@@ -31,16 +30,18 @@ USER_LISTS = {
},
}
-def userlist(request, type='hackers'):
- users = User.objects.order_by('username').select_related('userprofile')
- if type == 'hackers':
+def userlist(request, user_type='hackers'):
+ users = User.objects.order_by(
+ 'username').select_related('userprofile')
+ if user_type == 'hackers':
users = users.filter(is_active=True, groups__name="Hackers")
- elif type == 'fellows':
- users = users.filter(is_active=False, groups__name__in=["Hackers"])
+ elif user_type == 'fellows':
+ users = users.filter(is_active=False,
+ groups__name__in=["Hackers"])
else:
raise Http404
- context = USER_LISTS[type].copy()
+ context = USER_LISTS[user_type].copy()
context['users'] = users
return direct_to_template(request, 'public/userlist.html', context)
@@ -51,7 +52,7 @@ def donate(request):
return direct_to_template(request, 'public/donate.html', context)
def download(request):
- return redirect('http://wiki.parabolagnulinux.org/get', permanent=True)
+ return redirect('//wiki.parabolagnulinux.org/get', permanent=True)
def feeds(request):
context = {
@@ -60,4 +61,11 @@ def feeds(request):
}
return direct_to_template(request, 'public/feeds.html', context)
+def keys(request):
+ context = {
+ 'keys': MasterKey.objects.select_related('owner', 'revoker',
+ 'owner__userprofile', 'revoker__userprofile').all(),
+ }
+ return direct_to_template(request, 'public/keys.html', context)
+
# vim: set ts=4 sw=4 et: