Fix footer menu lang

This commit is contained in:
Oleg Lavrovsky 2017-03-14 10:54:47 +01:00
parent 51e3a70922
commit abb3935cd7

View file

@ -37,24 +37,26 @@ def top_menu(context, parent, calling_page=None):
'request': context['request'], 'request': context['request'],
} }
# Retrieves the children of the top menu items for the drop downs def menuitems_children(parent):
@register.inclusion_tag('tags/top_menu_children.html', takes_context=True)
def top_menu_children(context, parent):
menuitems_children = parent.get_children().live().in_menu().specific() menuitems_children = parent.get_children().live().in_menu().specific()
for menuitem in menuitems_children: for menuitem in menuitems_children:
menuitem.title = menuitem.trans_title menuitem.title = menuitem.trans_title
return menuitems_children
# Retrieves the children of the top menu items for the drop downs
@register.inclusion_tag('tags/top_menu_children.html', takes_context=True)
def top_menu_children(context, parent):
return { return {
'parent': parent, 'parent': parent,
'menuitems_children': menuitems_children, 'menuitems_children': menuitems_children(parent),
'request': context['request'], 'request': context['request'],
} }
# Retrieves the footer menu items # Retrieves the footer menu items
@register.inclusion_tag('tags/footer_menu.html', takes_context=True) @register.inclusion_tag('tags/footer_menu.html', takes_context=True)
def footer_menu(context, parent, calling_page=None): def footer_menu(context, parent, calling_page=None):
menuitems = parent.get_children().live().in_menu()
return { return {
'calling_page': calling_page, 'calling_page': calling_page,
'menuitems': menuitems, 'menuitems': menuitems_children(parent),
'request': context['request'], 'request': context['request'],
} }