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:
{% for category in categories %}
- {{ category }}
diff --git a/python/web/templates/category/view.html b/python/web/templates/category/view.html
index 636508b..a9557b4 100644
--- a/python/web/templates/category/view.html
+++ b/python/web/templates/category/view.html
@@ -11,7 +11,6 @@
{% if not book_list %}
Det finnes ingen bøker i denne kategorien.
{% else %}
-
Bøker:
{% for book in book_list %}
diff --git a/python/web/templates/index.html b/python/web/templates/index.html
index 83168d2..909b4bb 100644
--- a/python/web/templates/index.html
+++ b/python/web/templates/index.html
@@ -1,7 +1,7 @@
{% extends "base/main.html" %}
{% block title %}
-Worblehat 0.1. Heisann!!
+Heisann!!
{% endblock %}
{% block content %}
@@ -13,10 +13,4 @@ Her kan du søke etter bøker til din hjertens lyst, eller gå direkte til {{ category }}
{% endfor %}
-
{% endblock %}
diff --git a/python/web/templates/map/index.html b/python/web/templates/map/index.html
index 749c6c0..c5700c8 100644
--- a/python/web/templates/map/index.html
+++ b/python/web/templates/map/index.html
@@ -1,7 +1,7 @@
{% extends "base/main.html" %}
{%block title%}
-Ferske, detaljerte og livsreddende kart!
+Hyllekart
{% endblock %}
{% block content %}
diff --git a/python/web/templates/search/search.html b/python/web/templates/search/search.html
index 6ca9458..d73daf9 100644
--- a/python/web/templates/search/search.html
+++ b/python/web/templates/search/search.html
@@ -7,7 +7,6 @@ Søk
{% block content %}
Søk
Du søkte på {{ search_string }}.
-
{% if people %}
Personer:
{% for person in people %}
diff --git a/python/web/urls.py b/python/web/urls.py
index 56c107c..22674c6 100644
--- a/python/web/urls.py
+++ b/python/web/urls.py
@@ -12,9 +12,11 @@ urlpatterns = patterns('',
# to INSTALLED_APPS to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^media/(?P.*)$','django.views.static.serve',{'document_root' : settings.MEDIA_ROOT}),
+ (r'^bok/$','web.library.views.BookIndex'),
(r'^bok/(?P\d+)/$','web.library.views.BookView'),
(r'^bok/(?P\S+)/$','web.library.views.BookRedirect'),
(r'^person/(?P\S+)/$','web.library.views.PersonView'),
+ (r'^person/$','web.library.views.PersonIndex'),
(r'^kart/$','web.library.views.MapIndex'),
(r'^kart/(?P\S+)/$','web.library.views.MapView'),
(r'^kategori/$','web.library.views.CategoryIndex'),