From b4999b495e828ff68a5c93f65a39efad5b37dcea Mon Sep 17 00:00:00 2001 From: Ismael Carnales Date: Fri, 30 Oct 2009 18:32:25 -0200 Subject: changed landing view - moved devel.views.siteindex to public.views.index - using template from public view with added devel menu - added extra styles and images --- public/views.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'public') diff --git a/public/views.py b/public/views.py index 1f8e6880..4a4e01e7 100644 --- a/public/views.py +++ b/public/views.py @@ -3,17 +3,19 @@ from archweb.main.models import AltForum, Arch, Donor, MirrorUrl, News from archweb.main.models import Package, Repo, ExternalProject from django.db.models import Q from django.shortcuts import render_to_response +from django.template import RequestContext from django.views.generic import list_detail + def index(request): - # get the most recent 10 news items - news = News.objects.order_by('-postdate', '-id')[:10] - pkgs = Package.objects.order_by('-last_update')[:15] - repos = Repo.objects.order_by('name') - arches = Arch.objects.exclude(name__iexact='any').order_by('name') - return render_to_response('public/index.html', - {'news_updates':news,'pkg_updates':pkgs, - 'repos':repos, 'arches': arches, 'path':request.path}) + context = { + 'news': News.objects.order_by('-postdate', '-id')[:10], + 'pkgs': Package.objects.exclude(repo__name__iexact='testing').order_by( + '-last_update')[:15], + 'repos': Repo.objects.all() + } + return render_to_response('public/index.html', RequestContext(request, + context)) def about(request): return render_to_response('public/about.html') -- cgit v1.2.3-55-g3dc8