From c1c87f44a4f252023c1e7cfa6f03aaa0f2b596a3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Fri, 22 Aug 2008 16:25:37 +0200 Subject: [PATCH] Added breadcrumbs tag to catalogue_tags library. --- catalogue/templatetags/catalogue_tags.py | 9 +++++++++ templates/catalogue/breadcrumbs.html | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 templates/catalogue/breadcrumbs.html 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 -- 2.20.1