From: Marek Stępniowski Date: Fri, 22 Aug 2008 14:25:37 +0000 (+0200) Subject: Added breadcrumbs tag to catalogue_tags library. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/c1c87f44a4f252023c1e7cfa6f03aaa0f2b596a3?ds=sidebyside Added breadcrumbs tag to catalogue_tags library. --- diff --git a/catalogue/templatetags/catalogue_tags.py b/catalogue/templatetags/catalogue_tags.py index 43713ce0d..3c75801a7 100644 --- a/catalogue/templatetags/catalogue_tags.py +++ b/catalogue/templatetags/catalogue_tags.py @@ -107,6 +107,15 @@ def authentication_form(): 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() diff --git a/templates/catalogue/breadcrumbs.html b/templates/catalogue/breadcrumbs.html new file mode 100644 index 000000000..896d9997c --- /dev/null +++ b/templates/catalogue/breadcrumbs.html @@ -0,0 +1,9 @@ +{% load catalogue_tags %} +
+
    + {% for tag in tag_list %} +
  1. {{ tag }} | x
  2. + {% endfor %} +
  3. {{ search_form.q }} {{ search_form.tags }}
  4. +
+
\ No newline at end of file