use direct_to_template to replace static views

This commit is contained in:
Ismael Carnales 2009-10-30 18:44:00 -02:00
parent b4999b495e
commit 680d9d30df
2 changed files with 5 additions and 17 deletions

View File

@ -16,16 +16,6 @@ def index(request):
} }
return render_to_response('public/index.html', RequestContext(request, return render_to_response('public/index.html', RequestContext(request,
context)) context))
def about(request):
return render_to_response('public/about.html')
def art(request):
return render_to_response('public/art.html')
def svn(request):
return render_to_response('public/svn.html')
def projects(request): def projects(request):
projects = ExternalProject.objects.all() projects = ExternalProject.objects.all()
return render_to_response('public/projects.html', {'projects': projects}) return render_to_response('public/projects.html', {'projects': projects})
@ -68,9 +58,6 @@ def download(request):
template_object_name="mirror_url", template_object_name="mirror_url",
extra_context={"path": request.path}) extra_context={"path": request.path})
def irc(request):
return render_to_response('public/irc.html')
def moreforums(request): def moreforums(request):
return list_detail.object_list(request, return list_detail.object_list(request,
AltForum.objects.order_by('language', 'name'), AltForum.objects.order_by('language', 'name'),

View File

@ -3,6 +3,7 @@
from django.contrib import admin from django.contrib import admin
from django.views.generic.create_update import delete_object from django.views.generic.create_update import delete_object
from django.views.generic.simple import direct_to_template
from django.contrib.auth.decorators import permission_required from django.contrib.auth.decorators import permission_required
from archweb.main.models import Todolist from archweb.main.models import Todolist
@ -62,14 +63,14 @@
# (mostly) Static Pages # (mostly) Static Pages
(r'^$', 'archweb.public.views.index'), (r'^$', 'archweb.public.views.index'),
(r'^about/$', 'archweb.public.views.about'), (r'^about/$', direct_to_template, {'template': 'public/about.html'}),
(r'^art/$', 'archweb.public.views.art'), (r'^art/$', direct_to_template, {'template': 'public/art.html'}),
(r'^svn/$', 'archweb.public.views.svn'), (r'^svn/$', direct_to_template, {'template': 'public/svn.html'}),
(r'^developers/$', 'archweb.public.views.developers'), (r'^developers/$', 'archweb.public.views.developers'),
(r'^fellows/$', 'archweb.public.views.fellows'), (r'^fellows/$', 'archweb.public.views.fellows'),
(r'^donate/$', 'archweb.public.views.donate'), (r'^donate/$', 'archweb.public.views.donate'),
(r'^download/$', 'archweb.public.views.download'), (r'^download/$', 'archweb.public.views.download'),
(r'^irc/$', 'archweb.public.views.irc'), (r'^irc/$', direct_to_template, {'template': 'public/irc.html'}),
(r'^moreforums/$', 'archweb.public.views.moreforums'), (r'^moreforums/$', 'archweb.public.views.moreforums'),
(r'^projects/$', 'archweb.public.views.projects'), (r'^projects/$', 'archweb.public.views.projects'),
('^jsi18n/$', 'django.views.i18n.null_javascript_catalog', ('^jsi18n/$', 'django.views.i18n.null_javascript_catalog',