'books': Book.objects.filter(parent=None).order_by('sort_key_author', 'sort_key'),
'pictures': Picture.objects.order_by('sort_key_author', 'sort_key'),
'collections': Collection.objects.all(),
+ 'active_menu_item': 'all_works',
})
# TODO: Rewrite this hellish piece of code which tries to do everything
-def tagged_object_list(request, tags='', list_type='default'):
+def tagged_object_list(request, tags='', list_type='books'):
raw_tags = tags
# preliminary tests and conditions
gallery = list_type == 'gallery'
Picture.tagged.with_any([tag]).exists()):
return redirect('tagged_object_list_gallery', raw_tags)
+ # this is becoming more and more hacky
+ if list_type == 'books' and not tags:
+ last_published = Book.objects.exclude(cover_thumb='').filter(parent=None).order_by('-created_at')[:20]
+ else:
+ last_published = None
+
return render_to_response(
'catalogue/tagged_object_list.html',
{
'best': best,
'list_type': list_type,
'daisy': daisy,
+ 'last_published': last_published,
+ 'active_menu_item': 'theme' if theme_is_set else list_type,
},
context_instance=RequestContext(request))
'best': best,
'title': constants.CATEGORIES_NAME_PLURAL[category],
'whole_category': constants.WHOLE_CATEGORY[category],
+ 'active_menu_item': 'theme' if category == 'theme' else None,
})