| 1 | # -*- coding: utf-8 -*- |
| 2 | |
| 3 | """ |
| 4 | This file was generated with the custommenu management command, it contains |
| 5 | the classes for the admin menu, you can customize this class as you want. |
| 6 | |
| 7 | To activate your custom menu add the following to your settings.py:: |
| 8 | ADMIN_TOOLS_MENU = 'project.menu.CustomMenu' |
| 9 | """ |
| 10 | |
| 11 | from django.core.urlresolvers import reverse |
| 12 | from django.utils.translation import ugettext_lazy as _ |
| 13 | |
| 14 | from admin_tools.menu import items, Menu |
| 15 | |
| 16 | |
| 17 | class 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')), |
| 25 | #items.Bookmarks(), |
| 26 | items.AppList( |
| 27 | _('Applications'), |
| 28 | exclude=('django.contrib.*',) |
| 29 | ), |
| 30 | items.MenuItem('Rapports', |
| 31 | children=[ |
| 32 | items.MenuItem('Rapport des postes', reverse('rhr_postes')), |
| 33 | items.MenuItem('Rapport des contrats', reverse('rhr_contrats')), |
| 34 | items.MenuItem('Rapport de rémunération', reverse('rhr_remuneration')), |
| 35 | ] |
| 36 | ), |
| 37 | items.AppList( |
| 38 | _('Administration'), |
| 39 | models=('django.contrib.*',) |
| 40 | ) |
| 41 | ] |
| 42 | |
| 43 | def init_with_context(self, context): |
| 44 | """ |
| 45 | Use this method if you need to access the request context. |
| 46 | """ |
| 47 | return super(CustomMenu, self).init_with_context(context) |