def init_with_context(self, context):
        self.available_children.append(modules.LinkList)

        # self.children.append(modules.LinkList(
        #     _('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,
        #         },
        #     ],
        #     column=0,
        #     order=0
        # ))

        self.children.append(
            modules.RecentActions(_('Recent Actions'), 30, column=0, order=0))
Exemple #2
0
 def init_with_context(self, context):
     self.children.append(modules.RecentActions(
         _('Recent Actions'),
         10,
         column=0,
         order=0
     ))
Exemple #3
0
    def init_with_context(self, context):
        self.available_children.append(modules.LinkList)
        self.children.append(RecentProjects())
        self.children.append(MyReviewingProjects())
        self.children.append(ClosingFundingProjects())
        self.children.append(ClosingTasks())
        self.children.append(
            modules.RecentActions(_('Recent Actions'), 10, column=0, order=0))
        self.children.append(RecentMembersDashboard())
        if context['request'].user.has_perm('sites.export'):
            metrics_children = [
                {
                    'title': _('Export metrics'),
                    'url': reverse_lazy('exportdb_export'),
                },
            ]
            if properties.REPORTING_BACKOFFICE_ENABLED:
                metrics_children.append({
                    'title': _('Download report'),
                    'url': reverse_lazy('report-export'),
                })

            if properties.PARTICIPATION_BACKOFFICE_ENABLED:
                metrics_children.append({
                    'title':
                    _('Request complete participation metrics'),
                    'url':
                    reverse('participation-metrics')
                })

            self.children.append(
                LinkList(_('Export Metrics'), children=metrics_children))
Exemple #4
0
    def init_with_context(self, context):
        group = context.request.user.groups.first()

        if context.request.user.is_superuser:
            self.children.append(
                modules.AppList('REGISTRO PARA UN NUEVO ESTUDIANTE',
                                models=('school.Student',
                                        'school.PersonalFile', 'school.Family',
                                        'school.PaperCenter',
                                        'school.Matriculation'),
                                column=0,
                                order=0))
            self.children.append(
                modules.AppList('REGISTRO PARA UN ESTUDIANTE DE REINGRESO',
                                models='school.Matriculation',
                                column=0,
                                order=1))
            self.children.append(
                modules.AppList('USUARIOS Y ROLES',
                                models=('auth.*', ),
                                column=1,
                                order=3))

            self.children.append(
                modules.RecentActions('Acciones recientes',
                                      10,
                                      column=2,
                                      order=1))

        if context.request.user.is_superuser or group and group.name.lower(
        ) == 'secretaria'.lower():
            self.children.append(
                modules.AppList(
                    'CATALOGOS',
                    models=('school.Gender', 'school.Section', 'school.Grade',
                            'school.Course', 'school.Nationality',
                            'school.GradeSection', 'school.Profile',
                            'school.CourseGradeSection'),
                    column=2,
                    order=0))

        is_teacher = Profile.objects. \
            filter(user_id=context.request.user.id). \
            exists()
        if is_teacher:
            from django.urls import reverse
            user_id = context.request.user.id
            url = reverse('school:lista_de_asignaturas_por_seccion',
                          args=(user_id, ))

            self.available_children.append(modules.LinkList)
            self.children.append(
                modules.LinkList('Registros de Notas',
                                 children=[{
                                     'title': 'Asignaturas por Aula',
                                     'url': url,
                                     'external': False
                                 }],
                                 column=0,
                                 order=0))
Exemple #5
0
    def init_with_context(self, context):
        self.available_children.append(modules.LinkList)

        # Initiatives
        self.children.append(RecentInitiatives())
        self.children.append(MyReviewingInitiatives())

        # Activities
        self.children.append(RecentActivities())
        self.children.append(RecentEvents())
        self.children.append(RecentFunding())
        self.children.append(RecentAssignments())

        # Payouts
        self.children.append(PayoutsReadForApprovalDashboardModule())

        # Other
        self.children.append(
            modules.RecentActions(_('Recent Actions'), 10, column=0, order=0))
        self.children.append(RecentMembersDashboard())
        if rules.test_rule('exportdb.can_export', context['request'].user):
            metrics_children = [
                {
                    'title': _('Export metrics'),
                    'url': reverse_lazy('exportdb_export'),
                },
            ]
            self.children.append(
                LinkList(_('Export Metrics'), children=metrics_children))
Exemple #6
0
    def init_with_context(self, context):

        self.children.append(
            modules.AppList(_('Administration'),
                            models=('auth.*', ),
                            column=0,
                            order=0,
                            deletable=False,
                            draggable=False))

        self.children.append(
            modules.AppList(_('Aplicações'),
                            exclude=('auth.*', ),
                            column=0,
                            order=0,
                            deletable=False,
                            draggable=False))

        self.children.append(
            modules.RecentActions(
                _('Ações recentes'),
                10,
                deletable=False,
                draggable=False,
                collapsible=False,
                column=1,
                order=0,
            ))
Exemple #7
0
    def init_with_context(self, context):
        self.children.append(CountModule('统计', column=0, order=0))

        self.children.append(
            modules.LinkList('快捷操作',
                             children=[
                                 {
                                     'title': '博客首页',
                                     'url': '/',
                                     'external': True,
                                 },
                                 {
                                     'title': '创建文章',
                                     'url': reverse('admin:app_article_add'),
                                     'external': True,
                                 },
                                 {
                                     'title': 'DeerU - 开源博客框架',
                                     'url':
                                     'https://github.com/gojuukaze/DeerU',
                                     'external': True,
                                 },
                             ],
                             column=0,
                             order=1))

        self.children.append(CommentModule('待审核评论', column=0, order=2))

        self.children.append(
            modules.RecentActions('操作记录', 10, column=1, order=1))
Exemple #8
0
    def init_with_context(self, context):
        self.available_children.append(modules.LinkList)
        self.available_children.append(modules.Feed)
        site_name = get_admin_site_name(context)

        self.children.append(
            modules.LinkList(
                _('Quick links'),
                layout='inline',
                children=[
                    [_('Return to site'), '/'],
                    [
                        _('Change password'),
                        reverse('%s:password_change' % site_name)
                    ],
                    [_('Log out'),
                     reverse('%s:logout' % site_name)],
                ],
                column=0,
                order=0))

        self.children.append(
            modules.RecentActions(_('Recent Actions'), 10, column=0, order=1))

        self.children.append(
            modules.AppList(_('Applications'),
                            exclude=('auth.*', ),
                            column=1,
                            order=0))

        self.children.append(
            modules.AppList(_('Administration'),
                            models=('auth.*', ),
                            column=2,
                            order=0))
Exemple #9
0
    def init_with_context(self, context):
        self.available_children.append(modules.LinkList)
        self.available_children.append(modules.Feed)

        site_name = get_admin_site_name(context)
        # self.children.append(modules.LinkList(
        #     _('快捷操作'),
        #     layout='inline',
        #     draggable=False,
        #     deletable=False,
        #     collapsible=False,
        #     children=[
        #         [_('用户管理'), '/admin/user'],
        #     ],
        #     column=0,
        #     order=0
        # ))

        # append an app list module for "Applications"
        self.children.append(
            modules.AppList(_('Applications'),
                            exclude=('auth.*', ),
                            column=1,
                            order=0))

        # append a recent actions module
        self.children.append(
            modules.RecentActions(_('历史操作'), 10, column=0, order=1))

        # append another link list module for "support".
        self.children.append(RecentTickets(_('最新用户'), column=2, order=1))

        # append another link list module for "support".
        self.children.append(UserAddPeerDay(_('用户'), column=2, order=1))
    def init_with_context(self, context):
        self.children.append(
            modules.AppList(
                _('Quick Liks'),
                models=('monitoring.Project', 'monitoring.Organization',
                        'monitoring.Contact', 'monitoring.Profile',
                        'auth.User', 'auth.Group', 'auth.Permission',
                        'constance.Config', 'monitoring.ProjectContact'),
                column=0,
                order=0))

        self.children.append(
            modules.AppList(
                _('Catalogs'),
                models=('monitoring.Sex', 'monitoring.Country',
                        'monitoring.OrganizationType', 'monitoring.LWRRegion',
                        'monitoring.Product', 'monitoring.Education',
                        'monitoring.ContactType'),
                column=1,
                order=0))

        self.children.append(
            modules.AppList(_('Extras'),
                            models=('monitoring.Request',
                                    'monitoring.Template', 'monitoring.Source',
                                    'monitoring.Filter'),
                            column=2,
                            order=0))

        if context.request.user.is_superuser:
            self.children.append(
                modules.RecentActions(_('Recent Actions'),
                                      10,
                                      column=2,
                                      order=1))
Exemple #11
0
    def init_with_context(self, context):
        self.available_children.append(modules.LinkList)

        # append an app list module for "Applications"
        self.children.append(
            modules.AppList(
                _("Content"),
                exclude=(
                    "auth.*",
                    "django_celery_beat.*",
                ),
                column=1,
                order=0,
            ))

        # append an app list module for "Administration"
        self.children.append(
            modules.AppList(
                _("Administration"),
                models=(
                    "auth.*",
                    "django_celery_beat.*",
                ),
                column=2,
                order=0,
            ))

        # append a recent actions module
        self.children.append(
            modules.RecentActions(_("Recent Actions"), 10, column=0, order=1))

        self.children.append(
            dashboard_modules.TaskProcessing(_("Task Processing Status (WIP)"),
                                             column=0,
                                             order=0))

        self.children.append(
            modules.LinkList(
                _("Failmap resources"),
                children=[
                    {
                        "title": _("Gitlab Repository"),
                        "url": "https://gitlab.com/failmap/",
                        "external": True,
                    },
                    {
                        "title": _("Admin repository"),
                        "url": "https://gitlab.com/failmap/failmap",
                        "external": True,
                    },
                    {
                        "title": _("Failmap Website"),
                        "url": "https://faalkaart.nl",
                        "external": True,
                    },
                ],
                column=2,
                order=2,
            ), )
Exemple #12
0
 def init_with_context(self, context):
     self.available_children.append(modules.RecentActions)
     self.children.append(modules.RecentActions(
         _('Recent Actions for %s' % context['app_label'].capitalize()),
         40,
         column=0,
         order=1,
         include_list=[context['app_label'] + '.*'],
     ))
 def init_with_context(self, context):
     self.children.append(
         modules.Feed(_('Latest News'),
                      feed_url='http://www.djangoproject.com/rss/weblog/',
                      limit=5,
                      column=0,
                      order=0))
     self.children.append(
         modules.RecentActions(_('Recent Actions'), 10, column=0, order=0))
     self.children.append(JobModule(column=1))
 def init_with_context(self, context):
     self.available_children.append(
         google_analytics.GoogleAnalyticsVisitorsTotals)
     self.available_children.append(
         google_analytics.GoogleAnalyticsVisitorsChart)
     self.available_children.append(
         google_analytics.GoogleAnalyticsPeriodVisitors)
     ###########################################################################################
     self.children.append(
         modules.RecentActions(_('Recent Actions'), 10, column=0, order=0))
     #############################################################################################
     self.children.append(
         modules.ModelList(_('Models'),
                           exclude=('auth.*', ),
                           column=0,
                           order=0))
     #############################################################################################
     self.children.append(
         modules.AppList(_('Applications'),
                         exclude=('auth.*', ),
                         column=0,
                         order=0))
     #############################################################################################
     self.available_children.append(modules.LinkList)
     self.children.append(
         modules.LinkList(
             _('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,
                 },
             ],
             column=0,
             order=0))
     #############################################################################################
     self.children.append(
         modules.Feed(_('Latest Django News'),
                      feed_url='http://www.djangoproject.com/rss/weblog/',
                      limit=5,
                      column=0,
                      order=0))
     import sys
     sys.stderr.write("hanbi ya nori ya ssaki khayli ba2alinahuj")
Exemple #15
0
    def init_with_context(self, context):
        self.available_children.append(modules.LinkList)

        self.children.append(
            modules.ModelList(title=_('Application models'),
                              models=self.models(),
                              column=0,
                              order=0))
        self.children.append(
            modules.RecentActions(include_list=self.get_app_content_types(),
                                  column=1,
                                  order=0))
Exemple #16
0
 def init_with_context(self, context):
     self.available_children.append(modules.AppList)
     self.available_children.append(modules.ModelList)
     self.available_children.append(modules.RecentActions)
     self.children.append(modules.AppList(
         _('Apps'),
         column=0,
     ))
     self.children.append(modules.RecentActions(
         _('Recent Actions'),
         column=1,
     ))
Exemple #17
0
 def init_with_context(self, context):
     self.children.append(
         modules.AppList(_('Applications'),
                         exclude=('auth.*', 'filebrowser.*',
                                  'globalsettings.*'),
                         column=0,
                         order=0)),
     self.children.append(
         modules.RecentActions(_('Recent Actions'), 20, column=1, order=0))
     self.children.append(
         modules.AppList(_('Authentication'),
                         exclude=('enticemode.*', 'globalsettings.*',
                                  'presentationmode.*', 'kidszone.*',
                                  'mainmenu.*', 'wowmode.*',
                                  'filebrowser.*'),
                         column=2,
                         order=0)),
     self.children.append(
         modules.LinkList(_('File Manager'),
                          children=[
                              {
                                  'title': _('File Manager'),
                                  'url': '/admin/filebrowser/browse/',
                                  'external': True,
                              },
                          ],
                          column=2,
                          order=1))
     self.children.append(
         modules.LinkList(
             _('Global Settings'),
             children=[
                 {
                     'title': 'Content Styling',
                     'url': '/globalsettings/contentstyling/2/change/',
                     'external': True,
                 },
                 {
                     'title': 'Video Wall',
                     'url': '/globalsettings/videowall/1/change/',
                     'external': True,
                 },
                 {
                     'title': 'Publish CMS',
                     'url': '/globalsettings/publish/1/change/',
                     'external': True,
                 },
             ],
             column=0,
             order=1))
Exemple #18
0
    def init_with_context(self, context):
        self.available_children.append(modules.LinkList)

        my_app_name = self.models()[0][:-2]
        my_app = None
        for app in context['available_apps']:
            if app['app_label'] == my_app_name:
                my_app = app
                break

        other, physical, online = [], [], []
        for m in my_app['models']:
            object_name = m['object_name']
            lower_object_name = object_name.lower()
            if 'temp' in lower_object_name:
                # Hide temporary models
                continue
            if 'online' in lower_object_name:
                online.append(my_app_name + '.' + object_name)
            elif ('seminar' in lower_object_name and 'ece' not in lower_object_name) or 'jobfair' in lower_object_name:
                physical.append(my_app_name + '.' + object_name)
            else:
                other.append(my_app_name + '.' + object_name)

        self.children.append(modules.ModelList(
            title=_('其他設定'),
            models=other,
            column=0,
            order=0
        ))

        self.children.append(modules.ModelList(
            title=_('實體'),
            models=physical,
            column=0,
            order=1
        ))

        self.children.append(modules.ModelList(
            title=_('線上'),
            models=online,
            column=0,
            order=2
        ))

        self.children.append(modules.RecentActions(
            include_list=self.get_app_content_types(),
            column=1,
            order=0
        ))
Exemple #19
0
    def init_with_context(self, context):
        self.available_children.append(modules.LinkList)
        self.available_children.append(modules.Feed)

        self.available_children.append(
            google_analytics.GoogleAnalyticsVisitorsTotals)
        self.available_children.append(
            google_analytics.GoogleAnalyticsVisitorsChart)
        self.available_children.append(
            google_analytics.GoogleAnalyticsPeriodVisitors)

        site_name = get_admin_site_name(context)
        # append a link list module for "quick links"
        self.children.append(
            modules.LinkList(
                _('Quick links'),
                layout='inline',
                draggable=False,
                deletable=False,
                collapsible=False,
                children=[
                    [_('Return to site'), '/'],
                    [
                        _('Change password'),
                        reverse('%s:password_change' % site_name)
                    ],
                    [_('Log out'),
                     reverse('%s:logout' % site_name)],
                ],
                column=0,
                order=0))

        # append an app list module for "Applications"
        self.children.append(
            modules.AppList(_('Applications'),
                            exclude=('auth.*', ),
                            column=1,
                            order=0))

        # append an app list module for "Administration"
        self.children.append(
            modules.AppList(_('Administration'),
                            models=('auth.*', ),
                            column=2,
                            order=0))

        # append a recent actions module
        self.children.append(
            modules.RecentActions(_('Recent Actions'), 10, column=0, order=1))
Exemple #20
0
    def init_with_context(self, context):
        self.init_with_context_called = True
        self.available_children.append(modules.LinkList)
        self.available_children.append(modules.Feed)

        # append a recent actions module
        self.children.append(
            modules.RecentActions('Recent Actions', 10, column=0, order=1))

        # append a feed module
        self.children.append(
            modules.Feed('Latest Django News',
                         feed_url='http://www.djangoproject.com/rss/weblog/',
                         limit=5,
                         column=1,
                         order=1))
Exemple #21
0
    def init_with_context(self, context):
        self.available_children.append(modules.RecentActions)
        self.available_children.append(modules.RecentActions(
            _('Recent Actions'),
            limit=10,
            column=0,
            order=1
        ))

        self.available_children.append(modules.Feed)
        self.available_children.append(modules.Feed(
            _('Latest PyFreebilling News'),
            feed_url='https://www.pyfreebilling.com/feed',
            limit=5,
            column=1,
            order=1
        ))
    def init_with_context(self, context):
        # append an app list module for "Casting"
        self.children.append(
            modules.ModelList(_('Casting'),
                              exclude=('auth.*', ),
                              models=('casting.*', ),
                              column=0,
                              order=1))

        # append an app list module for "Applications"
        self.children.append(
            modules.AppList(_('Applications'),
                            models=('auth.*', ),
                            column=0,
                            order=0))

        # append a recent actions module
        self.children.append(
            modules.RecentActions(_('Recent Actions'), 10, column=2, order=1))
Exemple #23
0
    def init_with_context(self, context):
        self.available_children.append(modules.LinkList)
        self.available_children.append(modules.Feed)

        self.children.append(
            modules.LinkList(
                _('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,
                    },
                ],
                column=0,
                order=0))
        # append an app list module for "Applications"
        self.children.append(
            modules.AppList(_('Applications'),
                            exclude=('auth.*', ),
                            column=1,
                            order=0))
        # append a recent actions module
        self.children.append(
            modules.RecentActions(_('Recent Actions'), 10, column=0, order=1))

        self.children.append(
            modules.Feed(_('Latest Django News'),
                         feed_url='http://www.djangoproject.com/rss/weblog/',
                         limit=5,
                         column=1,
                         order=1))
Exemple #24
0
    def init_with_context(self, context):
        self.available_children.append(modules.RecentActions)
        self.children.append(
            modules.RecentActions(
                _("Recent Actions for %s" % context["app_label"].capitalize()),
                40,
                column=1,
                order=0,
                include_list=[context["app_label"] + ".*"],
            ))

        if context["app_label"] == "game":
            self.children.append(
                modules.LinkList(
                    _("Quick Actions"),
                    children=[
                        {
                            "title": _("Verify New Urls"),
                            "url": "/admin/game/urlsubmission/?"
                            "has_been_accepted__exact=0&has_been_rejected__exact=0&o=-6.2.3",
                            "external": False,
                        },
                        {
                            "title": _("Verify New Organizations"),
                            "url": "/admin/game/organizationsubmission/?"
                            "has_been_accepted__exact=0&has_been_rejected__exact=0&o=-5",
                            "external": False,
                        },
                    ],
                    column=0,
                    order=0,
                    layout="stacked",
                ))

        self.children.append(
            modules.AppList(_("Applications"),
                            models=("%s.*" % context["app_label"], ),
                            column=0,
                            order=1))
Exemple #25
0
    def init_with_context(self, context):
        self.available_children.append(modules.LinkList)
        self.available_children.append(modules.RecentActions)
        self.available_children.append(modules.Feed)
        self.available_children.append(modules.AppList)
        self.available_children.append(dashboard_modules.SmartAddUrl)

        self.children.append(
            modules.RecentActions(_('Recent Actions'), 10, column=0, order=1))

        self.children.append(
            dashboard_modules.SmartAddUrl(_('Smart Add Url\'s'),
                                          column=1,
                                          order=1))

        self.children.append(
            modules.LinkList(_('Failmap resources'),
                             children=[
                                 {
                                     'title': _('Github Repository'),
                                     'url': 'https://github.com/failmap/',
                                     'external': True,
                                 },
                                 {
                                     'title': _('Admin repository'),
                                     'url': 'https://github.com/failmap/admin',
                                     'external': True,
                                 },
                                 {
                                     'title': _('Failmap Website'),
                                     'url': 'https://faalkaart.nl',
                                     'external': True,
                                 },
                             ],
                             column=1,
                             order=2), )
Exemple #26
0
    def init_with_context(self, context):
        self.children.append(
            modules.RecentActions(_('Recent Actions'), 10, column=2, order=1))

        self.children.append(
            modules.AppList(
                _('podcast data'),
                models=[
                    'podcast.PodcastHost',
                    'podcast.PodcastAlbum',
                    'podcast.PodcastEpisode',
                    # 'podcast.PodcastEnclosure',
                ],
                column=0,
                order=2))

        self.children.append(
            modules.AppList(_('member data'),
                            models=[
                                'member.Member',
                                'member.PodcastAlbumSubscription',
                            ],
                            column=1,
                            order=0))
Exemple #27
0
 def init_with_context(self, context):
     self.available_children.append(modules.LinkList)
     self.children.append(
         modules.ModelList(
             _('Modelos'),
             exclude=('auth.*', ),
             column=1,
             order=0,
             layout='inline',
         ))
     self.children.append(
         modules.AppList(_('Aplicações'),
                         exclude=('auth.*', ),
                         column=0,
                         order=0))
     self.children.append(
         modules.RecentActions(_('Ações Recentes'),
                               limit=10,
                               column=0,
                               order=0))
     self.children.append(
         RequestCategories(_('Solicitações de categoria'),
                           column=1,
                           order=6))
Exemple #28
0
 def init_with_context(self, context):
     self.available_children.append(modules.LinkList)
     self.children.append(
         modules.LinkList(_('REST API'),
                          children=[
                              {
                                  'title': _('Documentación API'),
                                  'url':
                                  'https://aaps-data.appspot.com/docs/',
                                  'external': True,
                              },
                              {
                                  'title': _('Documentación Swagger'),
                                  'url':
                                  'https://aaps-data.appspot.com/swagger/',
                                  'external': True,
                              },
                          ],
                          column=1,
                          order=0))
     self.children.append(
         modules.AppList(_('Aplicaciones'), column=0, order=0))
     self.children.append(
         modules.RecentActions(_('Acciones Recientes'), column=2, order=0))
Exemple #29
0
    def init_with_context(self, context):
        self.available_children.append(modules.LinkList)
        self.available_children.append(modules.Feed)

        self.available_children.append(google_analytics.GoogleAnalyticsVisitorsTotals)
        self.available_children.append(google_analytics.GoogleAnalyticsVisitorsChart)
        self.available_children.append(google_analytics.GoogleAnalyticsPeriodVisitors)

        site_name = get_admin_site_name(context)
        # append a link list module for "quick links"
        self.children.append(modules.LinkList(
            _('Quick links'),
            layout='inline',
            draggable=False,
            deletable=False,
            collapsible=False,
            children=[
                [_('Return to site'), '/'],
                [_('Change password'),
                 reverse('%s:password_change' % site_name)],
                [_('Log out'), reverse('%s:logout' % site_name)],
            ],
            column=2,
            order=0
        ))

        # append an app list module for "Applications"
        self.children.append(modules.AppList(
            _('Applications'),
            exclude=('auth.*',),
            column=1,
            order=0
        ))

        # append an app list module for "Administration"
        self.children.append(modules.AppList(
            _('Administration'),
            models=('auth.*',),
            column=2,
            order=0
        ))

        # append a recent actions module
        self.children.append(modules.RecentActions(
            _('Recent Actions'),
            10,
            column=2,
            order=1
        ))

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

        # append another link list module for "support".
        self.children.append(modules.LinkList(
            _('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,
                },
            ],
            column=2,
            order=1
        ))
Exemple #30
0
    def init_with_context(self, context):
        self.available_children.append(modules.LinkList)
        self.available_children.append(modules.Feed)

        site_name = get_admin_site_name(context)
        # append a link list module for "quick links"
        self.children.append(
            modules.LinkList(
                _("Quick links"),
                layout="inline",
                draggable=False,
                deletable=False,
                collapsible=False,
                children=[
                    [_("Return to site"), "/"],
                    [
                        _("Change password"),
                        reverse("%s:password_change" % site_name)
                    ],
                    [_("Log out"),
                     reverse("%s:logout" % site_name)],
                ],
                column=0,
                order=0,
            ))

        # append an app list module for "Applications"
        self.children.append(
            modules.AppList(_("Applications"),
                            exclude=("auth.*", ),
                            column=1,
                            order=0))

        # append an app list module for "Administration"
        self.children.append(
            modules.AppList(_("Administration"),
                            models=("auth.*", ),
                            column=2,
                            order=0))

        # append a recent actions module
        self.children.append(
            modules.RecentActions(_("Recent Actions"), 10, column=0, order=1))

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

        # append another link list module for "support".
        self.children.append(
            modules.LinkList(
                _("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,
                    },
                ],
                column=2,
                order=1,
            ))