From: Marcin Koziej Date: Tue, 27 Dec 2011 12:36:18 +0000 (+0100) Subject: search ui draft X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/afdd9bc42c8e08e0e2fbade6b9c934a3d65f4885?ds=sidebyside;hp=--cc search ui draft --- afdd9bc42c8e08e0e2fbade6b9c934a3d65f4885 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 @@ -