Esempio n. 1
0
    def __init__(self, **kwargs):
        Dashboard.__init__(self, **kwargs)

        # append a link list module for "quick links"
        self.children.append(
            modules.LinkList(title=_('Quick links'),
                             layout='inline',
                             draggable=False,
                             deletable=False,
                             collapsible=False,
                             children=[
                                 {
                                     'title': _('Return to site'),
                                     'url': '/',
                                 },
                                 {
                                     'title': _('Change password'),
                                     'url': reverse('admin:password_change'),
                                 },
                                 {
                                     'title': _('Log out'),
                                     'url': reverse('admin:logout')
                                 },
                             ]))

        # append an app list module for "Applications"
        self.children.append(
            modules.AppList(
                title=_('Applications'),
                exclude_list=('django.contrib', ),
            ))

        # append an app list module for "Administration"
        self.children.append(
            modules.AppList(
                title=_('Administration'),
                include_list=('django.contrib', ),
            ))

        # # append a recent actions module
        # self.children.append(RecentActionsDashboardModule(
        #     title=_('Recent Actions'),
        #     limit=5
        # ))
        #
        # # append a feed module
        # self.children.append(FeedDashboardModule(
        #     title=_('Latest Web Development Activities'),
        #     feed_url='http://www.pivotaltracker.com/user_activities/de98454d195bc113ba489ff01ae2673a',
        #     limit=5
        # ))

        self.children.extend(get_memcache_dash_modules())
        self.children.extend(get_varnish_dash_modules())
        self.children.extend(get_rss_dash_modules())
Esempio n. 2
0
    def __init__(self, **kwargs):
        Dashboard.__init__(self, **kwargs)

        # append a link list module for "quick links"
        self.children.append(modules.LinkList(
            title=_('Quick links'),
            layout='inline',
            draggable=False,
            deletable=False,
            collapsible=False,
            children=[
                {
                    'title': _('Return to site'),
                    'url': '/',
                },
                {
                    'title': _('Change password'),
                    'url': reverse('admin:password_change'),
                },
                {
                    'title': _('Log out'),
                    'url': reverse('admin:logout')
                },
            ]
        ))

        # append an app list module for "Applications"
        self.children.append(modules.AppList(
            title=_('Applications'),
            exclude_list=('django.contrib',),
        ))

        # append an app list module for "Administration"
        self.children.append(modules.AppList(
            title=_('Administration'),
            include_list=('django.contrib',),
        ))

        # # append a recent actions module
        # self.children.append(RecentActionsDashboardModule(
        #     title=_('Recent Actions'),
        #     limit=5
        # ))
        # 
        # # append a feed module
        # self.children.append(FeedDashboardModule(
        #     title=_('Latest Web Development Activities'),
        #     feed_url='http://www.pivotaltracker.com/user_activities/de98454d195bc113ba489ff01ae2673a',
        #     limit=5
        # ))
        
        self.children.extend(get_memcache_dash_modules())
        self.children.extend(get_varnish_dash_modules())
        self.children.extend(get_rss_dash_modules())
    def init_with_context(self, context):
        """
        Initializes the status list.
        """
        super(CacheStatusGroup, self).init_with_context(context)

        if 'dashboardmods' in settings.INSTALLED_APPS:
            import dashboardmods
            memcache_mods = dashboardmods.get_memcache_dash_modules()

            try:
                varnish_mods = dashboardmods.get_varnish_dash_modules()
            except (socket.error, KeyError) as e:
                # dashboardmods 2.2 throws KeyError for 'cache_misses' when the Varnish cache is empty.
                # Socket errors are also ignored, to work similar to the memcache stats.
                logger.exception("Unable to request Varnish stats: {0}".format(str(e)))
                varnish_mods = []

            self.children = memcache_mods + varnish_mods
    def init_with_context(self, context):
        """
        Initializes the status list.
        """
        super(CacheStatusGroup, self).init_with_context(context)

        if 'dashboardmods' in settings.INSTALLED_APPS:
            import dashboardmods
            memcache_mods = dashboardmods.get_memcache_dash_modules()

            try:
                varnish_mods = dashboardmods.get_varnish_dash_modules()
            except (socket.error, KeyError) as e:
                # dashboardmods 2.2 throws KeyError for 'cache_misses' when the Varnish cache is empty.
                # Socket errors are also ignored, to work similar to the memcache stats.
                logger.exception("Unable to request Varnish stats: {0}".format(str(e)))
                varnish_mods = []

            self.children = memcache_mods + varnish_mods
    def init_with_context(self, context):
        site_name = get_admin_site_name(context)
        
        # append an app list module for "Applications"
        self.children.append(modules.AppList(
            _('Applications'),
            exclude=('django.contrib.*',),
        ))

        # append an app list module for "Administration"
        self.children.append(modules.AppList(
            _('Administration'),
            models=('django.contrib.*',),
        ))

        # append a recent actions module
        self.children.append(modules.RecentActions(_('Recent Actions'), 5))

        self.children.extend(get_memcache_dash_modules())
Esempio n. 6
0
    def __init__(self, **kwargs):
        Dashboard.__init__(self, **kwargs)
#        display="tabs",
        self.columns = ADMIN_TOOLS_INDEX_DASHBOARD_COLUMNS
        self.children.append(modules.Group(
            title="",
            display="tabs",
            children=[
                
                modules.AppList(
                    title='Requirements',
                    include_list=('requirements', 'requirement_processing',)
                ),

                modules.AppList(
                    title='Data Management',
                    include_list=('client', 'candidate', 'job.data_management',)
                ),

                modules.AppList(
                    title='Portal Administration',
                    include_list=('django.contrib.sites', 'dashboardmods', 'portal',)
                ),
                
                modules.AppList(
                    title='User Management',
                    include_list=('django.contrib.auth',)
                ),
                
                modules.AppList(
                    title='All Applications',
                    exclude_list=('django.contrib', )
                )
                
            ]
        ))

        

#        # append an app list module for "Applications"
#        self.children.append(modules.AppList(
#            title=_('Applications'),
#            exclude_list=('django.contrib',),
#        ))
#
#        # append an app list module for "Administration"
#        self.children.append(modules.AppList(
#            title=_('Administration'),
#            include_list=('django.contrib',),
#        ))


        # append a recent actions module
        self.children.append(modules.RecentActions(
            title=_('Recent Actions'),
            limit=5
        ))

#        # append a feed module
#        self.children.append(modules.Feed(
#            title=_('Latest Django News'),
#            feed_url='http://www.djangoproject.com/rss/weblog/',
#            limit=5
#        ))

#        # append another link list module for "support".
#        self.children.append(modules.LinkList(
#            title=_('Support'),
#            children=[
#                {
#                    'title': _('Django documentation'),
#                    'url': 'http://docs.djangoproject.com/',
#                    'external': True,
#                },
#                {
#                    'title': _('Django "django-users" mailing list'),
#                    'url': 'http://groups.google.com/group/django-users',
#                    'external': True,
#                },
#                {
#                    'title': _('Django irc channel'),
#                    'url': 'irc://irc.freenode.net/django',
#                    'external': True,
#                },
#            ]
#        ))
        # append another link list module for "support".
        
        news_db_list = News.objects.filter(expires_at__gte = datetime.today(), enabled = True )
        
        news_list = []
        
        for news in news_db_list:
            news_dict = {
                         'title' : news.title,
                         'url' : news.url,
                         'external' : True,
                         }
            news_list.append(news_dict)
        
        self.children.append(modules.LinkList(
            title=_('Latest News'),
            children = news_list 
        ))
        
                # append a link list module for "quick links"
#        self.children.append(modules.LinkList(
#            title=_('Quick links'),
#            layout='inline',
#            draggable=True,
#            deletable=True,
#            collapsible=True,
#            children=[
#                {
#                    'title': _('Return to site'),
#                    'url': '/',
#                },
#                {
#                    'title': _('Change password'),
#                    'url': reverse('admin:password_change'),
#                },
#                {
#                    'title': _('Log out'),
#                    'url': reverse('admin:logout')
#                },
#            ]
#        ))
        self.children.extend(get_memcache_dash_modules())
        self.children.extend(get_varnish_dash_modules())
        self.children.extend(get_rss_dash_modules())