Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

alpha version - present the admin user an overlay at the frontend website pages

Notifications You must be signed in to change notification settings

edoburu/django-admin-overlay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Django admin-overlay

This package displays an overlay (i.e. toolbar) at the frontend pages, when the user is logged in as administrator. It makes it easier to navigate through the site, or add a frontend-editoring toolbar to your project. This is implemented as Django middleware, which can be extended and customized for your own projects.

Feel free to fork the project, and contribute patches!

Installation

The setup.py has to suffice for now:

python setup.py install

Enabling the overlay

Settings to add:

INSTALLED_APPS += (
    'admin_overlay',
)

MIDDLEWARE_CLASSES += (
    'admin_overlay.middleware.AdminOverlayMiddleware',
)

Next, the static files can be linked:

./manage.py collectstatic --link

Optionally you can override the templates:

  • admin_overlay/head_end.html: is added just before the </head> tag.
  • admin_overlay/body_start.html: is added just after the <body> tag.
  • admin_overlay/body_end.html: is added just before the </body> tag.

The templates receive a RequestContext with the request field. No other context information is given.

Extending the overlay

It's perfectly fine (even encouraged) to inhert the AdminOverlayMiddleware class, to add your own presentation logic. The class defines some public settings, and methods which you can override.

The settings are:

  • allowed_status_codes: which HTTP status codes should enable the overlay. By default 200.
  • allowed_content_types: which content type does the overlay respond to? By default text/html and application/xhtml+xm.
  • head_end_template: which template to use for the content before the </head> tag, By default admin_overlay/head_end.html.
  • body_start_template: which template to use for the content after the <body> tag. By default admin_overlay/body_start.html.
  • body_end_template: which template to use for the content before the </body> tag. By default admin_overlay/body_end.html.

About

alpha version - present the admin user an overlay at the frontend website pages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages