{ "info": { "author": "Diederik van der Boor", "author_email": "opensource@edoburu.nl", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.11", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Framework :: Django :: 2.0", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. image:: https://img.shields.io/travis/edoburu/django-staff-toolbar/master.svg?branch=master\n :target: http://travis-ci.org/edoburu/django-staff-toolbar\n.. image:: https://img.shields.io/pypi/v/django-staff-toolbar.svg\n :target: https://pypi.python.org/pypi/django-staff-toolbar/\n.. image:: https://img.shields.io/pypi/l/django-staff-toolbar.svg\n :target: https://pypi.python.org/pypi/django-staff-toolbar/\n.. image:: https://img.shields.io/codecov/c/github/edoburu/django-staff-toolbar/master.svg\n :target: https://codecov.io/github/edoburu/django-staff-toolbar?branch=master\n\ndjango-staff-toolbar\n====================\n\nDisplaying staff-only controls at a webpage.\n\nFeatures:\n\n* Linking to the admin page of the current object.\n* Full configuration of the displayed toolbar items.\n* API for adding custom menu items.\n\n.. image:: https://github.com/edoburu/django-staff-toolbar/raw/master/docs/images/staff_toolbar.png\n :width: 142px\n :height: 136px\n :alt: django-staff-toolbar preview\n\n\nInstallation\n============\n\nFirst install the module, preferably in a virtual environment:\n\n.. code-block:: bash\n\n pip install django-staff-toolbar\n\n\nConfiguration\n-------------\n\nAdd the application to ``settings.py``:\n\n.. code-block:: python\n\n INSTALLED_APPS += (\n 'staff_toolbar',\n )\n\nMake sure the ``django.core.context_processors.request`` is included in ``TEMPLATE_CONTEXT_PROCESSORS``.\n\nAdd the HTML widget to the template:\n\n.. code-block:: html+django\n\n {% load staff_toolbar_tags %}\n\n {% staff_toolbar %}\n\nMake sure the layout is loaded in the template:\n\n.. code-block:: html+django\n\n \n\nLayout\n------\n\nBy default, a simple layout is included.\nYou can change this layout to your own liking.\n\nThe source SASS file is included, making it easier to\nintegrate this into your project stylesheets when needed.\n\n\nCustomizing the admin URL\n=========================\n\nThe admin URL is auto-detected using:\n\n* The ``object`` variable in the template.\n* The ``view.object`` variable in the template.\n\nIn some cases, this is not sufficient. When the auto-detected \"Change object\"\nlink does not point to the right page, this can be resolved using two methods:\n\nUsing the view\n--------------\n\nWhen your class-based-view implements ``staff_toolbar.views.StaffUrlMixin``,\nthat information will be used to render the proper \"Change object\" link.\n\nThis requires Django 1.5, which exports the ``view`` variable to the template.\n\nUsing the template\n------------------\n\nIn the template, you can include:\n\n.. code-block:: html+django\n\n {% set_staff_object page %}\n\nWhen needed, the URL can also be set:\n\n.. code-block:: html+django\n\n {% set_staff_url %}{% url 'dashboard:catalogue-product' object.id %}{% end_set_staff_url %}\n\n\nCustomizing the menu\n====================\n\nThe default menu settings are:\n\n.. code-block:: python\n\n STAFF_TOOLBAR_ITEMS = (\n 'staff_toolbar.items.AdminIndexLink',\n 'staff_toolbar.items.ChangeObjectLink',\n 'staff_toolbar.items.LogoutLink',\n )\n\nEach line represents a callable, which is called using ``(request, context)``.\nWhen a tuple is included, this is converted into a new ``Group`` object,\ncausing an additional ``