from core.modules.navigation import navigations

from django import template

register = template.Library()

@register.simple_tag()
def get_navigation(name):
    return navigations[name]

@register.simple_tag()
def get_nav_sections(navigation):
    return navigation.sections

@register.simple_tag()
def get_nav_items(section):
    return section.items

@register.simple_tag()
def get_nav_sections_by_name(name):
    return get_nav_sections(get_navigation(name))