Kumi
a133ea4cb1
Prepare for Minio/S3 media storage Add current FontAwesome Move statics and templates out of core Add navigation menu generation Add name attribute to URLs Probably many other things I forgot by now
21 lines
454 B
Python
21 lines
454 B
Python
from core.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)) |