Ejemplo n.º 1
0
    def tabs(cls, view_type, document=None):
        tabs = Nav.local_menu()

        if view_type in ['api_log', 'change_log', 'activity', 'view']:

            tabs.add(
                NavItem('Details',
                        endpoint=AccountConfig.get_endpoint('view'),
                        view_args={'account': document._id}))

            tabs.add(
                NavItem('Activity',
                        endpoint=AccountConfig.get_endpoint('activity'),
                        view_args={'account': document._id}))

            tabs.add(
                NavItem('API log',
                        endpoint=AccountConfig.get_endpoint('api_log'),
                        view_args={'account': document._id}))

            tabs.add(
                NavItem('Change log',
                        endpoint=AccountConfig.get_endpoint('change_log'),
                        view_args={'account': document._id}))

        return tabs
Ejemplo n.º 2
0
    def tabs(cls, view_type, document=None):
        tabs = Nav.local_menu()

        if view_type in ['variations', 'view']:

            tabs.add(
                NavItem('Details',
                        endpoint=AssetConfig.get_endpoint('view'),
                        view_args={'asset': document._id}))

            tabs.add(
                NavItem(f'Variations ({len(document.variations or {})})',
                        endpoint=AssetConfig.get_endpoint('variations'),
                        view_args={'asset': document._id}))

        return tabs