from django.utils.encoding import smart_str
from django.core.urlresolvers import reverse
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
+from django.db.models import Q
register = template.Library()
title = u''
- # Specjalny przypadek oglądania wszystkich lektur w danym zestawie
+ # Specjalny przypadek oglądania wszystkich lektur na danej półce
if len(self) == 1 and 'set' in self:
- return u'Zestaw %s' % self['set']
+ return u'Półka %s' % self['set']
# Specjalny przypadek "Twórczość w pozytywizmie", wtedy gdy tylko epoka
# jest wybrana przez użytkownika
return LoginForm(prefix='login').as_ul()
+@register.inclusion_tag('catalogue/breadcrumbs.html')
+def breadcrumbs(tags, search_form=True):
+ from wolnelektury.catalogue.forms import SearchForm
+ context = {'tag_list': tags}
+ if search_form:
+ context['search_form'] = SearchForm(tags=tags)
+ return context
+
+
@register.tag
def catalogue_url(parser, token):
bits = token.split_contents()
pass
if len(tag_slugs) > 0:
- return reverse('tagged_book_list', kwargs={'tags': '/'.join(tag_slugs)})
+ return reverse('tagged_object_list', kwargs={'tags': '/'.join(tag_slugs)})
else:
return reverse('main_page')