forked from nnmware/nnmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.py
117 lines (103 loc) · 3.64 KB
/
dashboard.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
from django.utils.translation import ugettext_lazy as _
from grappelli.dashboard import modules, Dashboard
from grappelli.dashboard.utils import get_admin_site_name
class NnmwareDashboard(Dashboard):
"""
Custom index dashboard for www.
"""
def init_with_context(self, context):
site_name = get_admin_site_name(context)
# append an app list module for "Applications"
self.children.append(modules.Group(
_('nnmware system boot:'),
collapsible=True,
column=1,
children = [
modules.AppList(
_('Core'),
column=1,
css_classes=('grp-collapse',),
models=('nnmware.core.*',
),
),
modules.AppList(
_('Money :: Addresses :: Video'),
column=1,
css_classes=('grp-collapse grp-closed',),
models=( 'nnmware.apps.money.*',
'nnmware.apps.address.*',
'nnmware.apps.video.*',
),
),
modules.AppList(
_('Shop'),
column=1,
css_classes=('grp-collapse grp-closed',),
models=( 'nnmware.apps.shop.*',
),
),
modules.AppList(
_('Booking'),
column=1,
css_classes=('grp-collapse grp-closed',),
models=( 'nnmware.apps.booking.*',
),
),
modules.AppList(
_('Dossier'),
column=1,
css_classes=('grp-collapse grp-closed',),
models=('nnmware.apps.dossier.*',),
),
modules.AppList(
_('Business'),
column=1,
css_classes=('grp-collapse grp-closed',),
models=('nnmware.apps.business.*',),
),
modules.AppList(
_('Administration Module'),
column=1,
css_classes=('grp-collapse grp-closed',),
models=( 'django.contrib.auth.*','nnmware.demo.*',
'django.contrib.sites.models.Site',
'django.contrib.flatpages.models.FlatPage','nnmware.apps.social.models.UserSocialAuth',
),
)
]
))
# append a recent actions module
self.children.append(modules.RecentActions(
_('Recent Actions'),
limit=10,
column=2,
))
# append another link list module for "support".
self.children.append(modules.LinkList(
_('nnmware.example'),
column=3,
children=[
{
'title': _('Main Page'),
'url': '/',
'external': False,
},
{
'title': _('Admin page'),
'url': '/admin/',
'external': False,
},
]
))
# append another link list module for "support".
self.children.append(modules.LinkList(
_('Engine Support'),
column=3,
children=[
{
'title': _('[email protected]'),
'url': 'mailto:[email protected]',
'external': True,
},
]
))