Skip to content

Commit

Permalink
+ demo: install:
Browse files Browse the repository at this point in the history
  - haystack;
  - debug-toolbar
  - south
  - admin-tools
  • Loading branch information
olexiystrashko committed Jul 31, 2011
1 parent e9a8b6f commit 15cd06e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
12 changes: 7 additions & 5 deletions demo/conf/ext_apps/admin_tools/config.py
Expand Up @@ -3,17 +3,19 @@

class AdminToolsConfig(sigurd.BaseAppConfig):
ADMIN_TOOLS_THEMING_CSS = '../admin_themes/web/css/theme.css'
ADMIN_TOOLS_MENU = 'conf.ext_apps.admin_tools.menu.Menu'
ADMIN_TOOLS_MENU = 'conf.ext_apps.admin_tools.menu.CustomMenu'
ADMIN_TOOLS_INDEX_DASHBOARD = 'conf.ext_apps.admin_tools.dashboard.IndexDashboard'

def init_settings(self):
self.ADMIN_TOOLS_MEDIA_URL = self.main_settings.STATIC_URL + 'ext/'

def init_extensions(self):
self.install_app("admin_tools", prepend=True)
self.install_app("admin_tools.theming", prepend=True)
self.install_app("admin_tools.menu", prepend=True)
self.install_app("admin_tools.dashboard", prepend=True)
self.install_app("admin_tools.menu", prepend=True)
self.install_app("admin_tools.theming", prepend=True)
self.install_app("admin_tools", prepend=True)

self.install_context_processor('django.core.context_processors.request')

def init_urls(self, urlpatterns):
self.install_url(urlpatterns, r'^admin_tools/', 'admin_tools.urls', prepend=True)
self.install_url(urlpatterns, r'^admin_tools/', 'admin_tools.urls', prepend=True)
26 changes: 7 additions & 19 deletions demo/conf/ext_apps/admin_tools/dashboard.py
@@ -1,30 +1,18 @@
from admin_tools.dashboard.modules import ModelList
from django.utils.translation import ugettext_lazy as _
from admin_tools.dashboard import modules, Dashboard
from admin_tools.utils import get_admin_site_name


class IndexDashboard(Dashboard):
# we want a 2 columns layout
columns = 2

def init_with_context(self, context):
# append an app list module for "Administration"
self.children.append(modules.ModelList(
_('Administration'),
models=('django.contrib.*',),
self.children.append(ModelList(
title = _('Administration'),
deletable=False,
draggable=True,
collapsible=True,
include_list=('django.contrib',)
))

# 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': _('Django documentation'),
'url': 'http://docs.djangoproject.com/',
'external': True,
},
]
))
24 changes: 17 additions & 7 deletions demo/conf/ext_apps/admin_tools/menu.py
@@ -1,11 +1,21 @@
from django.core.urlresolvers import reverse
from admin_tools.menu import items, Menu


class Menu(Menu):
class CustomMenu(Menu):
def __init__(self, **kwargs):
super(Menu, self).__init__(**kwargs)
self.children += [
items.MenuItem('Admin Home', reverse('admin:index')),
items.MenuItem('Web-Site', '/'),
]
Menu.__init__(self, **kwargs)
self.children.append(items.MenuItem(
title=u'Main',
url=reverse('admin:index')
))
self.children.append(items.MenuItem(
title=u'Web-Site',
url='/'
))
self.children.append(items.Bookmarks(title=u'Bookmarks'))

def init_with_context(self, context):
"""
Use this method if you need to access the request context.
"""
pass
2 changes: 1 addition & 1 deletion demo/conf/profiles/dev.py
Expand Up @@ -19,7 +19,7 @@ def install_apps(self):

self.install_app(HaystackConfig)
self.install_app(SouthConfig)
self.install_app(AdminToolsConfig)
# self.install_app(AdminToolsConfig)
self.install_app(DebugToolbarConfig)

DevProjectConfig().export_settings(globals())

0 comments on commit 15cd06e

Please sign in to comment.