summaryrefslogtreecommitdiff
path: root/packages/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-01-12 10:08:29 -0600
committerDan McGee <dan@archlinux.org>2011-01-18 14:26:38 -0600
commit9cdc536fffc9e77903892c2b14e9462a6ec94ee5 (patch)
tree9dd56ad147f38867f63c24a3c79bc28e38fc5cd0 /packages/views.py
parentecb24ab66a9d0a03ad021d23d4fa543f8163ef3e (diff)
Add arch-specific group overview pages
This is easy enough to refactor and support with our current infrastructure and group-fetching functions. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/views.py')
-rw-r--r--packages/views.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/views.py b/packages/views.py
index 4e683144..e00e6f94 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -88,9 +88,17 @@ def details(request, name='', repo='', arch=''):
return redirect("/packages/?arch=%s&repo=%s&q=%s" % (
arch.lower(), repo.title(), name))
-def groups(request):
- grps = get_group_info()
- return direct_to_template(request, 'packages/groups.html', {'groups': grps})
+def groups(request, arch=None):
+ arches = []
+ if arch:
+ get_object_or_404(Arch, name=arch, agnostic=False)
+ arches.append(arch)
+ grps = get_group_info(arches)
+ context = {
+ 'groups': grps,
+ 'arch': arch,
+ }
+ return direct_to_template(request, 'packages/groups.html', context)
def group_details(request, arch, name):
arch = get_object_or_404(Arch, name=arch)