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 _
16 from django
.core
.urlresolvers
import reverse
18 from admin_tools
.dashboard
import modules
, Dashboard
, AppIndexDashboard
19 from admin_tools
.utils
import get_admin_site_name
22 class CustomIndexDashboard(Dashboard
):
24 Custom index dashboard for SIGMA.
26 def init_with_context(self
, context
):
27 site_name
= get_admin_site_name(context
)
29 # append an app list module for "Applications"
30 self
.children
.append(modules
.AppList(
33 'project.dae.models.*',
34 'project.recrutement.models.*',
35 'project.rh.models.AyantDroit',
36 'project.rh.models.Dossier',
37 'project.rh.models.DossierInactif',
38 'project.rh.models.Employe',
39 'project.rh.models.EmployeInactif',
40 'project.rh.models.Poste',
44 # append an app list module for "Configuration"
45 self
.children
.append(modules
.AppList(
48 'project.rh.models.Classement',
49 'project.rh.models.Devise',
50 'project.rh.models.FamilleEmploi',
51 'project.rh.models.OrganismeBstg',
52 'project.rh.models.Responsable',
53 'project.rh.models.Service',
54 'project.rh.models.Statut',
55 'project.rh.models.TauxChange',
56 'project.rh.models.TypeContrat',
57 'project.rh.models.TypePoste',
58 'project.rh.models.TypeRevalorisation',
59 'project.rh.models.TypeRemuneration',
60 'project.rh.models.ValeurPoint',
64 # append an app list module for "Inter-systèmes"
65 self
.children
.append(modules
.AppList(
68 'project.rh.models.ResponsableImplantation',
72 # append an app list module for "Administration"
73 self
.children
.append(modules
.AppList(
80 # append a recent actions module
81 self
.children
.append(modules
.RecentActions(_('Recent Actions'), 5))
84 class CustomAppIndexDashboard(AppIndexDashboard
):
86 Custom app index dashboard for project.
89 # we disable title because its redundant with the model list module
92 def __init__(self
, *args
, **kwargs
):
93 AppIndexDashboard
.__init__(self
, *args
, **kwargs
)
95 def init_with_context(self
, context
):
97 Use this method if you need to access the request context.
99 if self
.app_title
!= 'Rh':
100 # append a model list module and a recent actions module
102 modules
.ModelList(self
.app_title
,self
.models
),
103 modules
.RecentActions(
105 include_list
=self
.get_app_content_types(),
112 # append an app list module for "Application"
113 self
.children
.append(modules
.AppList(
116 'project.rh.models.AyantDroit',
117 'project.rh.models.Dossier',
118 'project.rh.models.DossierInactif',
119 'project.rh.models.Employe',
120 'project.rh.models.EmployeInactif',
121 'project.rh.models.Poste',
125 # append an app list module for "Configuration"
126 self
.children
.append(modules
.AppList(
129 'project.rh.models.Classement',
130 'project.rh.models.Devise',
131 'project.rh.models.FamilleEmploi',
132 'project.rh.models.OrganismeBstg',
133 'project.rh.models.Responsable',
134 'project.rh.models.Service',
135 'project.rh.models.Statut',
136 'project.rh.models.TauxChange',
137 'project.rh.models.TypeContrat',
138 'project.rh.models.TypePoste',
139 'project.rh.models.TypeRevalorisation',
140 'project.rh.models.TypeRemuneration',
141 'project.rh.models.ValeurPoint',
145 # append an app list module for "Inter-systèmes"
146 self
.children
.append(modules
.AppList(
147 _(u
'Inter-systèmes'),
149 'project.rh.models.ResponsableImplantation',
153 # append a recent actions module
154 self
.children
.append(modules
.RecentActions(
156 include_list
=self
.get_app_content_types(),