def __init__(self, **kwargs): Dashboard.__init__(self, **kwargs) self.children.append( modules.AppList( title=_('Applications'), exclude=('django.contrib.*', ), )) # append an app list module for "Administration" self.children.append( modules.AppList( title=_('Administration'), models=('django.contrib.*', ), )) # append a recent actions module self.children.append( modules.RecentActions(title=_('Recent Actions'), limit=5)) self.children.append( modules.RecentActions(title='Django CMS recent actions', include_list=( 'cms.page', 'cms.cmsplugin', ))) self.children.append( modules.Feed(title=_('Latest Django News'), feed_url='http://www.djangoproject.com/rss/weblog/', limit=5))
def init_with_context(self, context): """ Use this method if you need to access the request context. """ # request = context['request'] models = self.models exclude = None # Hack for DNS App if "dns" in self.app_title.lower(): self.app_title = "Domains & DNS" elif "admin" in self.app_title.lower(): models = ("django.contrib.*", ) exclude = ("django.contrib.auth.*", ) elif "auth" in self.app_title.lower(): models = ("django.contrib.auth.*", ) self.app_title = self.app_title + " Admin" # append a model list module and a recent actions module self.children += [ modules.ModelList(title=self.app_title, models=models, exclude=exclude) ] self.children += [ modules.RecentActions(_("Recent Actions"), include_list=self.get_app_content_types(), limit=5) ] return super(IPAMAppIndexDashboard, self).init_with_context(context)
def __init__(self, *args, **kwargs): AppIndexDashboard.__init__(self, *args, **kwargs) # TODO: Find a better way for this if str(self.app_title) == 'Voip_Gateway': app_title = _('voip gateway') models = ['voip_gateway.*'] elif str(self.app_title) == 'Voip_Billing': app_title = _('Voip Billing') models = ['voip_billing.*'] elif str(self.app_title) == 'Cdr_Alert': app_title = _('CDR Alert') models = ['cdr_alert.*'] else: app_title = self.app_title models = self.models # append a model list module and a recent actions module self.children += [ # modules.ModelList(self.app_title, self.models), modules.ModelList(app_title, models), modules.RecentActions(_('recent actions').title(), include_list=self.get_app_content_types(), limit=5) ]
def init_with_context(self, context): # append an app list module for "Applications" self.children.append(PurloviaSummaryModule()) self.children.append( modules.Group( _("Data"), display="accordion", children=[ modules.AppList( _("Celery"), exclude=( "django.contrib.*", "overseer.users.*", "overseer.purlovia.*", "allauth.*", ), ), modules.AppList( _("Administration"), models=( "django.contrib.*", "overseer.users.*", "allauth.*", ), ), ], )) # append a recent actions module self.children.append(modules.RecentActions(_("Recent Actions"), 5))
def __init__(self, *args, **kwargs): AppIndexDashboard.__init__(self, *args, **kwargs) self.children += [ modules.ModelList(self.app_title, self.models), modules.RecentActions(include_list=self.get_app_content_types()), ]
def init_with_context(self, context): # Links module self.children.append( modules.LinkList( u'Administration', children=[self._create_link(**l) for l in ADMIN_LINKS])) # Models module self.children.append( modules.Group(u'Models', display=u'accordion', children=[ self._create_model_group(**g) for g in ADMIN_MODEL_GROUPS ])) # Recent actions module self.children.append(modules.RecentActions('Recent Actions', limit=5)) # Pages self.children.append( modules.LinkList(u'Pages', children=[ self._create_link(n, u'admin:pages_index', [l]) for l, n in settings.LANGUAGES ]))
def init_with_context(self, context): 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=[ [u'Настройки сайта', '/settings/MyApp'], [_('Return to site'), '/'], [ _('Change password'), reverse('%s:password_change' % site_name) ], [_('Log out'), reverse('%s:logout' % site_name)], ])) self.children.append( modules.ModelList( title=u'Страницы', models=('pages.models.Page', ), )) self.children.append( modules.ModelList( title=u'Прайс', models=( 'price.models.Category', 'price.models.SubCategory', 'price.models.Item', ), )) self.children.append( modules.ModelList( title=u'Заказы', models=('order.models.Order', ), )) self.children.append( modules.ModelList( title=u'Обратная связь', models=('feedback.models.Request', ), )) # append a recent actions module self.children.append(modules.RecentActions(_('Recent Actions'), 5)) self.children.append( modules.ModelList( title=u'Пользователи', models=( 'django.contrib.auth.*', 'users.models.Profile', ), ))
def init_with_context(self, context): 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=[ [_('List of patiens'), '/cards/card/usercard/'], [_('Add patient'), '/cards/card/usercard/add/'], [_('Log out'), reverse('%s:logout' % site_name)], ])) # Birthday module self.children.append(BirthdayModule(title=_("Birday"), message=u' ')) # Search patients module self.children.append( SearchPatientModule(title=_("Find patient"), message=u' ')) # append an app list module for "Applications" self.children.append( modules.AppList( _('Applications'), exclude=('django.contrib.*', ), )) # append a recent actions module self.children.append(modules.RecentActions(_('Recent Actions'), 5))
def init_with_context(self, context): self.children.append( modules.Group( _("Site management"), column=1, children=( modules.ModelList( _("User Management"), column=1, models=( "apps.users.models.*", "django.contrib.auth.models.*", "rest_framework.authtoken.models.*", ), ), modules.ModelList(_("Emails"), column=1, models=("apps.email.models.*", )), modules.ModelList(_("Storage"), column=1, models=("apps.storage.models.*", )), ), )) self.children.append( modules.RecentActions(_("Recent Actions"), 5, column=2))
def __init__(self, *args, **kwargs): AppIndexDashboard.__init__(self, *args, **kwargs) self.children.append( modules.RecentActions(_('Recent Actions'), include_list=self.get_app_content_types(), limit=10))
def init_with_context(self, context): 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)], # ] # )) # append an app list module for "Applications" self.children.append(modules.AppList( _('Applications'), exclude=('django.contrib.*',), )) # append a recent actions module self.children.append(modules.RecentActions(_('Recent Actions'), 5))
def init_with_context(self, context): 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)], ] )) # 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)) # append a feed module self.children.append(modules.Feed( _('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( _('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, }, ] ))
def init_with_context(self, context): site_name = get_admin_site_name(context) # append a link list module for "quick links" self.children.append( modules.LinkList(_('Quick links'), layout='inline', children=[ { 'title': u'Выгрузить клиентов в excel', 'url': 'customers/customer/xlsx/', }, ])) # 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))
def init_with_context(self, context): 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=[ [ _("Change password"), reverse("%s:password_change" % site_name) ], [_("Log out"), reverse("%s:logout" % site_name)], ])) self.children.append( modules.ModelList( title=u"Пользователи", models=("core.apps.account.models.TelegramAccount", ), )) self.children.append( modules.ModelList( title=u"Кошельки", models=("core.apps.wallet.models.Wallet", ), )) # append a recent actions module self.children.append(modules.RecentActions(_("Recent Actions"), 5))
def init_with_context(self, context): 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=[ [ _("Change password"), reverse("%s:password_change" % site_name) ], [_("Log out"), reverse("%s:logout" % site_name)], ], )) # append an app list module for "Applications" self.children.append( modules.AppList(_("Applications"), exclude=("django.contrib.*", ))) # append a recent actions module self.children.append(modules.RecentActions(_("Recent Actions"), 5))
def init_with_context(self, context): site_name = get_admin_site_name(context) # append an app list module for "Administration" self.children.append( modules.ModelList( _('Administration'), models=('django.contrib.*', 'social_auth.*'), )) # append a recent actions module self.children.append(modules.RecentActions(_('Recent Actions'), 5)) # append another link list module for "support". self.children.append( modules.LinkList(_('Support'), children=[ { 'title': _('Sigurd project website'), 'url': 'http://sigurd.webriders.com.ua', 'external': True, }, { 'title': _('Django Dash 2011'), 'url': 'http://djangodash.com', 'external': True, }, ]))
def __init__(self, **kwargs): Dashboard.__init__(self, **kwargs) self.children.append( modules.ModelList( title=u'Пользователи', models=('django.contrib.auth.*', ), )) self.children.append( modules.Group(title=u"Статистика", display="tabs", children=[ modules.ModelList( title=u'Товары', models=('shop.models.*', ), ), modules.ModelList( title=u'Заказы', models=('orders.models.*', ), ), ])) self.children.append((modules.Group( title=u"Товары", display="tabs", children=[ modules.ModelList(title=u"Категории", models=('shop.models.category', )), ]))) # append a recent actions module self.children.append( modules.RecentActions(title='Последние действия', limit=15))
def init_with_context(self, context): self.children.append(apps_group) self.children.append(ZinniaStatistics()) self.children.append(QuickEntry()) self.children.append(DraftEntries()) self.children.append(Comments()) self.children.append(Linkbacks()) self.children.append(modules.RecentActions(_('Recent Actions'), 5)) self.children.append( modules.LinkList( _('Zinnia support'), children=[{ 'title': _('Online documentation'), 'url': 'http://django-blog-zinnia.readthedocs.org/', 'external': True, }, { 'title': _('Mailing list'), 'url': 'http://groups.google.com/group/django-blog-zinnia/', 'external': True, }, { 'title': _('Issue tracker'), 'url': 'https://github.com/Fantomas42/django-blog-zinnia/issues', 'external': True, }])) self.children.append( modules.Feed( _('Recent commits on Zinnia'), feed_url= 'https://github.com/Fantomas42/django-blog-zinnia/commits/develop.atom', limit=5))
def init_with_context(self, context): ## Foo #self.children.append(modules.ModelList(_('Foo'), # models = conf.foo_apps, # collapsible = False, # deletable = False #)) # Fobi self.children.append( modules.Group(title=_('Fobi'), display='stacked', children=[ modules.ModelList(_('Plugins'), models=conf.fobi_plugins, collapsible=False, deletable=False), modules.ModelList(_('Forms'), models=conf.fobi_forms, collapsible=False, deletable=False), modules.ModelList(_('Data'), models=conf.fobi_data, collapsible=False, deletable=False), ])) if 'feincms' in settings.INSTALLED_APPS: # FeinCMS pages self.children.append( modules.AppList(_('FeinCMS Pages'), models=conf.feincms_pages, collapsible=False, deletable=False)) if 'cms' in settings.INSTALLED_APPS: # DjangoCMS pages self.children.append( modules.AppList(_('DjangoCMS Pages'), models=conf.djangocms_pages, collapsible=False, deletable=False)) # Append an app list module for "Administration" self.children.append( modules.AppList(_('Administration'), models=conf.django_contrib_apps, collapsible=False, deletable=False)) # Append an app list module for "Administration" self.children.append( modules.AppList(_('Other apps'), models=conf.other_apps, collapsible=False, deletable=False)) # Append a recent actions module self.children.append(modules.RecentActions(_('Recent Actions'), 10))
def __init__(self, *args, **kwargs): AppIndexDashboard.__init__(self, *args, **kwargs) # append a model list module and a recent actions module self.children += [ modules.ModelList(self.app_title, self.models), modules.RecentActions(_("Recent Actions"), include_list=self.get_app_content_types(), limit=5), ]
def get_recent_actions_module(self): """ Instantiate the :class:`~admin_tools.dashboard.modules.RecentActions` module for use in the dashboard. """ return modules.RecentActions(_('Recent Actions'), 5, enabled=False, collapsible=False)
def __init__(self, *args, **kwargs): super().__init__(self, *args, **kwargs) self.children += [ modules.ModelList(self.app_title, self.models), modules.RecentActions(_("Recent Actions"), include_list=self.get_app_content_types(), limit=5), ]
def __init__(self, **kwargs): self.children = self.children or [] self.children.append(modules.ModelList( title=_('Site Content'), models=( 'elephantblog.*', 'feincms.module.page.*', 'pathways.*', ), )) self.children.append(modules.ModelList( title=_('Lots'), models=( 'lots.*', ), )) self.children.append(modules.ModelList( title=_('Organize'), models=( 'phillyorganize.*', ), )) self.children.append(modules.AppList( title=_('Applications'), exclude=( 'django.contrib.*', 'elephantblog.*', 'feincms.module.page.*', 'phillydata.*', 'livinglots_usercontent.*', 'lots.*', ), )) self.children.append(modules.ModelList( title=_('Lot Content'), models=('livinglots_usercontent.*',), )) self.children.append(modules.AppList( title=_('Data'), models=('phillydata.*',), )) self.children.append(modules.AppList( title=_('Administration'), models=('django.contrib.*',), )) self.children.append(modules.RecentActions( title=_('Recent Actions'), limit=5 ))
def init_with_context(self, context): # Model list module self.children.append(modules.ModelList(self.app_title, self.models)) # Recent actions module self.children.append( modules.RecentActions('Recent Actions', limit=5, include_list=self.get_app_content_types()))
def init_with_context(self, context): 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)], ])) # append an app list module for "Content" self.children.append( modules.AppList( _('Content'), models=itemlist_content, )) # append an app list module for "Miscellaneous" self.children.append( modules.AppList( _('Miscellaneous'), exclude=itemlist_misc_exclude, )) # append an app list module for "Structure" self.children.append( modules.AppList( _('Site Structure'), models=itemlist_structure, )) # append an app list module for "SL" self.children.append( modules.AppList( _('Second Life Systems'), models=itemlist_sl, )) # append an app list module for "System Management" self.children.append( modules.AppList( _('System Management'), models=itemlist_system, )) # append a recent actions module self.children.append(modules.RecentActions(_('Recent Actions'), 10))
def init_with_context(self, context): 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=[ [u'Настройки сайта', '/settings/MyApp'], [_('Return to site'), '/'], [ _('Change password'), reverse('%s:password_change' % site_name) ], [_('Log out'), reverse('%s:logout' % site_name)], ])) self.children.append( modules.ModelList( title=u'Страницы и Контент', models=( 'menu.models.Menu', 'pages.models.Page', 'gallery.models.Photo', 'news.models.Article', 'programs.models.Program', 'review.models.Review', 'slideshow.models.Slider', 'partners.models.Partner', ), )) self.children.append( modules.ModelList( title=u'Заявки и Подписки', models=( 'order.models.Order', 'homeform.models.OrderH', 'subscribe.models.Subscribe', ), )) # append a recent actions module self.children.append(modules.RecentActions(_('Recent Actions'), 5)) self.children.append( modules.ModelList( title=u'Пользователи', models=( 'django.contrib.auth.*', 'users.models.Profile', ), ))
def init_with_context(self, context): self.title = '1997 站点管理' site_name = get_admin_site_name(context) # append a link list module for "quick links" self.children.append( modules.LinkList( _('快速链接'), layout='inline', draggable=True, deletable=False, collapsible=False, children=[ [_('返回站点首页'), '/'], [_('修改密码'), reverse('%s:password_change' % site_name)], [_('注销'), reverse('%s:logout' % site_name)], ])) # append an app list module for "Applications" self.children.append( modules.AppList( _('应用'), exclude=('django.contrib.*', ), )) # append an app list module for "Administration" self.children.append( modules.AppList( _('管理员设置'), models=('django.contrib.*', ), )) # append a recent actions module self.children.append(modules.RecentActions(_('近期操作'), 5)) # append a feed module # self.children.append(modules.Feed( # _('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(_('其他管理页面'), children=[ { 'title': _('预约管理'), 'url': '/admin/r', 'external': True, }, { 'title': _('教师时段管理'), 'url': '/admin/t', 'external': True, }, ]))
def __init__(self, app_title, models, **kwargs): AppIndexDashboard.__init__(self, app_title, models, **kwargs) # append a model list module that lists all models # for the app and a recent actions module for the current app self.children += [ modules.ModelList(self.app_title, self.models), modules.RecentActions(include_list=self.models, limit=5) ]
def init_with_context(self, context): site_name = get_admin_site_name(context) self.children += [ modules.ModelList( u'Portal', models=('raizcidadanista.cms.models.Section', 'raizcidadanista.cms.models.Article', 'raizcidadanista.cms.models.ArticleComment', 'raizcidadanista.cms.models.Menu', 'raizcidadanista.cms.models.URLMigrate', 'raizcidadanista.cms.models.FileDownload', ), ), modules.ModelList( u'Cadastro', models=('cadastro.models.*', ), exclude=('cadastro.models.ListaCadastro', ), ), modules.ModelList( u'Municípios', [ 'municipios.models.*', ] ), modules.ModelList( u'Fórum', [ 'forum.models.*', ] ), modules.ModelList( u'Financeiro', [ 'financeiro.models.*', ] ), modules.ModelList( u'Configurações', models=('raizcidadanista.cms.models.Recurso', 'raizcidadanista.cms.models.Theme', ), extra=[ {'title': u'Visualizador de Arquivos', 'add_url': reverse('filebrowser:fb_upload'), 'change_url': reverse('filebrowser:fb_browse')}, ] ), modules.ModelList( u'Administração', models=('django.contrib.*', 'utils.models.*', 'raizcidadanista.cms.models.EmailAgendado', ), exclude=('django.contrib.sites.models.*', ), ), modules.LinkList( u'Links Rápidos', layout='inline', draggable=True, deletable=True, collapsible=True, children=[ [u'Portal', '/'], [u'Sugerir Artigo', reverse('admin:cms_article_add_power')], [u'Alterar Senha', reverse('admin:password_change')], [u'Reset Menu', reverse('admin:reset_dashboard')], [u'Sair', reverse('admin:logout')], ] ), modules.RecentActions(u'Últimas mudanças', 5), ]
def get_recent_actions_module(self): """ Instantiate the :class:`~admin_tools.dashboard.modules.RecentActions` module for use in the appliation index page. """ return modules.RecentActions(_('Recent Actions'), include_list=self.get_app_content_types(), limit=5, enabled=False, collapsible=False)