Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- haystack; - debug-toolbar - south - admin-tools
- Loading branch information
1 parent
e9a8b6f
commit 15cd06e
Showing
4 changed files
with
32 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
}, | ||
] | ||
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters