From afdd9bc42c8e08e0e2fbade6b9c934a3d65f4885 Mon Sep 17 00:00:00 2001 From: Marcin Koziej Date: Tue, 27 Dec 2011 13:36:18 +0100 Subject: [PATCH] search ui draft --- apps/catalogue/models.py | 2 +- apps/search/views.py | 4 ++-- wolnelektury/templates/base.html | 2 +- wolnelektury/templates/catalogue/search_multiple_hits.html | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index e69d23168..a180c650c 100644 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.py @@ -1035,7 +1035,7 @@ class Fragment(models.Model): verbose_name_plural = _('fragments') def get_absolute_url(self): - return '%s#m%s' % (self.book.get_html_url(), self.anchor) + return '%s#m%s' % (reverse('book_text', args=[self.book.slug]), self.anchor) def reset_short_html(self): if self.id is None: diff --git a/apps/search/views.py b/apps/search/views.py index 75cc16a0d..bfa3c9b93 100644 --- a/apps/search/views.py +++ b/apps/search/views.py @@ -67,7 +67,6 @@ def hint(request): # jezeli tagi dot tylko ksiazki, to wazne zeby te nowe byly w tej samej ksiazce # jesli zas dotycza themes, to wazne, zeby byly w tym samym fragmencie. - # import pdb; pdb.set_trace() tags = s.hint_tags(prefix) books = s.hint_books(prefix) @@ -127,7 +126,8 @@ def main(request): context_instance=RequestContext(request)) hint.tags(tag_list) - hint.books(book) + if book: + hint.books(book) toks = StringReader(query) fuzzy = 'fuzzy' in request.GET diff --git a/wolnelektury/templates/base.html b/wolnelektury/templates/base.html index 844095903..d1bf19e8a 100644 --- a/wolnelektury/templates/base.html +++ b/wolnelektury/templates/base.html @@ -62,7 +62,7 @@ -