diff options
Diffstat (limited to 'core/views_other.py')
-rw-r--r-- | core/views_other.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/core/views_other.py b/core/views_other.py index 6a195b9..1297e7f 100644 --- a/core/views_other.py +++ b/core/views_other.py @@ -4,11 +4,11 @@ from django.conf import settings from django import forms from django.template import loader, Context from django.db.models import Q +from django.shortcuts import render import databaseReset import re from django.http import HttpResponse, HttpResponseRedirect from django.core.urlresolvers import reverse -from utils import render_with_context from troggle.core.models import * from troggle.helper import login_required_if_public @@ -21,18 +21,18 @@ def stats(request): statsDict['caveCount'] = int(Cave.objects.count()) statsDict['personCount'] = int(Person.objects.count()) statsDict['logbookEntryCount'] = int(LogbookEntry.objects.count()) - return render_with_context(request,'statistics.html', statsDict) + return render(request,'statistics.html', statsDict) def frontpage(request): if request.user.is_authenticated(): - return render_with_context(request,'tasks.html') + return render(request,'tasks.html') expeditions = Expedition.objects.order_by("-year") logbookentry = LogbookEntry cave = Cave photo = DPhoto from django.contrib.admin.templatetags import log - return render_with_context(request,'frontpage.html', locals()) + return render(request,'frontpage.html', locals()) def todo(request): message = "no test message" #reverse('personn', kwargs={"name":"hkjhjh"}) @@ -45,7 +45,7 @@ def todo(request): expeditions = Expedition.objects.order_by("-year") totallogbookentries = LogbookEntry.objects.count() - return render_with_context(request,'index.html', {'expeditions':expeditions, 'all':'all', 'totallogbookentries':totallogbookentries, "message":message}) + return render(request,'index.html', {'expeditions':expeditions, 'all':'all', 'totallogbookentries':totallogbookentries, "message":message}) def controlPanel(request): @@ -64,11 +64,11 @@ def controlPanel(request): jobs_completed.append(item) else: if request.user.is_authenticated(): #The user is logged in, but is not a superuser. - return render_with_context(request,'controlPanel.html', {'caves':Cave.objects.all(),'error':'You must be a superuser to use that feature.'}) + return render(request,'controlPanel.html', {'caves':Cave.objects.all(),'error':'You must be a superuser to use that feature.'}) else: return HttpResponseRedirect(reverse('auth_login')) - return render_with_context(request,'controlPanel.html', {'caves':Cave.objects.all(),'expeditions':Expedition.objects.all(),'jobs_completed':jobs_completed}) + return render(request,'controlPanel.html', {'caves':Cave.objects.all(),'expeditions':Expedition.objects.all(),'jobs_completed':jobs_completed}) def downloadCavetab(request): from export import tocavetab @@ -201,7 +201,7 @@ def logbook_entry_suggestions(request): print('got 208') any_suggestions=True print('got 210') - return render_with_context(request,'suggestions.html', + return render(request,'suggestions.html', { 'unwiki_QMs':unwiki_QMs, 'any_suggestions':any_suggestions @@ -261,7 +261,7 @@ def newFile(request, pslug = None): # else: # fileform = UploadFileForm() # An unbound form - return render_with_context(request, 'editfile.html', { + return render(request, 'editfile.html', { 'fileForm': fileform, }) |