from django.apps import AppConfig

from suit.apps import DjangoSuitConfig
from suit.menu import ParentItem, ChildItem


class SuitConfig(DjangoSuitConfig):
	layout = 'horizontal'
	menu = (
        ParentItem('Usuarios', children=[
            ChildItem('Usuarios', model='core.CustomUser'),
        ], icon='fa fa-leaf'),

        ParentItem('Cooperativas', children=[
            ChildItem('Cooperativas', model='companies.Company'),
        ], icon='fa fa-leaf'),

        ParentItem('Productos', children=[
            ChildItem('Productos', model='products.Product'),
        ], icon='fa fa-leaf'),

        ParentItem('Categorías', children=[
            ChildItem('Categorías', model='products.categoryTag'),
            ChildItem('Tags', model='products.TreeTag'),
            ChildItem('Atributos', model='products.AttributeTag'),
        ], icon='fa fa-leaf'),

        ParentItem('Importación', children=[
            ChildItem('Historial', model='history.History'),
            ChildItem('Logs', model='stats.StatsLog'),
        ], icon='fa fa-leaf'),

        ParentItem('Otros', children=[
            ChildItem('Grupos',model='auth.group'),
            ChildItem('Países', model='geo.Country'),
            ChildItem('Regiones', model='geo.Region'),
            ChildItem('Provincias', model='geo.Province'),
            ChildItem('Municipios', model='geo.City'),
        ], icon='fa fa-leaf'),
    )

    def ready(self):
        super(SuitConfig, self).ready()


class CoreConfig(AppConfig):
    name = 'core'
