}
-@register.inclusion_tag('catalogue/menu.html')
-def catalogue_menu():
- return {'categories': [
+@register.inclusion_tag('catalogue/menu.html', takes_context=True)
+def catalogue_menu(context):
+ return {
+ 'categories': [
('author', _('Authors'), 'autorzy'),
('genre', _('Genres'), 'gatunki'),
('kind', _('Kinds'), 'rodzaje'),
('epoch', _('Epochs'), 'epoki'),
('theme', _('Themes'), 'motywy'),
- ]}
+ ],
+ 'LANGUAGE_CODE': context.get('LANGUAGE_CODE'),
+ }
@register.simple_tag
'book_fragments', name='book_fragments'),
# Includes.
- url(r'^(?P<lang>[^/]+)\.json$', 'catalogue_json'),
+ url(r'^(?P<lang>[^/]+)\.json$', 'catalogue_json', name='catalogue_json'),
url(r'^b/(?P<pk>\d+)/mini\.(?P<lang>.+)\.html', 'book_mini', name='catalogue_book_mini'),
url(r'^b/(?P<pk>\d+)/mini_nolink\.(?P<lang>.+)\.html', 'book_mini', {'with_link': False}, name='catalogue_book_mini_nolink'),
url(r'^b/(?P<pk>\d+)/short\.(?P<lang>.+)\.html', 'book_short', name='catalogue_book_short'),