@register.inclusion_tag('horizon/_subnav_list.html', takes_context=True)
def horizon_dashboard_nav(context):
 if ('request' not in context):
  return {}
 dashboard = context['request'].horizon['dashboard']
 panel_groups = dashboard.get_panel_groups()
 non_empty_groups = []
 for group in panel_groups.values():
  allowed_panels = []
  for panel in group:
   if (callable(panel.nav) and panel.nav(context)):
    allowed_panels.append(panel)
   elif ((not callable(panel.nav)) and panel.nav):
    allowed_panels.append(panel)
  if allowed_panels:
   non_empty_groups.append((group.name, allowed_panels))
 return {'components': SortedDict(non_empty_groups), 'user': context['request'].user, 'current': context['request'].horizon['panel'].slug, 'request': context['request']}

@ register . inclusion_tag ( 'horizon/_subnav_list.html' , takes_context = True ) def horizon_dashboard_nav ( context ) : if ( 'request' not in context ) : return { } dashboard = context [ 'request' ] . horizon [ 'dashboard' ] panel_groups = dashboard . get_panel_groups ( ) non_empty_groups = [ ] for group in panel_groups . values ( ) : allowed_panels = [ ] for panel in group : if ( callable ( panel . nav ) and panel . nav ( context ) ) : allowed_panels . append ( panel ) elif ( ( not callable ( panel . nav ) ) and panel . nav ) : allowed_panels . append ( panel ) if allowed_panels : non_empty_groups . append ( ( group . name , allowed_panels ) ) return { 'components' : SortedDict ( non_empty_groups ) , 'user' : context [ 'request' ] . user , 'current' : context [ 'request' ] . horizon [ 'panel' ] . slug , 'request' : context [ 'request' ] }
generates sub-navigation entries for the current dashboard .