Pass a copy of the entire context to the navigation subtemplate when calling it from sublist template

This commit is contained in:
Roberto Rosario
2011-12-25 03:14:19 -04:00
parent 80fab8b70d
commit de49d4a588
2 changed files with 8 additions and 9 deletions

View File

@@ -4,7 +4,7 @@
{% with link.permissions as permissions %}
{% check_permissions request.user permissions %}
{% check_access permissions request.user navigation_object %}
{% check_access permissions request.user object %}
{% if permission or access %}
{% if as_li %}

View File

@@ -249,15 +249,14 @@ def get_object_navigation_links(parser, token):
@register.inclusion_tag('generic_navigation.html', takes_context=True)
def object_navigation_template(context):
# Pass the list object to the navigation template as the navigation object
return {
'navigation_object': context['object'] if 'object' in context else None,
'request': context['request'],
new_context = copy.copy(context)
new_context.update({
'horizontal': True,
'object_navigation_links': _get_object_navigation_links(context)
}
'object_navigation_links': _get_object_navigation_links(context)
})
return new_context
@register.tag
def get_multi_item_links(parser, token):
tag_name, arg = token.contents.split(None, 1)