Mer fiksing på #12. Nå har alle hovedsider fått en liste (bøker, personer, kategorier), samt at forsida har fått en liste over kategorier.

This commit is contained in:
2011-03-06 20:40:41 +00:00
parent 25711283e8
commit 6782053f3c
9 changed files with 16 additions and 25 deletions

View File

@@ -33,7 +33,10 @@ def BookView(request,book_identifier):
def BookRedirect(request,book_identifier):
ident=get_object_or_404(Id,id=book_identifier)
return HttpResponseRedirect('/bok/'+ident.book.isbn)
return HttpResponseRedirect('/book/'+ident.book.isbn)
def BookIndex(request):
return render_to_response('book/index.html', {'books': Book.objects.all().order_by('title')})
def PersonView(request,person_identifier):
global relations
@@ -51,6 +54,9 @@ def PersonView(request,person_identifier):
contributed[relation][1].append(book)
return render_to_response('person/view.html', {'title' : 'Worblehat: person '+person.first_name+' '+person.last_name, 'person' : person, 'books' : books, 'contributed' : contributed })
def PersonIndex(request):
return render_to_response('person/index.html', {'persons': Person.objects.all().order_by('last_name')})
def MapIndex(request):
return render_to_response('map/index.html', {'shelves': Placement.get_all_shelves()})
@@ -69,7 +75,7 @@ def CategoryView(request,category_identifier):
return render_to_response('category/view.html', {'category': category, 'book_list': book_list})
def IndexView(request):
return render_to_response('index.html')
return render_to_response('index.html', {'categories': Category.objects.all().order_by('name')})
def SearchView(request):
if 'searchterm' in request.GET: