Rapport des postes par implantation
[auf_rh_dae.git] / project / menu.py
CommitLineData
e2c0b1ac
PP
1# -*- coding: utf-8 -*-
2
6f38ca31
PP
3"""
4This file was generated with the custommenu management command, it contains
5the classes for the admin menu, you can customize this class as you want.
6
7To activate your custom menu add the following to your settings.py::
8 ADMIN_TOOLS_MENU = 'project.menu.CustomMenu'
9"""
10
11from django.core.urlresolvers import reverse
12from django.utils.translation import ugettext_lazy as _
13
14from admin_tools.menu import items, Menu
595ad88d 15from project.rh.groups import grp_drh
6f38ca31
PP
16
17class CustomMenu(Menu):
18 """
19 Custom Menu for project admin site.
20 """
21 def __init__(self, **kwargs):
22 Menu.__init__(self, **kwargs)
23 self.children += [
24 items.MenuItem(_('Dashboard'), reverse('admin:index')),
d53e80f7 25 #items.Bookmarks(),
6f38ca31
PP
26 items.AppList(
27 _('Applications'),
28 exclude=('django.contrib.*',)
29 ),
6f38ca31
PP
30 items.AppList(
31 _('Administration'),
32 models=('django.contrib.*',)
33 )
34 ]
35
36 def init_with_context(self, context):
37 """
38 Use this method if you need to access the request context.
39 """
595ad88d
OL
40 request = context['request']
41 if grp_drh in request.user.groups.all() or request.user.is_superuser:
42 self.children += [
43 items.MenuItem('Rapports',
44 children=[
aed17d86 45 #items.MenuItem('Rapport des postes', reverse('rhr_postes')),
595ad88d 46 items.MenuItem('Rapport des contrats', reverse('rhr_contrats')),
aed17d86 47 #items.MenuItem('Rapport de rémunération', reverse('rhr_remuneration')),
783e077a
JPC
48 #items.MenuItem('Rapport des postes par service', reverse('rhr_postes_service')),
49 items.MenuItem('Rappor des postes par implantation', reverse('rhr_postes_implantation')),
595ad88d
OL
50 ]
51 ),
52 ]
53 super(CustomMenu, self).init_with_context(context)
54