from django import template
from meps.models import Country, Group

register = template.Library()


@register.inclusion_tag("blocks/navigation.html")
def build_menu():
    return {
        'menus': [{
            'name': 'Country',
            'content': ({
                "url": "country:%s" % country.code,
                "display": country.name} for country in Country.objects.all().order_by("name")),
            'flyout_class': 'four',
        },
        {
            'name': 'Political group',
            'content': ({
                "url": "group:%s" % group.abbreviation,
                "display": group.name} for group in Group.objects.all().order_by("abbreviation")),
            'flyout_class': 'twelve',
        },
        ]
    }

@@ -59,16 +59,27 @@
 y, Group
+, Committee
 %0A%0Aregist
@@ -729,32 +729,327 @@
 ve',%0A        %7D,%0A
+        %7B%0A            'name': 'Committees',%0A            'content': (%7B%0A                %22url%22: %22committees:%25s%22 %25 committee.abbreviation,%0A                %22display%22: committee.name%7D for committee in Committee.objects.all().order_by(%22abbreviation%22)),%0A            'flyout_class': 'twelve',%0A        %7D,%0A
         %5D%0A    %7D%0A

Add committees in header