- output = {'theme': render_tag_list(fragment_tags)}
- for category, tags in categories.items():
- output[category] = render_tag_list(tags)
+
+ def render_split(with_books, with_pictures):
+ ctx = {}
+ if with_books:
+ ctx['books'] = render_tag_list(with_books)
+ if with_pictures:
+ ctx['pictures'] = render_tag_list(with_pictures)
+ return render_to_string('catalogue/tag_list_split.html', ctx)
+
+ output = {}
+ output['theme'] = render_tag_list(fragment_tags)
+ for category in common_categories:
+ output[category] = render_tag_list(categories.get(category, []))
+ for category in split_categories:
+ output[category] = render_split(
+ book_categories.get(category, []),
+ picture_categories.get(category, []))
+