Skip to main content

Provide a global left sidebar for django admin site.

Project description

django-admin-global-sidebar

Provide a global left sidebar for django admin site.

Install

pip install django-admin-global-sidebar

Usage

Note

Using django-admin-global-sidebar will disable Django's default nav-sidebar by force.

pro/settings.py

INSTALLED_APPS = [
    ...
    'django_static_fontawesome',
    'django_static_jquery3',
    'django_admin_global_sidebar',
    ...
]

DJANGO_ADMIN_GLOBAL_SIDEBAR_MENUS = [
    {
        "title": "Home",
        "icon": "fa fa-home",
        "url": "/admin/",
    },{
        "title": "Settings",
        "icon": "fa fa-cogs",
        "children": [
            {
                "title": "User",
                "icon": "fas fa-user",
                "model": "auth.user",
                "permissions": ["auth.view_user",],
            },
            {
                "title": "Group",
                "icon": "fas fa-users",
                "model": "auth.group",
                "permissions": ["auth.view_group",],
            }
        ]
    }
]
  • Add django_static_fontawesome, django_static_jquery3 and django_admin_global_sidebar in INSTALLED_APPS.
  • Add sidebar menu settings in DJANGO_ADMIN_GLOBAL_SIDEBAR_MENUS.

DJANGO_ADMIN_GLOBAL_SIDEBAR_MENUS

  • Two level menu supported.
  • Menu item config options:
    • title
    • icon
    • children
    • url
    • model
    • view
    • permissions
    • active_patterns
  • title is the display title.
  • icon is fontawesome class.
  • children is sub-menu list settings.
  • url, model or view will be used to calc the menu link. Only one option will be applied.
  • url means a fixed link.
  • model means model's changelist view.
  • view means django's view name and the result link is calced with: revered(view).
  • permissions is the permission array.
    • Using or logic for permission elements.
    • A permission element can be a permission-tag or permission-tags.
    • Using and logic for permission-tags.
  • active_patterns used to determine the active status of the menu item.
    • Pattern will be used to test against the request.path.
    • It can be a pattern string or pattern string list.
    • Use or logic for patterns.

Releases

Release Time Changes Notice
v0.1.0 2020/04/23 1. First release.
v0.1.1 2020/06/20 2. Fix popup problem.
v0.1.2 2020/09/01 3. Depends on django-static-jquery3>=5.0.0.
v0.1.3 2020/09/23 4. Add app_requires.
v0.1.4 2021/04/12 5. Force disable nav-sidebar for Django3.2.
6. Fix global sidebar height in long page.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-admin-global-sidebar-0.1.4.tar.gz (9.0 kB view details)

Uploaded Source

File details

Details for the file django-admin-global-sidebar-0.1.4.tar.gz.

File metadata

  • Download URL: django-admin-global-sidebar-0.1.4.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.8

File hashes

Hashes for django-admin-global-sidebar-0.1.4.tar.gz
Algorithm Hash digest
SHA256 844fda739eb5ee309ec4296742d4b9f0c08509b3795009d87ef2a30bceada060
MD5 f9fc0b6581d3614314cdfbb420718c50
BLAKE2b-256 8b73dcc14925ce5e0848754a47a2ae9c164a1f0857e3526b788c0fb42b429029

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page