From b7e8c3eff7681661967db7dde8626f964a1bf4d9 Mon Sep 17 00:00:00 2001 From: tirilane Date: Sun, 6 Mar 2011 22:11:09 +0000 Subject: [PATCH] =?UTF-8?q?Har=20bytta=20ut=20kategoriene=20p=C3=A5=20fors?= =?UTF-8?q?ida=20(#12)=20med=20hyllekartet.=20Et=20fungerende=20hyllekart,?= =?UTF-8?q?=20siden=20det=20offisielle=20n=C3=A5=20er=20noe=20brukket.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/web/library/views.py | 16 +++++----------- python/web/templates/index.html | 28 ++++++++++++++++++++++------ 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/python/web/library/views.py b/python/web/library/views.py index 0887476..b824ed1 100644 --- a/python/web/library/views.py +++ b/python/web/library/views.py @@ -59,16 +59,8 @@ def PersonIndex(request): def MapIndex(request): shelves = Placement.get_all_shelves() - highlight_list = [] - if 'highlight' in request.GET: - highlight_string = request.GET['highlight'] - for category in Category.objects.filter(id=highlight_string): - highlight_list.append(category) - shelf_lists = [{'shelf_name': shelf, - 'shelf_list': Placement.shelf_as_list_row_then_col(shelf)} - for shelf in shelves] - print highlight_list - return render_to_response('map/index.html', {'shelf_lists': shelf_lists, 'highlight': highlight_list}) + shelf_lists = [(shelf, Placement.shelf_as_list_row_then_col(shelf)) for shelf in shelves] + return render_to_response('map/index.html', {'shelf_lists': shelf_lists}) def MapView(request,shelf_identifier): if shelf_identifier not in Placement.get_all_shelves(): @@ -85,7 +77,9 @@ 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', {'categories': Category.objects.all().order_by('name')}) + shelves = Placement.get_all_shelves() + shelf_lists = [(shelf, Placement.shelf_as_list_row_then_col(shelf)) for shelf in shelves] + return render_to_response('index.html', {'categories': Category.objects.all().order_by('name'), 'shelf_lists': shelf_lists}) def SearchView(request): if 'searchterm' in request.GET: diff --git a/python/web/templates/index.html b/python/web/templates/index.html index 909b4bb..4296474 100644 --- a/python/web/templates/index.html +++ b/python/web/templates/index.html @@ -6,11 +6,27 @@ Heisann!! {% block content %} Velkommen til PVVs bokdatabase, Worblehat.
-Her kan du søke etter bøker til din hjertens lyst, eller gå direkte til hyllekartet. -

Kategorier:

-