From: Marek Stępniowski Date: Thu, 4 Sep 2008 11:15:50 +0000 (+0200) Subject: Fixed showing 'sets' link for authenticated users. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/307e2c65ef1caf8adae53582177912cef6f9ec51 Fixed showing 'sets' link for authenticated users. --- diff --git a/catalogue/templatetags/catalogue_tags.py b/catalogue/templatetags/catalogue_tags.py index d3a25ad93..cf4abe718 100644 --- a/catalogue/templatetags/catalogue_tags.py +++ b/catalogue/templatetags/catalogue_tags.py @@ -118,7 +118,7 @@ def breadcrumbs(tags, search_form=True): @register.inclusion_tag('catalogue/_book.html') -def book(book): +def book(request, book): tags = book.tags.filter(~Q(category__in=('set', 'theme'))) tags = [u'%s' % (tag.get_absolute_url(), tag.name) for tag in tags] @@ -130,7 +130,7 @@ def book(book): if book.odt_file: formats.append(u'Plik ODT' % book.odt_file.url) - return {'book': book, 'tags': tags, 'formats': formats} + return locals() @register.tag diff --git a/templates/catalogue/tagged_book_list.html b/templates/catalogue/tagged_book_list.html index cca0e56d4..743035bb8 100644 --- a/templates/catalogue/tagged_book_list.html +++ b/templates/catalogue/tagged_book_list.html @@ -68,7 +68,7 @@ {% endwith %}
    {% for book in object_list %} -
  1. {% book book %}
  2. +
  3. {% book request book %}
  4. {% endfor %}
{% paginate %}