diff --git a/python/web/library/views.py b/python/web/library/views.py index 2c81a50..fd2b131 100644 --- a/python/web/library/views.py +++ b/python/web/library/views.py @@ -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: diff --git a/python/web/templates/base/main.html b/python/web/templates/base/main.html index 04a0684..4d10e3b 100644 --- a/python/web/templates/base/main.html +++ b/python/web/templates/base/main.html @@ -12,10 +12,10 @@

Worblehat


{% block content %} diff --git a/python/web/templates/book/view.html b/python/web/templates/book/view.html index 8bd9502..b8aedb5 100644 --- a/python/web/templates/book/view.html +++ b/python/web/templates/book/view.html @@ -13,15 +13,6 @@ {% if book.subtitle %}

{{ book.subtitle }}

{% endif %} - {% for relation, persons in contributors.iteritems %} {{ relation }}{% if persons.0 != 1 and relation != 'Medvirkende' %}e{% endif %}: {% for person in persons.1 %} diff --git a/python/web/templates/category/index.html b/python/web/templates/category/index.html index fc00aca..17c898e 100644 --- a/python/web/templates/category/index.html +++ b/python/web/templates/category/index.html @@ -1,11 +1,11 @@ {% extends "base/main.html" %} {%block title%} -Worblehat 0.1: Kategorier +Kategorier {% endblock %} {% block content %} -

Kategorier:

+

Kategorier: