1 # -*- encoding: utf-8 -*
4 This file was generated with the customdashboard management command, it
5 contains the two classes for the main dashboard and app index dashboard.
6 You can customize these classes as you want.
8 To activate your index dashboard add the following to your settings.py::
9 ADMIN_TOOLS_INDEX_DASHBOARD = 'SIGMA.dashboard.CustomIndexDashboard'
11 And to activate the app index dashboard::
12 ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'SIGMA.dashboard.CustomAppIndexDashboard'
15 from django
.utils
.translation
import ugettext_lazy
as _
17 from admin_tools
.dashboard
import modules
, Dashboard
, AppIndexDashboard
18 from admin_tools
.utils
import get_admin_site_name
21 class CustomIndexDashboard(Dashboard
):
23 Custom index dashboard for SIGMA.
25 def init_with_context(self
, context
):
27 # append an app list module for "Applications"
28 self
.children
.append(modules
.AppList(
31 'project.dae.models.*',
32 'project.recrutement.models.*',
33 'project.rh.models.AyantDroit',
34 'project.rh.models.Dossier',
35 'project.rh.models.DossierInactif',
36 'project.rh.models.Employe',
37 'project.rh.models.EmployeInactif',
38 'project.rh.models.Poste',
42 # append an app list module for "Configuration"
43 self
.children
.append(modules
.AppList(
46 'project.rh.models.Classement',
47 'project.rh.models.Devise',
48 'project.rh.models.CategorieEmploi',
49 'project.rh.models.OrganismeBstg',
50 'project.rh.models.Responsable',
51 'project.rh.models.Service',
52 'project.rh.models.Statut',
53 'project.rh.models.TauxChange',
54 'project.rh.models.TypeContrat',
55 'project.rh.models.TypePoste',
56 'project.rh.models.TypeRevalorisation',
57 'project.rh.models.TypeRemuneration',
58 'project.rh.models.ValeurPoint',
60 exclude
=('django.contrib.*',),
63 # append an app list module for "Inter-systèmes"
64 self
.children
.append(modules
.AppList(
67 'project.rh.models.ResponsableImplantation',
71 # append an app list module for "Administration"
72 self
.children
.append(modules
.AppList(
79 # append a recent actions module
80 #self.children.append(modules.RecentActions(_('Recent Actions'), 5))
83 class CustomAppIndexDashboard(AppIndexDashboard
):
85 Custom app index dashboard for project.
88 # we disable title because its redundant with the model list module
91 def __init__(self
, *args
, **kwargs
):
92 AppIndexDashboard
.__init__(self
, *args
, **kwargs
)
94 def init_with_context(self
, context
):
96 Use this method if you need to access the request context.
98 if self
.app_title
!= 'Rh':
99 # append a model list module and a recent actions module
101 modules
.ModelList(self
.app_title
,self
.models
),
102 #modules.RecentActions(
103 # _('Recent Actions'),
104 # include_list=self.get_app_content_types(),
111 # append an app list module for "Application"
112 self
.children
.append(modules
.AppList(
115 'project.rh.models.AyantDroit',
116 'project.rh.models.Dossier',
117 'project.rh.models.DossierInactif',
118 'project.rh.models.Employe',
119 'project.rh.models.EmployeInactif',
120 'project.rh.models.Poste',
124 # append an app list module for "Configuration"
125 self
.children
.append(modules
.AppList(
128 'project.rh.models.Classement',
129 'project.rh.models.Devise',
130 'project.rh.models.CategorieEmploi',
131 'project.rh.models.OrganismeBstg',
132 'project.rh.models.Responsable',
133 'project.rh.models.Service',
134 'project.rh.models.Statut',
135 'project.rh.models.TauxChange',
136 'project.rh.models.TypeContrat',
137 'project.rh.models.TypePoste',
138 'project.rh.models.TypeRevalorisation',
139 'project.rh.models.TypeRemuneration',
140 'project.rh.models.ValeurPoint',
144 # append an app list module for "Inter-systèmes"
145 self
.children
.append(modules
.AppList(
146 _(u
'Inter-systèmes'),
148 'project.rh.models.ResponsableImplantation',
152 # append a recent actions module
153 #self.children.append(modules.RecentActions(
154 # _('Recent Actions'),
155 # include_list=self.get_app_content_types(),