# -*- encoding: utf-8 -*-

from django.utils.translation import ugettext_lazy as _

from grappelli.dashboard import modules, Dashboard

class CustomIndexDashboard(Dashboard):
    """
    Custom index dashboard for polynum
    """

    def init_with_context(self, context):
        self.children.append(modules.ModelList(
            _(u'Groupes, utilisateurs et rôles'),
            column=1,
            collapsible=False,
            models=('polynum.base.models.user.PolynumUser',
                'django.contrib.auth.models.Group',
                'polynum.base.models.rbac.Role*',
                'polynum.delegation.models.Delegation'),
        ))

        self.children.append(modules.ModelList(
            _(u'Demandes'),
            column=1,
            collapsible=False,
            models=('polynum.base.models.request.Request',
                ),
        ))

        self.children.append(modules.ModelList(
             _(u'Paramètres des documents'),
             column=1,
             collapsible=True,
            css_classes=['grp-closed'],
             models=(
                 'polynum.base.models.request.DeliveryPlace',
                 'polynum.base.models.request.DocumentUsage',
                 'polynum.base.models.request.DocumentLicence',),
        ))

        self.children.append(modules.ModelList(
            _(u'Profils de reprographie'),
            column=1,
            collapsible=True,
            css_classes=['grp-closed'],
            models=('polynum.base.models.profile.Profile',
                'polynum.base.models.profile.ProfileOption',
                #'polynum.base.models.profile.ProfileOptionChoice',
                ),
        ))

        self.children.append(modules.ModelList(
            _(u'Gestion du workflow'),
            column=1,
            collapsible=True,
            css_classes=['grp-closed'],
            models=('polynum.base.models.workflow.Status',
                'polynum.base.models.workflow.Action',
                'polynum.base.models.workflow.Transition',
                'polynum.base.models.workflow.MailNotification',
                ),
        ))

        self.children.append(modules.ModelList(
            _(u'Entités'),
            column=1,
            collapsible=True,
            css_classes=['grp-closed'],
            models=('polynum.base.models.entity.Entity',
                'polynum.base.models.entity.EntityType',),
        ))

