From 6782053f3c0af20485eb107431912e70c456903b Mon Sep 17 00:00:00 2001 From: tirilane Date: Sun, 6 Mar 2011 20:40:41 +0000 Subject: [PATCH] =?UTF-8?q?Mer=20fiksing=20p=C3=A5=20#12.=20N=C3=A5=20har?= =?UTF-8?q?=20alle=20hovedsider=20f=C3=A5tt=20en=20liste=20(b=C3=B8ker,=20?= =?UTF-8?q?personer,=20kategorier),=20samt=20at=20forsida=20har=20f=C3=A5t?= =?UTF-8?q?t=20en=20liste=20over=20kategorier.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/web/library/views.py | 10 ++++++++-- python/web/templates/base/main.html | 4 ++-- python/web/templates/book/view.html | 9 --------- python/web/templates/category/index.html | 4 ++-- python/web/templates/category/view.html | 1 - python/web/templates/index.html | 8 +------- python/web/templates/map/index.html | 2 +- python/web/templates/search/search.html | 1 - python/web/urls.py | 2 ++ 9 files changed, 16 insertions(+), 25 deletions(-) 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: